import-js/eslint-plugin-import
Vedi su GitHub[import/no-unused-modules] Typescript `namespace` usage results in false positive
Open
#2336 aperta il 24 dic 2021
help wantedtypescript
Metriche repository
- Star
- (4946 star)
- Metriche merge PR
- (Merge medio 138g 22h) (3 PR mergiate in 30 g)
Descrizione
// Foo.ts
export namespace MyNamespace {
export interface Internal {
a: string;
}
}
// Bar.ts
import { MyNamespace } from 'Foo';
export const internal: MyNamespace.Internal = { a: 'a' };
/src/Foo.ts
2:3 error exported declaration 'Internal' not used within other modules import/no-unused-modules
Both the export of MyNamepsace and Internal seem to be required for the usage to compile in Bar.ts. I think this kind of usage should not result in any errors. The namespace in Foo.ts can be replaced with the module keyword and the same false positive is raised.
This seems to be in a similar area to https://github.com/import-js/eslint-plugin-import/issues/1964 but with a different rule.