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
4 changed files with 16 additions and 1 deletions
+1 -1
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
@@ -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 } },
},
);
});
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map