Skip to content

Commit

Permalink
Merge pull request #1338 from ashsearle/fix-export-specifier-export-kind
Browse files Browse the repository at this point in the history
fix: print ExportSpecifier.exportKind
  • Loading branch information
eventualbuddha authored Jul 11, 2023
2 parents 0385cd9 + 9292af1 commit d0afcd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions test/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit d0afcd6

Please sign in to comment.