-
Notifications
You must be signed in to change notification settings - Fork 509
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
Use .gitignore as default for lint ignores #517
Comments
While I think this proposal makes sense for a default case, ESLint decided against making this the default case: eslint/eslint#5848.
Did you mean multiple
It's listed as a workaround in the ESLint issue. I don't see why this wouldn't work. Some other things:
|
|
I haven't used one in a while and the last time I did for development I used a VM 😅 So I can't say for sure
I mean, I'm not going to go out there and officially recommend it, especially as that's more an upstream issue with ESLint, which, afaik, hasn't given an official workaround. The only other option I can think of is using |
Current Behavior
Right now if .js/.ts/etc files are generated by tooling, they are included in lint config. This makes it difficult to read the files if editors are configured to show lint errors. It also will mess up the lint command, and do unnecessary work when formatting.
Desired Behavior
.gitignored files should be ignored for linting and formatting. It probably also makes sense to use user-provided files as overrides when present.
Suggested Solution
.gitignore should be used as the default for .eslintignore/.prettierignore. I see little reason to include files that won't ever be checked in.
These can be configured in the underlying tools: eslint and prettier.
People using IDEs would have to update their configuration to reflect this. For example, in VSCode, you'd want to set
Who does this impact? Who is this for?
This change is for people who generate .js/.ts/etc files with various tooling.
Describe alternatives you've considered
It's also possible to accomplish this by symlinking the .gitignore file to .eslintignore and .prettierignore, but it is not obvious that the files would update together, and overriding the behavior is unclear. I'm also not sure how that would work on Windows.
Additional context
ESLint allows multiple files supplied to the command to ignore them all. Rather than the .gitignore default/override solution I've proposed, it might be nice to have a .gitignore base/augmentation solution where the files in .gitignore are always ignored, and the user provided files add to those. This would require changing prettier and the prettier IDE integrations though, so it would require more work and package maintainer buy-in.
The text was updated successfully, but these errors were encountered: