You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're seeing unexpected import/no-duplicates issues for some packages in TypeScript, which seem to happen when the different modules reuse the same, shared definitions under the hood.
# No lint validations; these are two different, non-duplicate imports.
Actual behavior:
1:33 error '{...}/node_modules/svelte/types/index.d.ts' imported multiple times import/no-duplicates
2:29 error '{...}/node_modules/svelte/types/index.d.ts' imported multiple times import/no-duplicates
As per the error message, I guess this is related to the fact that both imports have their types defined in a shared, private file. I'm unsure if this is an issue with the svelte packages per-se, but this being flagged by eslint-plugin-import seems like an unexpected bug? It may be noteworthy that the core no-duplicate-imports ESLint rule does not flag this the same way.
Versions:
eslint: 8.46.0
eslint-plugin-import: 2.28.0
svelte: 4.1.2
A sample repo can be found here with the bare TypeScript & ESLint config.
The text was updated successfully, but these errors were encountered:
This is indeed because the TS resolver maps them to the same file. no-duplicate-imports does no resolution, so it doesn't run into this problem (but it misses many other instances as a result).
I'm traveling atm but I believe there may be an existing issue about this.
echocrow
changed the title
[import/no-duplicates] false negative "imported multiple times" in TS
[import/no-duplicates] false-positive "imported multiple times" in TS
Aug 10, 2023
We're seeing unexpected
import/no-duplicates
issues for some packages in TypeScript, which seem to happen when the different modules reuse the same, shared definitions under the hood.For example:
Expected behavior:
Actual behavior:
As per the error message, I guess this is related to the fact that both imports have their types defined in a shared, private file. I'm unsure if this is an issue with the svelte packages per-se, but this being flagged by
eslint-plugin-import
seems like an unexpected bug? It may be noteworthy that the coreno-duplicate-imports
ESLint rule does not flag this the same way.Versions:
eslint: 8.46.0
eslint-plugin-import: 2.28.0
svelte: 4.1.2
A sample repo can be found here with the bare TypeScript & ESLint config.
The text was updated successfully, but these errors were encountered: