-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[import/named] Named type exports are not found #154
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
Comments
You should apply parser option https://github.com/benmosher/eslint-plugin-import#importparsers if this is not going to work, please report issue at |
Thank you for the quick response! I'm using the following configuration along with eslint-import-resolver-typescript@1.1.1 and it doesn't work: "settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {}
}
}, |
Actually, things seem to work fine when I remove the following: "import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
}, Could the removal affect the quality of code analysis when using eslint-import-resolver-typescript? |
You shouldn't need this config.
|
@bradzacher Sounds great, thank you! |
@kripod, @bradzacher removing
will break imports that are defined in |
I believe the intended config is: {
"settings": {
"import/resolver": {
"typescript": {}
}
}
} You can remove the separate config item |
@amwill04 did you find a workaround for this which also allows for a non-empty:
E.g:
@bradzacher @kripod I would like this issue re-opened, because: I propose that a 'real fix' would resolve the [import/named] Named type exports are not found issue regardless of what's in As further proof this is a bug, observe that there is no
But importing this would cause an
|
A few things: 1I won't be reopening this, because it clearly isn't a bug with this project. 2.How come you're even using 3.Reading the documentation for the import resolver: https://github.com/alexgorbatchev/eslint-import-resolver-typescript, it looks like you've misconfigured the resolver.
|
Thanks for the fast reply @bradzacher. Good catch with 3, fixed that. For 2 do you mean: For 1 I'm happy to open an issue on https://github.com/benmosher/eslint-plugin-import, but can I just clarify what the issue is: |
This is an inherent problem with eslint as it stands right now. In order to configure the import resolver, you have to use the So unfortunately the whole system relies upon the users reading the documentation. if you were to raise an issue, it would be with import-resolver-typescript - as it should probably have better validation of the configuration it's expecting.
We do not enable the rule from our plugin configs. (and we cannot, because doing so would require we have a dependency on the plugin). Taking a guess, I think you're using the recommended config from eslint-plugin-import? |
Thanks for taking the time to write such a comprehensive reply @bradzacher 😄 |
use eslint-import-resolver-ts. https://github.com/rx-ts/eslint-import-resolver-ts#configuration |
@dukedave @bradzacher following on that discussion, shouldn't disabling those useless rules go into https://github.com/benmosher/eslint-plugin-import/blob/master/config/typescript.js ? |
yup. This is why the import resolver exists - so people can use these tools if they want. |
Repro
utils.ts:
FlexLayout.ts:
Expected Result
No warnings should be emitted by ESLint.
Actual Result
[eslint] ResponsiveObject not found in './utils' [import/named]
on line 2 ofFlexLayout.ts
Versions
@typescript-eslint/eslint-plugin
1.1.0
@typescript-eslint/parser
1.1.0
TypeScript
3.2.4
ESLint
5.12.1
node
10.15.0
npm
6.4.1
The text was updated successfully, but these errors were encountered: