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?
@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 https://github.com/denoland/deno/issues/4459 but for deno lint
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.
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>
@newtack deno lint --unstable --ignore=./node_modules/ solves your problem (since v1.3.0).
Just published @node-rs/deno-lint, it's respect .gitignore .eslintignore as default, (oh I forgot to add support for .denolintignore 馃ぃ)
@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.
Makes sense. Thanks!
Most helpful comment
Right, I'm not willing to add automatic ignore of files in
.gitignoreas it's against conventions in CLI that do not pick up any files automatically.--ignoreflag is the way to go.