From 9292af1162f72e6601bf167f2884a7fb01d97dfd Mon Sep 17 00:00:00 2001 From: Ash Searle Date: Wed, 5 Jul 2023 21:56:37 +0100 Subject: [PATCH] fix: print ExportSpecifier.exportKind --- lib/printer.ts | 3 +++ test/typescript.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lib/printer.ts b/lib/printer.ts index 008e7e93..3afb169f 100644 --- a/lib/printer.ts +++ b/lib/printer.ts @@ -483,6 +483,9 @@ function genericPrintNoParens(path: any, options: any, print: any) { return concat(parts); case "ExportSpecifier": + if (n.exportKind && n.exportKind !== "value") { + parts.push(n.exportKind + " "); + } if (n.local) { parts.push(path.call(print, "local")); if (n.exported && n.exported.name !== n.local.name) { diff --git a/test/typescript.ts b/test/typescript.ts index 8809f3b1..df22d843 100644 --- a/test/typescript.ts +++ b/test/typescript.ts @@ -350,6 +350,12 @@ const nodeMajorVersion = parseInt(process.versions.node, 10); "type Blue = Color.b;", "type Alpha = Color.a;", ]); + + check([ + "type alias = boolean;", + "const value = 0;", + "export { type alias, value };" + ]) }); it("InterfaceBody: duplicate semicolon", function () {