Skip to content

Commit f543856

Browse files
authored
fix: skip AST analysis of TypeScript AST nodes (#11513)
* fix: skip AST analysis of TypeScript AST nodes * fix: skip AST analysis of TypeScript AST nodes * lint
1 parent 28f3755 commit f543856

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/gorgeous-monkeys-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: skip AST analysis of TypeScript AST nodes

packages/svelte/src/compiler/phases/scope.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
280280
next({ scope });
281281
};
282282

283+
const skip = () => {};
284+
283285
/**
284286
* @type {import('zimmerframe').Visitor<import('#compiler').ElementLike, State, import('#compiler').SvelteNode>}
285287
*/
@@ -674,7 +676,14 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
674676

675677
TransitionDirective: SvelteDirective,
676678
AnimateDirective: SvelteDirective,
677-
UseDirective: SvelteDirective
679+
UseDirective: SvelteDirective,
680+
681+
// @ts-ignore
682+
TSTypeAnnotation: skip,
683+
TSInterfaceDeclaration: skip,
684+
TSTypeAliasDeclaration: skip,
685+
TSTypeParameterDeclaration: skip,
686+
TSEnumDeclaration: skip
678687

679688
// TODO others
680689
});

0 commit comments

Comments
 (0)