Use .gitignore by default if no .eslintignore is found
See original GitHub issueThis is a proposal intended to reduce the friction for the adoption of eslint into a project. Most times, files which are not version controlled are also not linted (node_modules
being a common example, but also compiled code and dynamically generated files as well). Currently, every project must either create an .eslintignore
file to specify those files, or if they are using a .gitignore
, they can add a command line flag like --ignore-pattern .gitignore
. But in both cases they must take an action to prevent non-controlled files from being linted.
In the Gitter chat room earlier today, @gabmontes suggested that we could default to using a .gitignore
file if no .eslintignore
file is found (and of course no --ignore-path
or --ignore-pattern
was provided).
I believe this is a sane default. It is easily overridden, but will be sufficient for the vast majority of users. It will help avoid config file clutter, and lower the learning curve for getting started with ESLint.
I’d be willing to implement this if it is accepted, although I’m guessing this could be seen as a breaking change and may need be held until a major version bump.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
Ah, forget about tricky solution: symlinking .eslintignore to .gitignore usually works just fine.
@zxqfox we made
--ignore-path .gitignore
work correctly so that people had the option to use their.gitignore
file for this purpose. I think that’s the correct recommendation for solving this problem rather than changing the default behavior.