You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow JSXAttributes types to be shortcut-spread into the spread type like normal objects (microsoft#19047)
* Bring jsx type resolution inline with normal objects, move jsx attribute property ignorign into relationship check
* Improved errors and reordered members
* Always use inferrential mode for jsx pass
* Add some missing skipLibChecks
* New check mode instead of odd type mapper
* Do not enable object literal freshness checks on jsx spreads
* Fix minor style nits
* Update order of type for test
* Accept corrected baseline
Copy file name to clipboardExpand all lines: tests/baselines/reference/checkJsxChildrenProperty14.errors.txt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
tests/cases/conformance/jsx/file.tsx(42,27): error TS2322: Type '{ a: number; b: string; children: Element[]; }' is not assignable to type 'IntrinsicAttributes & SingleChildProp'.
2
-
Type '{ a: number; b: string; children: Element[]; }' is not assignable to type 'SingleChildProp'.
1
+
tests/cases/conformance/jsx/file.tsx(42,27): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & SingleChildProp'.
2
+
Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'.
3
3
Types of property 'children' are incompatible.
4
4
Type 'Element[]' is not assignable to type 'Element'.
Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
3
3
Property 'children' is missing in type '{ a: number; b: string; }'.
4
4
tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
5
-
tests/cases/conformance/jsx/file.tsx(31,11): error TS2322: Type '{ a: number; b: string; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
6
-
Type '{ a: number; b: string; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'Prop'.
5
+
tests/cases/conformance/jsx/file.tsx(31,11): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
6
+
Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
7
7
Types of property 'children' are incompatible.
8
8
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
9
9
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
10
10
Property 'type' is missing in type '(Element | ((name: string) => Element))[]'.
11
-
tests/cases/conformance/jsx/file.tsx(37,11): error TS2322: Type '{ a: number; b: string; children: (Element | 1000000)[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
12
-
Type '{ a: number; b: string; children: (Element | 1000000)[]; }' is not assignable to type 'Prop'.
11
+
tests/cases/conformance/jsx/file.tsx(37,11): error TS2322: Type '{ children: (Element | 1000000)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
12
+
Type '{ children: (Element | 1000000)[]; a: number; b: string; }' is not assignable to type 'Prop'.
13
13
Types of property 'children' are incompatible.
14
14
Type '(Element | 1000000)[]' is not assignable to type 'string | Element'.
15
15
Type '(Element | 1000000)[]' is not assignable to type 'Element'.
16
16
Property 'type' is missing in type '(Element | 1000000)[]'.
17
-
tests/cases/conformance/jsx/file.tsx(43,11): error TS2322: Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
18
-
Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'Prop'.
17
+
tests/cases/conformance/jsx/file.tsx(43,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
18
+
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
19
19
Types of property 'children' are incompatible.
20
20
Type '(string | Element)[]' is not assignable to type 'string | Element'.
21
21
Type '(string | Element)[]' is not assignable to type 'Element'.
22
22
Property 'type' is missing in type '(string | Element)[]'.
23
-
tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ a: number; b: string; children: Element[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
24
-
Type '{ a: number; b: string; children: Element[]; }' is not assignable to type 'Prop'.
23
+
tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
24
+
Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'.
25
25
Types of property 'children' are incompatible.
26
26
Type 'Element[]' is not assignable to type 'string | Element'.
27
27
Type 'Element[]' is not assignable to type 'Element'.
!!! error TS2322: Type '{ a: number; b: string; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
71
-
!!! error TS2322: Type '{ a: number; b: string; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'Prop'.
70
+
!!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
71
+
!!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
72
72
!!! error TS2322: Types of property 'children' are incompatible.
73
73
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
74
74
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/checkJsxChildrenProperty5.errors.txt
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
tests/cases/conformance/jsx/file.tsx(20,15): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
2
2
Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
3
3
Property 'children' is missing in type '{ a: number; b: string; }'.
4
-
tests/cases/conformance/jsx/file.tsx(24,11): error TS2322: Type '{ a: number; b: string; children: Element; }' is not assignable to type 'IntrinsicAttributes & Prop'.
5
-
Type '{ a: number; b: string; children: Element; }' is not assignable to type 'Prop'.
4
+
tests/cases/conformance/jsx/file.tsx(24,11): error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
5
+
Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'.
6
6
Types of property 'children' are incompatible.
7
7
Type 'Element' is not assignable to type 'Button'.
8
8
Property 'render' is missing in type 'Element'.
9
-
tests/cases/conformance/jsx/file.tsx(28,11): error TS2322: Type '{ a: number; b: string; children: typeof Button; }' is not assignable to type 'IntrinsicAttributes & Prop'.
10
-
Type '{ a: number; b: string; children: typeof Button; }' is not assignable to type 'Prop'.
9
+
tests/cases/conformance/jsx/file.tsx(28,11): error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
10
+
Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'.
11
11
Types of property 'children' are incompatible.
12
12
Type 'typeof Button' is not assignable to type 'Button'.
13
13
Property 'render' is missing in type 'typeof Button'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/checkJsxChildrenProperty7.errors.txt
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
-
tests/cases/conformance/jsx/file.tsx(24,16): error TS2322: Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
2
-
Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'Prop'.
1
+
tests/cases/conformance/jsx/file.tsx(24,16): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
2
+
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
3
3
Types of property 'children' are incompatible.
4
4
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
5
5
Type '(string | Element)[]' is not assignable to type 'Element[]'.
6
6
Type 'string | Element' is not assignable to type 'Element'.
7
7
Type 'string' is not assignable to type 'Element'.
8
-
tests/cases/conformance/jsx/file.tsx(25,16): error TS2322: Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
9
-
Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'Prop'.
8
+
tests/cases/conformance/jsx/file.tsx(25,16): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
9
+
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
10
10
Types of property 'children' are incompatible.
11
11
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
12
12
Type '(string | Element)[]' is not assignable to type 'Element[]'.
13
-
tests/cases/conformance/jsx/file.tsx(27,16): error TS2322: Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
14
-
Type '{ a: number; b: string; children: (string | Element)[]; }' is not assignable to type 'Prop'.
13
+
tests/cases/conformance/jsx/file.tsx(27,16): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
14
+
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
15
15
Types of property 'children' are incompatible.
16
16
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
17
17
Type '(string | Element)[]' is not assignable to type 'Element[]'.
0 commit comments