fix: prune typescript class field declarations

pull/16154/head
ComputerGuy 3 months ago
parent 6a7df1cce8
commit b874e049de

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: prune typescript class field declarations

@ -115,6 +115,19 @@ const visitors = {
TSDeclareFunction() {
return b.empty;
},
ClassBody(node, context) {
const body = [];
for (const _child of node.body) {
const child = context.visit(_child);
if (child.type !== 'PropertyDefinition' || !child.declare) {
body.push(child);
}
}
return {
...node,
body
};
},
ClassDeclaration(node, context) {
if (node.declare) {
return b.empty;

Loading…
Cancel
Save