Skip to content

Commit

Permalink
fix: ignore exported variable declarations that aren't simple identif…
Browse files Browse the repository at this point in the history
…iers

While this wouldn't surface invalid exports, it more importantly doesn't have false positives anymore
#2566
  • Loading branch information
dummdidumm committed Nov 7, 2024
1 parent 6180537 commit 6513a28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/svelte2tsx/src/helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export function findExports(ts: _ts, source: ts.SourceFile, isTsFile: boolean) {
node,
hasTypeDefinition: hasTypeDefinition || hasTypedParameter(ts, node, isTsFile)
});
} else {
} else if (ts.isIdentifier(declaration.name)) {
// TODO support `export const { x, y } = ...` ?
exports.set(declaration.name.getText(), {
type: 'var',
node: declaration,
Expand Down

0 comments on commit 6513a28

Please sign in to comment.