-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
import/no-extraneous-dependencies: Complains about node standard libraries #1396
Comments
I wonder if perhaps eslint 6 handles path differently with the node env? Either way we should use the resolve module’s isCore method for this. |
i catch similar bug |
Try set packageDir for import/no-extraneous-dependencies rule. |
There does appear to have been a change to resolution. With ESLint v6, e.g. |
If so that’s a major bug; can you provide a minimal repro? |
Also can you confirm if eslint is depending on |
I don't think it's If I log the inputs to I see e.g.
I believe this issue comes from |
I mean, it makes perfect sense to me that the webpack resolver maps core modules to their respective browser shims - but i don’t know why eslint 6 would change that. |
I'm seeing the same issue after upgrading to eslint v6. I can't explain why it works, but try adding this to your eslint config:
|
Adding onto @kelchm 's solution, ...
settings: {
'import/resolver': {
node: {}, // placed above other resolver configs
webpack: { ... }
}
}
} |
The above worked for me as well. We had a repo where most files ran through webpack, but a few were Node configs. Overriding those to use the As such, I don't think there was a bug here. |
The |
Correct. |
If I revert back from [email protected] to @5.16.0, while leaving [email protected] then the problem goes away. Making the change #1396 (comment) with [email protected] also makes the problem go away. |
Update travis node versions Work arounf for bug: import-js/eslint-plugin-import#1396
Does any one know why this works? 🤔 |
It may be that the |
It's a bug in eslint-plugin-import import-js/eslint-plugin-import#1396
doesnt seem to work |
#1396 (comment) is the proper solution. Please file a new issue if you're still having trouble with the latest release. |
…rd libraries use `node` for import/resolver. @see import-js/eslint-plugin-import#1396 (comment)
- Replace old-school stores with createSlice based ones - HelloWorld: Use hooks instead of connect - Post gen project: Also delete *.stories.js files when storybook is not selected - Upgrade storybook to latest - make storybook: Use exposed port inside container too so the link to localhost in console works - Add fix for import-js/eslint-plugin-import#1396 - Add useEffectOnce hook from plastok Tested both with and without storybook via a local project. see https://thorgatedigital.atlassian.net/browse/IN-1941
- Replace old-school stores with createSlice based ones - HelloWorld: Use hooks instead of connect - Post gen project: Also delete *.stories.js files when storybook is not selected - Upgrade storybook to latest - make storybook: Use exposed port inside container too so the link to localhost in console works - Add fix for import-js/eslint-plugin-import#1396 - Add useEffectOnce hook from plastok Tested both with and without storybook via a local project. see https://thorgatedigital.atlassian.net/browse/IN-1941
I'm using eslint 7.29.0 'webpack-merge' should be listed in the project's dependencies, not devDependencies.eslintimport/no-extraneous-dependencies My file is below development.config.js
package.json
|
@AakashAlagarsamy and is your eslint configured to allow dev deps in that file? |
It's a bug in eslint-plugin-import import-js/eslint-plugin-import#1396
- Replace old-school stores with createSlice based ones - HelloWorld: Use hooks instead of connect - Post gen project: Also delete *.stories.js files when storybook is not selected - Upgrade storybook to latest - make storybook: Use exposed port inside container too so the link to localhost in console works - Add fix for import-js/eslint-plugin-import#1396 - Add useEffectOnce hook from plastok Tested both with and without storybook via a local project. see https://thorgatedigital.atlassian.net/browse/IN-1941
It throws an error which says
'path' should be listed in the project's dependencies. Run 'npm i -S path' to add it
.The eslintrc contains environment configuration:
It does not throw this error with eslint 5.x.x only with 6.x.x
The text was updated successfully, but these errors were encountered: