-
-
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
eslint-import-resolver-webpack swallows errors in webpack.config.js #536
Comments
Ah, yeah, that makes sense. Could still re-emit the original message, but would be ideal to prefix with |
That would decrease the setup pain even more! 👍 |
Btw, it's working fine now and it's an absolutely awesome plugin! Thanks for your work :) |
Resolve errors are most likely caused by invalid configuration, and the reason is easier to determine with the full details rather than just `err.message`. See import-js#536 With this change, it reports something like: ``` import/no-unresolved: Resolve error: SyntaxError: Unexpected token import at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at module.exports (/__censored__/webpack/configFactory.js:216:3) at configProdClient (/__censored__/webpack/configProdClient.js:5:36) at Object.<anonymous> (/__censored__/webpack/configForEslintImportResolver.js:1:126) ```
PR: #599 I've hit the same error, but I use Atom which starts eslint by itself, so instead of "starting eslint with babel-node", I've required |
Resolve errors are most likely caused by invalid configuration, and the reason is easier to determine with the full details rather than just `err.message`. See import-js#536 With this change, it reports something like: ``` import/no-unresolved: Resolve error: SyntaxError: Unexpected token import at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at module.exports (/__censored__/webpack/configFactory.js:216:3) at configProdClient (/__censored__/webpack/configProdClient.js:5:36) at Object.<anonymous> (/__censored__/webpack/configForEslintImportResolver.js:1:126) ```
More generally: #819 |
I was seeing the following error for each of my checked files:
1:0 error Resolve error: Unexpected token import
I was trying to understand why (correct plugin configuration, babel and webpack setup correctly) for about 1h until I realized, that I forgot to start
eslint
withbabel-node
and mywebpack.config.js
was written in babel ES6+ code. Obviosly, it was starting withimport path from 'path';
which seems to have produced said errors.
I think instead
eslint-import-resolver-webpack
should error when trying to read the webpack configuration, similar to as it does, whensettings.import/resolver.webpack
cannot be resolved.The text was updated successfully, but these errors were encountered: