We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 498e06d commit 76b0759Copy full SHA for 76b0759
package.json
@@ -13,6 +13,7 @@
13
},
14
"dependencies": {
15
"acorn": "^6.1.1",
16
+ "acorn-jsx": "^5.0.1",
17
"buble": "^0.19.7",
18
"lodash.debounce": "^4.0.8",
19
"prismjs": "^1.16.0",
src/utils/getAst.js
@@ -1,7 +1,8 @@
1
-import { parse } from "acorn";
+var acorn = require("acorn");
2
+var jsx = require("acorn-jsx");
3
4
export default function getAst(code) {
- return parse(code, {
5
+ return acorn.Parser.extend(jsx()).parse(code, {
6
ecmaVersion: 2019,
7
sourceType: "module"
8
});
0 commit comments