Skip to content

Commit 31682f4

Browse files
committed
refactor: simplify
1 parent 15da715 commit 31682f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/convert.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ export function transformJsxToString(
442442
{
443443
debug,
444444
plugins,
445-
id = '',
445+
id,
446446
}: Pick<OptionsResolved, 'debug' | 'plugins'> & { id?: string },
447447
): { code: string; map: any } {
448448
const s = new MagicString(code)
449449

450-
if (id.endsWith('.tsx')) plugins.push('typescript')
450+
if (id?.endsWith('.tsx')) plugins.push('typescript')
451451
const nodes = extractJsx(code, plugins)
452452

453453
for (const [node, expr] of nodes) {

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { transformJsxToString } from './core/convert'
44
import { resolveOptions, type Options } from './core/options'
55

66
declare global {
7-
// @ts-expect-error missing JSX
7+
// @ts-ignore
88
const jsxToString: (element: JSX.Element) => string
99
const jsxRaw: (variable: any) => any
1010
}

0 commit comments

Comments
 (0)