mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Elide import equals in transpileModule if referenced only by export type (#49664)
* Elide import equals in transpileModule if referenced only by export type. * Revise approach to avoid marking alias in export type as referenced. * Handle type only export specifier.
This commit is contained in:
1 parent
3dbe62e3f0
commit
501e442ffc
6 files changed
+49
-4
No files matched your search
@@ -485,5 +485,19 @@ export { a as alias };
|
||||
export * as alias from './file';`, {
|
||||
noSetFileName: true
|
||||
});
|
||||
|
||||
transpilesCorrectly("Elides import equals referenced only by export type",
|
||||
`import IFoo = Namespace.IFoo;` +
|
||||
`export type { IFoo };`, {
|
||||
options: { compilerOptions: { module: ModuleKind.CommonJS } }
|
||||
}
|
||||
);
|
||||
|
||||
transpilesCorrectly("Elides import equals referenced only by type only export specifier",
|
||||
`import IFoo = Namespace.IFoo;` +
|
||||
`export { type IFoo };`, {
|
||||
options: { compilerOptions: { module: ModuleKind.CommonJS } }
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user