ESLint: Unable to resolve path to module
See original GitHub issueWe have solution for absolute path, like this:
import MyComponent from 'src/components/MyComponent'
It is work fine for yarn start
, but for yarn lint
:
Unable to resolve path to module 'src/components/MyComponent' import/no-unresolved
I have solution for my other project (no RSK) with WebStorm:
-
project_dir - Mark Directory as > Resource Root
-
yarn add eslint-import-resolver-webpack -D
-
config/default.js
...
resolve: {
// We can now require('file') instead of require('file.jsx')
extensions: ['', '.js', '.jsx', '.scss'],
alias: {
src: path.resolve(__dirname, '../src')
}
},
...
- .eslintrc.js
/* global __dirname */
const path = require('path');
...
settings: {
'import/resolver': {
webpack: {
config: path.join(__dirname, '/config', 'default.js')
}
}
}
...
How to solve this issue for RSK? Please help me.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:23
Top Results From Across the Web
Using eslint with typescript - Unable to resolve path to module
Show activity on this post. You can set the ESLint module import resolution by adding this snippet to your . eslintrc. json configuration...
Read more >ESLint Unable to resolve path to module
Visual Studio 2022 shows errors for tsconfig paths when it's actually able to find them. ... Please fix these issues! ... Thanks for...
Read more >eslint/eslint - Gitter
I'm trying to setup eslint-plugin-import but I can't make it work xD ... 6:8 error Unable to resolve path to module '~/components' import/no-unresolved....
Read more >eslint-plugin-import Unable to resolve path to module
Module resolution. We often encounter the problem that the module cannot be resolved after introducing the eslint-plugin-import plugin.
Read more >Can't resolve path alias : r/reactjs - Reddit
src/App.tsx 7:0-53 Module not found: Error: Can't resolve '$/features/counter/Counter' in '\frontend\src'. I added these to tsconfig.json
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
“import/no-unresolved”: “off”
(as temporary solution)
As @karanssj4 linked to, this seems to be fixed by adding the following to
.eslintrc