File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ export const JavascriptAst: FC = () => {
1818 tree = espree . parse ( explorer . code . javascript , {
1919 ecmaVersion : explorer . jsOptions . esVersion ,
2020 sourceType : explorer . jsOptions . sourceType ,
21+ ecmaFeatures : {
22+ jsx : explorer . jsOptions . isJSX ,
23+ } ,
2124 } ) ;
2225
2326 ast = JSON . stringify ( tree , null , 2 ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export const CodePath: FC = () => {
3131 javascript ,
3232 esVersion ,
3333 sourceType ,
34+ jsOptions . isJSX ,
3435 ) ;
3536 if ( "error" in response ) {
3637 throw new Error ( response . error ) ;
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export const generateCodePath = async (
5959 code : string ,
6060 esVersion : Version ,
6161 sourceType : SourceType ,
62+ isJSX : boolean ,
6263) : Promise <
6364 | {
6465 error : string ;
@@ -127,6 +128,11 @@ export const generateCodePath = async (
127128 languageOptions : {
128129 ecmaVersion : esVersion ,
129130 sourceType,
131+ parserOptions : {
132+ ecmaFeatures : {
133+ jsx : isJSX ,
134+ } ,
135+ } ,
130136 } ,
131137 } ;
132138
You can’t perform that action at this time.
0 commit comments