-
Notifications
You must be signed in to change notification settings - Fork 337
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-unresolved with webpack modules/aliases in the VS Code #464
Comments
I can reproduce the similar error, with Type Error in webpack configuration. (when webpack.config.js can not be launched). |
This was driving me bonkers and I was getting other odd errors from the import plugin. Just for kicks I put: require('babel-register') at the top of my .eslintrc and magically everything seems to work now! (I was already using It seems like vscode-eslint runs eslint as a library, and JS imports aren't recognized without |
@ValeryVS how to you launch eslint from the terminal. I think this is related to #455 (comment) @alecf adding |
@dbaeumer Our project is bundled with node 8. But there is The wierd thing is, that in most of my files I have strange errors, like at the first image in that issue. But, when I add one more resolver in my 'node': {
'paths': [
__dirname,
],
}, resolve errors are gone, and I, finally, saw the real error
|
1.1 require('babel-register')({
presets: [ 'es2015', 'stage-2' ],
}); It wasn't help me before, because, with default settings, it can't handle spread operator. |
@ValeryVS thanks for the great analysis. Very helpful. I will keep the item open to look into 2 and 3 |
Still have this issue with VSCode 1.30.1 Here I found workaround but don't understand how to fix .eslintrc file. No solution to the problem found still? |
@alecf Can you show your root .eslintrc workaround? |
I changed webpack config from this: It seems to be ok. But intellisence not showing fresh added methods in imported file, |
Thanks @alecf for the workaround. Switching from Still, I don't think this hack should be necessary, seems like this is a bug in the VSCode plugin, if the CLI works fine without the hack. By the way, this only started happening to me after upgrading to Babel 7 and switching from |
Regarding #464 (comment) Can someone provide me with a GitHub repository that I can clone with steps on how to reproduce this? Regarding using a different node version than the one that is shipped in VS Code. Use the |
Maybe this extention should parse |
I think if this is necessary then eslint itself or the corresponding eslint plugin should read the |
Seems that it's |
I will close the issue. There is now a setting |
Update:
So, there are few separate issues.
Object.assign
, or usebabel-register
.Unexpected token ...
as ESLint error and showno-undesolved
,no-duplicate
and other.Which is wrong - it should be
SyntaxError
in ESLint output.It happens because node v7.9.0 in VS Code can't launch webpack config with object spread syntax.
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.
The text was updated successfully, but these errors were encountered: