]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(types): test for tsx style validation
authorEvan You <yyx990803@gmail.com>
Mon, 1 Mar 2021 17:31:40 +0000 (12:31 -0500)
committerEvan You <yyx990803@gmail.com>
Mon, 1 Mar 2021 17:31:40 +0000 (12:31 -0500)
test-dts/tsx.test-d.tsx

index 43a2464b85952fbc29188b9ce6987aaf00fc939b..d1bacc9d73509335bb2d3b05741038e1ed60c7b6 100644 (file)
@@ -12,6 +12,15 @@ expectType<JSX.Element>(<div />)
 expectType<JSX.Element>(<div id="foo" />)
 expectType<JSX.Element>(<input value="foo" />)
 
+// @ts-expect-error style css property validation
+expectError(<div style={{ unknown: 123 }} />)
+
+// allow array styles and nested array styles
+expectType<JSX.Element>(<div style={[{ color: 'red' }]} />)
+expectType<JSX.Element>(
+  <div style={[{ color: 'red' }, [{ fontSize: '1em' }]]} />
+)
+
 // @ts-expect-error unknown prop
 expectError(<div foo="bar" />)