Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno lint should respect .gitignore #6805

Closed
newtack opened this issue Jul 19, 2020 · 7 comments
Closed

deno lint should respect .gitignore #6805

newtack opened this issue Jul 19, 2020 · 7 comments

Comments

@newtack
Copy link

newtack commented Jul 19, 2020

I have node modules in a subfolder, which is in the .gitignore file but deno lint still tries to lint it.

Can you either automatically disable/ignore linting for any files/folders in the .gitignore file or provide some option to ignore a folder/file?

@bartlomieju bartlomieju transferred this issue from denoland/deno_lint Jul 19, 2020
@bartlomieju bartlomieju changed the title .gitignore deno lint should respect .gitignore Jul 19, 2020
@bartlomieju
Copy link
Member

@newtack I've transfered the issue to main deno repo because deno_lint is not responsible for finding and reading the files.

This is essentially the same request as in #4459 but for deno lint

@ianwijma
Copy link

Hhmm, I personally have issues with respecting a .gitgnore file. Because I personally use mercurial often. So I don't have .gitignore files in all my projects. So maybe a .denoignore file would be a better solution IMO.

@trivikr
Copy link
Contributor

trivikr commented Jul 27, 2020

How about moving source files to a different folder (like src) in project to keep them separate from rest of the tooling (like node_modules)?

This way, the particular operations (like deno lint) can be run only one files in src folder.

As @ianwijma mentioned in the post above, Deno commands by default should n0t go through options of any particular version control system (like .gitignore), or equivalent tooling in Node.js (.eslintignore of ESLint for lint or .prettierignore of prettier for fmt)

The Deno commands may choose to provide an option to pass ignore file though.
For example, deno lint --ignoreFile .gitignore <filesToLint>

@schwarzkopfb
Copy link
Contributor

@newtack deno lint --unstable --ignore=./node_modules/ solves your problem (since v1.3.0).

@Brooooooklyn
Copy link
Contributor

Brooooooklyn commented Aug 23, 2020

Just published @node-rs/deno-lint, it's respect .gitignore .eslintignore as default, (oh I forgot to add support for .denolintignore 🤣)

@bartlomieju
Copy link
Member

@newtack deno lint --unstable --ignore=./node_modules/ solves your problem (since v1.3.0).

Right, I'm not willing to add automatic ignore of files in .gitignore as it's against conventions in CLI that do not pick up any files automatically. --ignore flag is the way to go.

@newtack
Copy link
Author

newtack commented Aug 23, 2020

Makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants