Skip to content

Commit aeec5a8

Browse files
committed
Apply suggestion
1 parent d968565 commit aeec5a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/src/remark/auto-js-code.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async function makeJsCodeBlock(
129129
)
130130
const lang = node.lang?.replace('ts', 'js')
131131
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 }), {
133133
parser: 'babel',
134134
location,
135135
})
@@ -158,7 +158,7 @@ async function makeTsCodeBlock(
158158
}
159159
}
160160

161-
function convertToJs(code: string, { jsx }: { jsx: boolean }) {
161+
function convertToJs(code: string, { isJsx }: { isJsx: boolean }) {
162162
// We create a source file from ts so that way we can specify if
163163
// we want to use JSX or not, because the parsing is different.
164164
// Copied from the ts-blank-space playground
@@ -168,7 +168,7 @@ function convertToJs(code: string, { jsx }: { jsx: boolean }) {
168168
code,
169169
{ languageVersion: ts.ScriptTarget.ESNext },
170170
true,
171-
jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS
171+
isJsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS
172172
)
173173

174174
return blankSourceFile(sourceFile)

0 commit comments

Comments
 (0)