import/no-unresolved with webpack modules/aliases in the VS Code
See original GitHub issueUpdate:
So, there are few separate issues.
- To fix issue now, I can adjust my config: replace object spreading with
Object.assign
, or usebabel-register
. - Something interpret
Unexpected token ...
as ESLint error and showno-undesolved
,no-duplicate
and other. Which is wrong - it should beSyntaxError
in ESLint output. It happens because node v7.9.0 in VS Code can’t launch webpack config with object spread syntax. - May be
vscode-eslint
can launch.eslintrc.js
and webpack config with local node, not with bundles one?
Original text
Faced with such issue. There is no errors while launching eslint from terminal.
Trying to reproduce error in clean repository, but without success yet.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Solve Module Import Aliasing for Webpack, Jest, and VSCode
Complication 1: While Webpack knows how to resolve these aliases now, VS Code doesn't, so tools like Intellisense won't work.
Read more >Make VS code read webpack.config and recognize path with ...
I do have VSCode (1.3.1) recognizing webpack's aliases in js files. Aliases do not work in typescript. Are you talking about javascript or...
Read more >Bundling Extensions - Visual Studio Code
Webpack is a development tool that's available from npm. To acquire webpack and its command line interface, open the terminal and type:
Read more >jsconfig.json Reference - Visual Studio Code
For IntelliSense to work with webpack aliases, you need to specify the paths keys with a glob pattern. For example, for alias 'ClientApp':...
Read more >React JavaScript Tutorial in Visual Studio Code
To open your React application in VS Code, open another terminal or command ... If you are using webpack together with your React...
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
This was driving me bonkers and I was getting other odd errors from the import plugin. Just for kicks I put:
at the top of my .eslintrc and magically everything seems to work now! (I was already using
babel-register
elsewhere in my project, so it was already installed)It seems like vscode-eslint runs eslint as a library, and JS imports aren’t recognized without
babel-register
I changed webpack config from this:
resolve: { alias: { '~': path.resolve(__dirname), '@': path.resolve(__dirname, './src'), }, },
to this:resolve: { alias: { '~': path.resolve(__dirname), '@': path.resolve(__dirname, 'src'), }, },
It seems to be ok. But intellisence not showing fresh added methods in imported file, but show arguments intellisence after I writing the name of “fresh” method completely.