diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 91346429b1774..8060fee0f0463 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22441,10 +22441,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget); const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined; if (suggestion) { - reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion); + reportParentSkippedError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion); } else { - reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget)); + reportParentSkippedError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget)); } } else { diff --git a/tests/baselines/reference/checkJsxChildrenProperty15.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty15.errors.txt index bd58dea1368da..a284f51a0fc8b 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty15.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty15.errors.txt @@ -1,9 +1,6 @@ -file.tsx(10,17): error TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes'. - Property 'children' does not exist on type 'IntrinsicAttributes'. -file.tsx(11,13): error TS2322: Type '{ children: Element; key: string; }' is not assignable to type 'IntrinsicAttributes'. - Property 'children' does not exist on type 'IntrinsicAttributes'. -file.tsx(12,13): error TS2322: Type '{ children: Element[]; key: string; }' is not assignable to type 'IntrinsicAttributes'. - Property 'children' does not exist on type 'IntrinsicAttributes'. +file.tsx(10,17): error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. +file.tsx(11,13): error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. +file.tsx(12,13): error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. ==== file.tsx (3 errors) ==== @@ -18,14 +15,11 @@ file.tsx(12,13): error TS2322: Type '{ children: Element[]; key: string; }' is n // Not OK (excess children) const k3 = } />; ~~~~~~~~ -!!! error TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'. +!!! error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. const k4 =
; ~~~ -!!! error TS2322: Type '{ children: Element; key: string; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'. +!!! error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. const k5 =
; ~~~ -!!! error TS2322: Type '{ children: Element[]; key: string; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'. +!!! error TS2339: Property 'children' does not exist on type 'IntrinsicAttributes'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 4adb70251deaf..5ac20582aa54b 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,35 +1,25 @@ file.tsx(27,64): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. file.tsx(28,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. file.tsx(29,43): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. file.tsx(30,13): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. - Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -file.tsx(33,65): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -file.tsx(36,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +file.tsx(33,65): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +file.tsx(36,44): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. ==== file.tsx (6 errors) ==== @@ -63,48 +53,38 @@ file.tsx(36,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assi ~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. !!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. !!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2769: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. !!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2769: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2769: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. !!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any ~~~~~ -!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined } const d1 = ; // goTo has type "home" | "contact" ~~~~~ -!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. \ No newline at end of file diff --git a/tests/baselines/reference/excessiveStackDepthFlatArray.errors.txt b/tests/baselines/reference/excessiveStackDepthFlatArray.errors.txt index 7985a8d88e625..33772e9babaad 100644 --- a/tests/baselines/reference/excessiveStackDepthFlatArray.errors.txt +++ b/tests/baselines/reference/excessiveStackDepthFlatArray.errors.txt @@ -1,5 +1,4 @@ -index.tsx(35,13): error TS2322: Type '{ key: string; }' is not assignable to type 'HTMLAttributes'. - Property 'key' does not exist on type 'HTMLAttributes'. +index.tsx(35,13): error TS2339: Property 'key' does not exist on type 'HTMLAttributes'. ==== index.tsx (1 errors) ==== @@ -39,8 +38,7 @@ index.tsx(35,13): error TS2322: Type '{ key: string; }' is not assignable to typ {categories.map((category) => (
  • {category}
  • // Error about 'key' only ~~~ -!!! error TS2322: Type '{ key: string; }' is not assignable to type 'HTMLAttributes'. -!!! error TS2322: Property 'key' does not exist on type 'HTMLAttributes'. +!!! error TS2339: Property 'key' does not exist on type 'HTMLAttributes'. ))} ); diff --git a/tests/baselines/reference/jsxElementType.errors.txt b/tests/baselines/reference/jsxElementType.errors.txt index 8922915105d64..c4d572b66b238 100644 --- a/tests/baselines/reference/jsxElementType.errors.txt +++ b/tests/baselines/reference/jsxElementType.errors.txt @@ -1,18 +1,13 @@ jsxElementType.tsx(34,2): error TS2741: Property 'title' is missing in type '{}' but required in type '{ title: string; }'. -jsxElementType.tsx(36,16): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +jsxElementType.tsx(36,16): error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(40,2): error TS2741: Property 'title' is missing in type '{}' but required in type '{ title: string; }'. -jsxElementType.tsx(42,15): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +jsxElementType.tsx(42,15): error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(46,2): error TS2741: Property 'title' is missing in type '{}' but required in type '{ title: string; }'. -jsxElementType.tsx(48,15): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +jsxElementType.tsx(48,15): error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(52,2): error TS2741: Property 'title' is missing in type '{}' but required in type '{ title: string; }'. -jsxElementType.tsx(54,14): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +jsxElementType.tsx(54,14): error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(59,2): error TS2741: Property 'title' is missing in type '{}' but required in type '{ title: string; }'. -jsxElementType.tsx(61,16): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +jsxElementType.tsx(61,16): error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(70,2): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. @@ -20,11 +15,9 @@ jsxElementType.tsx(70,2): error TS2769: No overload matches this call. Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. jsxElementType.tsx(72,20): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. - Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. - Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. - Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. jsxElementType.tsx(78,1): error TS2339: Property 'boop' does not exist on type 'JSX.IntrinsicElements'. jsxElementType.tsx(79,1): error TS2339: Property 'my-undeclared-custom-element' does not exist on type 'JSX.IntrinsicElements'. jsxElementType.tsx(91,2): error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. @@ -34,10 +27,8 @@ jsxElementType.tsx(91,2): error TS2786: 'ReactNativeFlatList' cannot be used as jsxElementType.tsx(95,11): error TS2322: Type '{}' is not assignable to type 'LibraryManagedAttributes'. jsxElementType.tsx(98,2): error TS2304: Cannot find name 'Unresolved'. jsxElementType.tsx(99,2): error TS2304: Cannot find name 'Unresolved'. -jsxElementType.tsx(110,6): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; }'. - Property 'b' does not exist on type '{ a: string; }'. -jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is not assignable to type '{ a: string; }'. - Property 'b' does not exist on type '{ a: string; }'. +jsxElementType.tsx(110,6): error TS2339: Property 'b' does not exist on type '{ a: string; }'. +jsxElementType.tsx(111,19): error TS2339: Property 'b' does not exist on type '{ a: string; }'. ==== jsxElementType.tsx (20 errors) ==== @@ -81,8 +72,7 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~~~~~~~~~~ -!!! error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. -!!! error TS2322: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +!!! error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. const RenderString = ({ title }: { title: string }) => title; Component = RenderString; @@ -93,8 +83,7 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~~~~~~~~~~ -!!! error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. -!!! error TS2322: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +!!! error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. const RenderNumber = ({ title }: { title: string }) => title.length; Component = RenderNumber; @@ -105,8 +94,7 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~~~~~~~~~~ -!!! error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. -!!! error TS2322: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +!!! error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. const RenderArray = ({ title }: { title: string }) => [title]; Component = RenderArray; @@ -117,8 +105,7 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~~~~~~~~~~ -!!! error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. -!!! error TS2322: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +!!! error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. // React Server Component const RenderPromise = async ({ title }: { title: string }) => "react"; @@ -130,8 +117,7 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~~~~~~~~~~ -!!! error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. -!!! error TS2322: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. +!!! error TS2339: Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. // Class components still work class RenderStringClass extends React.Component<{ title: string }> { @@ -154,11 +140,9 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. -!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. +!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. !!! error TS2769: Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. -!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. +!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. // Host element types still work
    ; @@ -213,10 +197,8 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ; ~ -!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; }'. -!!! error TS2322: Property 'b' does not exist on type '{ a: string; }'. +!!! error TS2339: Property 'b' does not exist on type '{ a: string; }'. ; ~ -!!! error TS2322: Type '{ a: string; b: string; }' is not assignable to type '{ a: string; }'. -!!! error TS2322: Property 'b' does not exist on type '{ a: string; }'. +!!! error TS2339: Property 'b' does not exist on type '{ a: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt index 5260784dbd25b..9b3f0802c8329 100644 --- a/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixIntrinsics.errors.txt @@ -1,8 +1,6 @@ jsxNamespacePrefixIntrinsics.tsx(15,18): error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'. -jsxNamespacePrefixIntrinsics.tsx(16,30): error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'. - Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? -jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'. - Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. +jsxNamespacePrefixIntrinsics.tsx(16,30): error TS2551: Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? +jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2339: Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. ==== jsxNamespacePrefixIntrinsics.tsx (3 errors) ==== @@ -25,10 +23,8 @@ jsxNamespacePrefixIntrinsics.tsx(17,30): error TS2322: Type '{ "ns:invalid": str !!! error TS2339: Property 'element' does not exist on type 'JSX.IntrinsicElements'. const invalid2 = ; ~~~~~~~~~ -!!! error TS2322: Type '{ attribute: string; }' is not assignable to type '{ "ns:attribute": string; }'. -!!! error TS2322: Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? +!!! error TS2551: Property 'attribute' does not exist on type '{ "ns:attribute": string; }'. Did you mean '"ns:attribute"'? const invalid3 = ; ~~~~~~~~~~ -!!! error TS2322: Type '{ "ns:invalid": string; }' is not assignable to type '{ "ns:attribute": string; }'. -!!! error TS2322: Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. +!!! error TS2339: Property 'ns:invalid' does not exist on type '{ "ns:attribute": string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt b/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt index 1972238cb1300..c0d69b83a1a3e 100644 --- a/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt +++ b/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt @@ -1,29 +1,19 @@ -spellingSuggestionJSXAttribute.tsx(8,4): error TS2322: Type '{ class: string; }' is not assignable to type 'DetailedHTMLProps, HTMLAnchorElement>'. - Property 'class' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. Did you mean 'className'? -spellingSuggestionJSXAttribute.tsx(9,4): error TS2322: Type '{ for: string; }' is not assignable to type 'DetailedHTMLProps, HTMLAnchorElement>'. - Property 'for' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. -spellingSuggestionJSXAttribute.tsx(10,8): error TS2322: Type '{ for: string; }' is not assignable to type 'DetailedHTMLProps, HTMLLabelElement>'. - Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? -spellingSuggestionJSXAttribute.tsx(11,8): error TS2322: Type '{ for: string; class: string; }' is not assignable to type 'DetailedHTMLProps, HTMLLabelElement>'. - Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? +spellingSuggestionJSXAttribute.tsx(8,4): error TS2551: Property 'class' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. Did you mean 'className'? +spellingSuggestionJSXAttribute.tsx(9,4): error TS2339: Property 'for' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. +spellingSuggestionJSXAttribute.tsx(10,8): error TS2551: Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? +spellingSuggestionJSXAttribute.tsx(11,8): error TS2551: Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? spellingSuggestionJSXAttribute.tsx(12,9): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. - Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. - Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? + Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. - Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. - Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? -spellingSuggestionJSXAttribute.tsx(13,10): error TS2322: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. - Property 'class' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'className'? + Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? +spellingSuggestionJSXAttribute.tsx(13,10): error TS2551: Property 'class' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'className'? spellingSuggestionJSXAttribute.tsx(14,9): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. - Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. - Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? + Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. - Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. - Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? -spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. - Property 'for' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'htmlFor'? + Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? +spellingSuggestionJSXAttribute.tsx(15,10): error TS2551: Property 'for' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'htmlFor'? ==== spellingSuggestionJSXAttribute.tsx (8 errors) ==== @@ -36,44 +26,34 @@ spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' class MyComp extends React.Component<{ className?: string, htmlFor?: string }> { } ; ~~~~~ -!!! error TS2322: Type '{ class: string; }' is not assignable to type 'DetailedHTMLProps, HTMLAnchorElement>'. -!!! error TS2322: Property 'class' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. Did you mean 'className'? +!!! error TS2551: Property 'class' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. Did you mean 'className'? ; // should have no fix ~~~ -!!! error TS2322: Type '{ for: string; }' is not assignable to type 'DetailedHTMLProps, HTMLAnchorElement>'. -!!! error TS2322: Property 'for' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'. +!!! error TS2339: Property 'for' does not exist on type 'DetailedHTMLProps, HTMLAnchorElement>'.