node_modules file is not ignored correctly if it contains eslint config
See original GitHub issueRelated: https://github.com/microsoft/vscode-eslint/issues/1240
And also #14533, #14546. They are both closed, but actually it is a bug IMO.
node_modules
is already in my .eslintignore
. (**/node_modules
does not work too)
I don’t know should it be fixed in ESLint core or the related vscode extension. And I don’t know if any other related editors share the same issue.
Tell us about your environment
- ESLint Version: v7.27.0
- Node Version: v12.22.1
- npm Version: 7.18.1
- Operating System: macOS 12
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
Please show your full configuration:
N/A
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
N/A
yarn eslint node_modules/stylelint/lib/cli.js
What did you expect to happen?
report file ignored warning
What actually happened? Please copy-paste the actual, raw output from ESLint.
❯ yarn eslint node_modules/stylelint/lib/cli.js (master|●11)
yarn run v1.22.10
$ /Users/JounQin/Workspaces/Alauda/icarus/node_modules/.bin/eslint node_modules/stylelint/lib/cli.js
Oops! Something went wrong! :(
ESLint: 7.27.0
ESLint couldn't find the config "stylelint" to extend from. Please check that the name of the config is correct.
The config "stylelint" was referenced from the config file in "/Users/JounQin/Workspaces/Alauda/icarus/node_modules/stylelint/package.json".
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Steps to reproduce this issue:
https://github.com/alauda/k8s-form-in-action
run yarn && yarn eslint node_modules/stylelint/lib/cli.js
Are you willing to submit a pull request to fix this bug?
Yes
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (18 by maintainers)
Top GitHub Comments
If it is confirmed should be fixed, I’ll take a look at tonight or tomorrow.
I’ve confirmed this is most likely a bug, however, I don’t think it’s one we want to fix at this point. The problem is the complexity of the way the eslintrc config files work, and any time we touch or change things, we run the risk of introducing other errors along the way. It’s this complexity that has led us towards a new, simpler config system that will replace it. We made the decision to freeze eslintrc to minimize any further disruptions to our users while we work on transitioning to a new config system.