-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
New: Do not exclude dot files by default #55
Closed
mightyiam
wants to merge
1
commit into
eslint:master
from
mightyiam:2020-no-exclude-dotfiles-by-default
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
- Repo: eslint/eslint | ||
- Start Date: 2020-05-23 | ||
- RFC PR: | ||
- Authors: Shahar Dawn Or (@mightyiam) | ||
|
||
# Do not exclude dot files by default | ||
|
||
## Summary | ||
|
||
ESLint excludes dot files (files whose names begin with `.`) by default. This is a proposal to remove this default exclusion. | ||
|
||
## Motivation | ||
|
||
Exclution of dot files by default does not seem like a reasonable default. Dot files that are JavaScript files seem common in JavaScript projects. It feels safe to assume that many projects have potential lint errors in such files, because they don't know about this default exclusion. | ||
|
||
Removing this exclusion would effectively turn on linting for dot files in existing and future usages. This feels like reasonable default behavior. | ||
|
||
## Detailed Design | ||
|
||
Remove the ignore pattern for dot files from the default configuration. | ||
|
||
## Documentation | ||
|
||
It will be announced in the release notes of the major version it is introduced in. | ||
|
||
## Drawbacks | ||
|
||
See next chapter. | ||
|
||
## Backwards Compatibility Analysis | ||
|
||
Many existing usages are expected to fail linting, forcing them to fix and/or ignore the new lint errors in newly linted dot files. Or ignore the dot files. | ||
|
||
No attempt to minimize disruption other than announcing the change in the release notes. | ||
|
||
## Alternatives | ||
|
||
Alternatives have not come to mind. | ||
|
||
## Open Questions | ||
|
||
Why is ESLint currently ignoring dot files by default? | ||
|
||
Does ESLint have a test that is run against many public usages, where statistics of this change could be obtained? | ||
|
||
## Help Needed | ||
|
||
Where is the dot files pattern in the implementation code and which tests would have to be modified, please? | ||
|
||
## Frequently Asked Questions | ||
|
||
Q: Do you have real examples of JavaScript dot files in projects where the authors are under the false assumption that those files are linted, where in truth, the are not? | ||
|
||
A: [Prettier](https://prettier.io/) is [used by ~1.7m projects](https://github.com/prettier/prettier/network/dependents). One of the [default configuration file names](https://prettier.io/docs/en/configuration.html) is `.prettierrc.js`. How many of the usages of Prettier use that file name? How many of them _do not_ explicitly include dot files? How many of them are not aware that that file is not linted? Prettier is only one example. I did not attempt to answer these questions. | ||
|
||
## Related Discussions | ||
|
||
Issue [#13342](https://github.com/eslint/eslint/issues/13342), which is a follow-up from issue [#10341](https://github.com/eslint/eslint/issues/10341). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another example here: In Ember applications we actually ended up adding
!.*
to the default.eslintignore
due to folks accidentally assuming they were already checked.ember-cli/ember-cli#8070
More info / background also in eslint/eslint#10341