Skip to content

Commit afbd56a

Browse files
committed
chore: suppress TS errors
1 parent 99ff391 commit afbd56a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { transformJsxToString } from './core/convert'
44
import { resolveOption, type Options } from './core/options'
55

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

tests/jsx-to-string.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,16 @@ describe('jsxToString', () => {
193193
})
194194

195195
test('Object/Array Literal', () => {
196+
// @ts-ignore
196197
expect(jsxToString(<>{{}}</>)).toMatchInlineSnapshot('"{}"')
198+
// @ts-ignore
197199
expect(jsxToString(<>{[{ foo: 'bar' }]}</>)).toMatchInlineSnapshot(
198200
'"[{"foo":"bar"}]"',
199201
)
200202
})
201203

202204
test('RegExpLiteral', () => {
205+
// @ts-ignore
203206
expect(jsxToString(<>{/a(.*)/g}</>)).toMatchInlineSnapshot('"/a(.*)/g"')
204207
})
205208
})
@@ -214,6 +217,7 @@ describe('jsxToString', () => {
214217
expect(jsxToString(<>{1 - 2 + 3 / 5}</>)).toMatchInlineSnapshot('"-0.4"')
215218
expect(jsxToString(<>{2 ** 2}</>)).toMatchInlineSnapshot('"4"')
216219
expect(jsxToString(<>{false || 2}</>)).toMatchInlineSnapshot('"2"')
220+
// @ts-expect-error
217221
expect(jsxToString(<>{null ?? 'foo'}</>)).toMatchInlineSnapshot('"foo"')
218222
expect(jsxToString(<>{1 && (false || 0.2)}</>)).toMatchInlineSnapshot(
219223
'"0.2"',
@@ -236,7 +240,9 @@ describe('jsxToString', () => {
236240
})
237241

238242
test('ConditionalExpression', () => {
243+
// @ts-expect-error
239244
expect(jsxToString(<>{'1' ? 1 : 2}</>)).toMatchInlineSnapshot('"1"')
245+
// @ts-expect-error
240246
expect(jsxToString(<>{void 1 ? 1 : 2}</>)).toMatchInlineSnapshot('"2"')
241247
})
242248

0 commit comments

Comments
 (0)