Skip to content

Commit 585c390

Browse files
committed
Verify syntax after transformation
1 parent f4a6ba8 commit 585c390

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plugins/rehype-static-to-dynamic.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ function convertStaticToDynamic(code) {
307307
trailingComma: true,
308308
});
309309

310+
// Parse with Babel to verify syntax
311+
recast.parse(output.code, {
312+
parser: require('recast/parsers/babel-ts'),
313+
});
314+
310315
return output.code;
311316
}
312317

0 commit comments

Comments
 (0)