Pick #56449 into release-5.3 (#56451)

This commit is contained in:
Andrew Branch 2023-11-17 16:18:10 -08:00 committed by GitHub
parent e2a5d45b51
commit d09b1bfb5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 1 deletions

View File

@ -47515,7 +47515,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
if (target === unknownSymbol) {
return true;
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
}
// const enums and modules that contain only const enums are not considered values from the emit perspective
// unless 'preserveConstEnums' option is set to true

View File

@ -662,4 +662,15 @@ export * as alias from './file';`,
testVerbatimModuleSyntax: true,
},
);
transpilesCorrectly(
"Elides re-export of type-only import",
`
import type { Foo } from "./types";
export { Foo };
`,
{
options: { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ESNext } },
},
);
});

View File

@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map

View File

@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map