File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ async function makeJsCodeBlock(
129
129
)
130
130
const lang = node . lang ?. replace ( 'ts' , 'js' )
131
131
const isJsx = node . lang . endsWith ( 'x' )
132
- const code = await format ( convertToJs ( node . value , { jsx : isJsx } ) , {
132
+ const code = await format ( convertToJs ( node . value , { isJsx } ) , {
133
133
parser : 'babel' ,
134
134
location,
135
135
} )
@@ -158,7 +158,7 @@ async function makeTsCodeBlock(
158
158
}
159
159
}
160
160
161
- function convertToJs ( code : string , { jsx } : { jsx : boolean } ) {
161
+ function convertToJs ( code : string , { isJsx } : { isJsx : boolean } ) {
162
162
// We create a source file from ts so that way we can specify if
163
163
// we want to use JSX or not, because the parsing is different.
164
164
// Copied from the ts-blank-space playground
@@ -168,7 +168,7 @@ function convertToJs(code: string, { jsx }: { jsx: boolean }) {
168
168
code ,
169
169
{ languageVersion : ts . ScriptTarget . ESNext } ,
170
170
true ,
171
- jsx ? ts . ScriptKind . TSX : ts . ScriptKind . TS
171
+ isJsx ? ts . ScriptKind . TSX : ts . ScriptKind . TS
172
172
)
173
173
174
174
return blankSourceFile ( sourceFile )
You can’t perform that action at this time.
0 commit comments