Skip to content

Commit 359459f

Browse files
committed
PEBKAC
1 parent 029962b commit 359459f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/languages/ts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,15 @@ export default (options = {}) => {
772772
ExportNamedDeclaration(node, context) {
773773
context.write('export ');
774774

775-
if (node.exportKind === 'type') {
776-
context.write('type ');
777-
}
778-
779775
if (node.declaration) {
780776
context.visit(node.declaration);
781777
return;
782778
}
783779

780+
if (node.exportKind === 'type') {
781+
context.write('type ');
782+
}
783+
784784
context.write('{');
785785
sequence(context, node.specifiers, node.source?.loc?.start ?? node.loc?.end ?? null, true);
786786
context.write('}');

test/samples/ts-export/expected.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// TODO i think these are currently broken in acorn-typescript?
2-
// export type X = number;
3-
// export type * from './elsewhere';
4-
type Y = number;
1+
export type X = number;
52

3+
type Y = number;
64
type Z = number;
75

86
export type { Y };
97
export { type Z };
8+
9+
// export type * from './elsewhere';

test/samples/ts-export/expected.ts.map

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"input.js"
66
],
77
"sourcesContent": [
8-
"// TODO i think these are currently broken in acorn-typescript?\n// export type X = number;\n// export type * from './elsewhere';\n\ntype Y = number;\ntype Z = number;\nexport type { Y };\nexport { type Z };\n"
8+
"export type X = number;\n\ntype Y = number;\ntype Z = number;\nexport type { Y };\nexport { type Z };\n\n// export type * from './elsewhere';\n"
99
],
10-
"mappings": ";;;KAIK,CAAC,GAAG,MAAM;;KACV,CAAC,GAAG,MAAM;;cACD,CAAC;cACD,CAAC"
10+
"mappings": "YAAY,CAAC,GAAG,MAAM;;KAEjB,CAAC,GAAG,MAAM;KACV,CAAC,GAAG,MAAM;;cACD,CAAC;cACD,CAAC;;"
1111
}

test/samples/ts-export/input.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// TODO i think these are currently broken in acorn-typescript?
2-
// export type X = number;
3-
// export type * from './elsewhere';
1+
export type X = number;
42

53
type Y = number;
64
type Z = number;
75
export type { Y };
86
export { type Z };
7+
8+
// export type * from './elsewhere';

0 commit comments

Comments
 (0)