mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +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:
@@ -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