Bug: [new config system] globs are ignoring dot files
See original GitHub issueEnvironment
Node version: v16.14.0 npm version: v8.3.1 Local ESLint version: v8.23.0 (Currently used) Global ESLint version: Not found Operating System: win32 10.0.19044
What parser are you using?
Default (Espree)
What did you do?
// eslint.config.js
module.exports = [];
// .foo.js
npx eslint *.js -f tap
What did you expect to happen?
Per the RFC, this should include .foo.js
?
- Defaults - by default, ESLint will ignore
node_modules
and.git
directories only. This is different from the current behavior where ESLint ignoresnode_modules
and all files/directories beginning with a dot (.
).
In that case, I would expect this output:
TAP version 13
1..2
ok 1 - D:\tmp\tmp\.foo.js
ok 2 - D:\tmp\tmp\eslint.config.js
What actually happened?
The .foo.js
file was not linted:
TAP version 13
1..1
ok 1 - D:\tmp\tmp\eslint.config.js
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Issue Analytics
- State:
- Created a year ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
fix: Ensure that dot files are found with globs. #16550 - GitHub
I had to adjust some existing tests because they had dot files in the directories ... Bug: [new config system] globs are ignoring...
Read more >how to glob every hidden file except current and parent directory
The first glob below requires a leading dot and at least one additional non-dot character. These two globs together will match any possible...
Read more >rg <Pattern> [Path...] - Fig.io
Options ; --no-heading, Don't group matches by each file ; --no-ignore, Don't respect ignore files (.gitignore, .ignore, etc.) ; --no-ignore-dot, Don't respect ....
Read more >Configuring Jest
Thresholds for globs are applied to all files matching the glob. If the file specified by path is not found, an error is...
Read more >Why do glob.glob and pathlib.Path.glob treat hidden files ...
I'd like to know if this is intended or possibly a bug/oversight. The glob module documentation states that files starting with a dot...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now that we have rewritten the search functionality, we are actually finding dot files by default. As it is now, it will end up being more difficult to mimic the eslintrc functionality than it will be to ensure the originally intended functionality works. Given that, I think the best path forward now is to include dot files in the glob patterns by default.
@mvorisek this issue and the fix are only about the new config system (
eslint.config.js
).In the current config system, dotfiles and dotfolders are still ignored by default, as described in Ignoring Code. That will remain unchanged in the current config system, so the solution is to unignore them either in
.eslintignore
file or withignorePatterns
config option, just like you did.