Skip to content

Commit dbaf921

Browse files
committed
Verify syntax after transformation
1 parent ab86cf7 commit dbaf921

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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)