Closed akloeber closed 4 years ago
Hey there. I encounter the same problem, but I have a little bit more information to share.
Actually everything works normally, as long as you run eslint-loader
with eslint@6.6.0
. This error starts appearing when you update eslint
past 6.6.0
(I tried with 6.7.0
, 6.8.0
, 7.0.0
, and 7.4.0
versions).
I also tried to downgrade eslint-loader
just in case, but all the releases from 3.0.2
to 4.0.2
(I didn't go below that) display the same error. I do think the problem lies in eslint-loader
though, but you'll surely have to check the (huge) changelog of eslint@6.7.0
to find why.
Alright after investigation, the problem comes from eslint. They introduced a new way to handle ignored paths in this commit, which tries to load the eslint config of the file it's working on (don't ask me why, idk, there must be a reason).
The thing is, using CLIEngine
is deprecated, so it's hard to tell if it's a real bug on eslint's side or not. I didn't have the time to investigate much longer.
Here's the debug from eslint:
eslint:cascading-config-array-factory Load config files for /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js. +72ms
eslint:cascading-config-array-factory No cache found: /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js. +0ms
eslint:config-array-factory Loading legacy config file: /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js/.eslintrc +72ms
eslint:config-array-factory Config file found: /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js/.eslintrc +3ms
eslint:config-array-factory Loading {extends:"eslint:recommended"} relative to /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js/.eslintrc +0ms
eslint:config-array-factory Loading JS config file: /home/closingin/eslint/conf/eslint-recommended.js +0ms
eslint:config-array-factory Loading {extends:"plugin:react/recommended"} relative to /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js/.eslintrc +1ms
eslint:config-array-factory Loading plugin "react" from /home/closingin/eslint-loader-ignore-bug/node_modules/react-plotly.js/.eslintrc +0ms
eslint:config-array-factory Failed to load plugin 'react' declared in 'node_modules/react-plotly.js/.eslintrc'. +0ms
HI @closingin, @akloeber
Please use eslint-webpack-plugin
. eslint-loader
will be deprecated.
related #328
Expected Behavior
Plugins referenced by
.eslintrc
file that resides in folder ignored via.eslintignore
(likenode_modules
) should not cause any warnings. The config should be completely ignored because it is not required for linting as the associated files are ignored.Actual Behavior
If there is a
.eslintrc
file somewhere in a folder ignored via.eslintignore
(e.g.node_modules
) and that config references a plugin which is not installed resp. needed in the outer project the following warning is raised:Code
Repo to reproduce this bug can be found at https://github.com/akloeber/eslint-loader-ignore-bug. In this case
node_modules/react-plotly.js/.eslintrc
references plugineslint-plugin-react
which is not installed by the outer project.How Do We Reproduce?
Run
yarn build
orwebpack
directly.