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
This is happening, because import/no-duplicates collects all import statements and assumes they are in the program body.
I would expect the import/no-duplicates rule to be applied to each body separately. Currently these are the Program body and the TSModuleBlock body, but who knows what the future holds.
Alternatively the rule could be applied to imports which are direct children Program body only.
This is the same as #2217, but for a different rule. This means I can probably fix this if it gets accepted. :)
The text was updated successfully, but these errors were encountered:
… module declarations
Without this the `import/no-duplicates` rule reports imports of the same
module inside different module declarations in the same file. It even
autofixed them, which break the code.
Closesimport-js#2273
… module declarations
Without this the `import/no-duplicates` rule reports imports of the same
module inside different module declarations in the same file. It even
autofixed them, which break the code.
Closesimport-js#2273
The
import/no-duplicates
rule gives false positives for imports inside TypeScript module declarations.Practical example:
This is happening, because
import/no-duplicates
collects all import statements and assumes they are in the program body.I would expect the
import/no-duplicates
rule to be applied to each body separately. Currently these are theProgram
body and theTSModuleBlock
body, but who knows what the future holds.Alternatively the rule could be applied to imports which are direct children
Program
body only.This is the same as #2217, but for a different rule. This means I can probably fix this if it gets accepted. :)
The text was updated successfully, but these errors were encountered: