-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: inconsistent ignoring files #15931
Comments
Hi @vitonsky, thanks for the issue!
Your shell expands the glob and sends a list of files to eslint, which then sees them as if they were entered one by one on the command line and reports the ignored ones because it assumes you would not want to skip linting any files that were explicitly listed on the command line. Can you try with quotes:
This way, eslint will get the glob instead of a list of files. |
Yes, it's solve my problem, thank you. But what about some CLI flag allowed ignore to all files listed explicitly? It's useful to other cases. For example, when i use eslint with I think it's be useful if we can do something like |
Actually, for an ignored file eslint will just return a lint warning. In your example, Since Unless you're using |
Ok, thanks for explaining. Now all clear for me. |
Environment
Node version: 14.18
npm version: 6.14.15
Local ESLint version: 7.32
Global ESLint version: 7.32
Operating System: ubuntu
What parser are you using?
@typescript-eslint/parser
What did you do?
node_modules
to.eslintignore
fileeslint --fix **/*.{ts,tsx,js}
What did you expect to happen?
All files in project except
node_modules
will scanned and fixedWhat actually happened?
Eslint confused and don't understand what i want. Eslint display a weird and pointless suggestions.
Participation
Additional comments
Probably it may be solved if i will modify comand
eslint --fix **/*.{ts,tsx,js}
to excludenode_modules
, but in this case a file.eslintignore
absolutely useless, so i don't think it's expected behaviorThe text was updated successfully, but these errors were encountered: