Skip to content

Commit

Permalink
fix: ignore typescript abstract methods during code transformation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
caiquetorres authored Feb 12, 2025
1 parent 23ecc36 commit 21dadfc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-fireants-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ignore typescript abstract methods
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ const visitors = {
delete node.implements;
return context.next();
},
MethodDefinition(node, context) {
if (node.abstract) {
return b.empty;
}
return context.next();
},
VariableDeclaration(node, context) {
if (node.declare) {
return b.empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
class MyClass implements Hello {}
abstract class MyAbstractClass {
abstract x(): void;
y() {}
}
declare const declared_const: number;
declare function declared_fn(): void;
declare class declared_class {
Expand Down

0 comments on commit 21dadfc

Please sign in to comment.