Skip to content

Commit d0afcd6

Browse files
Merge pull request #1338 from ashsearle/fix-export-specifier-export-kind
fix: print ExportSpecifier.exportKind
2 parents 0385cd9 + 9292af1 commit d0afcd6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/printer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ function genericPrintNoParens(path: any, options: any, print: any) {
483483
return concat(parts);
484484

485485
case "ExportSpecifier":
486+
if (n.exportKind && n.exportKind !== "value") {
487+
parts.push(n.exportKind + " ");
488+
}
486489
if (n.local) {
487490
parts.push(path.call(print, "local"));
488491
if (n.exported && n.exported.name !== n.local.name) {

test/typescript.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ const nodeMajorVersion = parseInt(process.versions.node, 10);
350350
"type Blue = Color.b;",
351351
"type Alpha = Color.a;",
352352
]);
353+
354+
check([
355+
"type alias = boolean;",
356+
"const value = 0;",
357+
"export { type alias, value };"
358+
])
353359
});
354360

355361
it("InterfaceBody: duplicate semicolon", function () {

0 commit comments

Comments
 (0)