Skip to content

Commit 3f9906a

Browse files
committed
test(types): test for tsx style validation
1 parent 75fdcd8 commit 3f9906a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test-dts/tsx.test-d.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ expectType<JSX.Element>(<div />)
1212
expectType<JSX.Element>(<div id="foo" />)
1313
expectType<JSX.Element>(<input value="foo" />)
1414

15+
// @ts-expect-error style css property validation
16+
expectError(<div style={{ unknown: 123 }} />)
17+
18+
// allow array styles and nested array styles
19+
expectType<JSX.Element>(<div style={[{ color: 'red' }]} />)
20+
expectType<JSX.Element>(
21+
<div style={[{ color: 'red' }, [{ fontSize: '1em' }]]} />
22+
)
23+
1524
// @ts-expect-error unknown prop
1625
expectError(<div foo="bar" />)
1726

0 commit comments

Comments
 (0)