-
-
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/named requires 'typescript-eslint-parser' #1285
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hmm, the implication is that one of your plugins or shared configs is still pointing to the old typescript parser. |
So I updated my config to this: {
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/typescript"
],
"plugins": ["import"]
} And the problem is still there. |
So I saw this pr #1283 and it fixes the problem, but requires me to install |
This was already fixed in bdc05aa. (Note the change to |
@benmosher it'd be awesome if you could cut a new release! 🙏 Can't wait to use |
Until there is a new release, a workaround that works for me is: // .eslintrc.js
var jsExtensions = ['.js', '.jsx'];
var tsExtensions = ['.ts', '.tsx'];
var allExtensions = jsExtensions.concat(tsExtensions);
module.exports = {
plugins: ['import'],
settings: {
'import/extensions': allExtensions,
'import/parsers': {
'@typescript-eslint/parser': tsExtensions
},
'import/resolver': {
'node': {
'extensions': allExtensions
}
}
}
} It's necessary not to extend the configuration from @lednhatkhanh There is no need to install |
Error: Parse errors in imported module. Cannot find module 'typescript-eslint-parser' Issue: import-js/eslint-plugin-import#1285
For anyone finding this ticket, this has not been released yet. @MatiasOlivera solution still works. @ljharb Is there a big picture here that we are missing? If so, would it make sense to keep this ticket open until a new release is cut? At the moment the closed status feels a bit misleading. Thanks! cc @benmosher |
@GabrielIzaias no, issues (not tickets) are pretty universally closed when fixes are merged, not when they’re released (an unrelated action) |
Can't wait for a release with this fix to migrate more projects from tslint to eslint 🙌 🙏 @MatiasOlivera, thanks for the workaround! |
Any update on when is this going to get released? |
This worked for me, however rather than use import I had to change it to module as import is reserved. |
This is my
.eslintrc
config:I'm importing like this:
The error:
The text was updated successfully, but these errors were encountered: