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
Bug: Can't unignore file in flat config #17964
Comments
This works as intended because, in flat config, these are minimatch patterns, and per the minimatch rules The following patterns would ignore everything under
I think we should explain this better in the documentation and migration guide. |
Question: How to unignore file in |
The problem is that the following doesn't unignore
It's most likely because
|
Thanks, it seems works! I'm going to use
|
I have to say it's really odd.. I guess, my patterns won't work if directory contains Another thing is that it seems we treat patterns starts with |
I think this is the same problem as with .gitignore patterns, and the solution would be similar:
That said, some behavior of flat config ignore patterns does look odd, I'll double-check whether everything works as intended.
This is intended. In flat config, patterns should not start with This is different from .gitignore, where |
Doesn't work as I tested, it will unignore all files. |
I'd expect this to ignore everything under |
Looks like a bug to me, I'm working on this. |
@mdjermanovic #17980 upgrades |
Yes, I'll add test cases. |
Tests: #18018 I'm working on the docs now. |
* test: add more tests for ignoring files and directories Refs #17964 * add one more test
* docs: add more examples to flat config ignores docs Fixes #17964 * Update docs/src/use/configure/ignore.md Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> * clarify second example --------- Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Environment
Node version: v18.18.0
npm version: v9.4.2
Local ESLint version: v8.56.0 (Currently used)
Global ESLint version: Not found
Operating System: linux 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
What parser are you using?
Default (Espree)
What did you do?
Configuration
What did you expect to happen?
Should report error for
files/should-be-linted.js
file.What actually happened?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-48wnlw?description=Starter%20project%20for%20Node.js,%20a%20JavaScript%20runtime%20built%20on%20Chrome%27s%20V8%20JavaScript%20engine&file=package.json,eslint.config.js,files%2Fshould-be-linted.js&title=node.new%20Starter
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: