Skip to content

Commit 6513a28

Browse files
committed
fix: ignore exported variable declarations that aren't simple identifiers
While this wouldn't surface invalid exports, it more importantly doesn't have false positives anymore #2566
1 parent 6180537 commit 6513a28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/svelte2tsx/src/helpers/typescript.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export function findExports(ts: _ts, source: ts.SourceFile, isTsFile: boolean) {
7070
node,
7171
hasTypeDefinition: hasTypeDefinition || hasTypedParameter(ts, node, isTsFile)
7272
});
73-
} else {
73+
} else if (ts.isIdentifier(declaration.name)) {
74+
// TODO support `export const { x, y } = ...` ?
7475
exports.set(declaration.name.getText(), {
7576
type: 'var',
7677
node: declaration,

0 commit comments

Comments
 (0)