diff --git a/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt b/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt new file mode 100644 index 00000000000..cde21fb6a38 --- /dev/null +++ b/tests/baselines/reference/spellingSuggestionJSXAttribute.errors.txt @@ -0,0 +1,79 @@ +tests/cases/compiler/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'? +tests/cases/compiler/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>'. +tests/cases/compiler/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'? +tests/cases/compiler/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'? +tests/cases/compiler/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'? + 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'? +tests/cases/compiler/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'? +tests/cases/compiler/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'? + 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'? +tests/cases/compiler/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'? + + +==== tests/cases/compiler/spellingSuggestionJSXAttribute.tsx (8 errors) ==== + /// + import * as React from "react"; + + function MyComp2(props: { className?: string, htmlFor?: string }) { + return null!; + } + 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'? + ; // 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>'. + ; +; // should have no fix +; +>a : Symbol(JSX.IntrinsicElements.a, Decl(react16.d.ts, 2390, 41)) +>class : Symbol(class, Decl(spellingSuggestionJSXAttribute.tsx, 7, 2)) + +; // should have no fix +>a : Symbol(JSX.IntrinsicElements.a, Decl(react16.d.ts, 2390, 41)) +>for : Symbol(for, Decl(spellingSuggestionJSXAttribute.tsx, 8, 2)) + +; +> : JSX.Element +>a : any +>class : string + +; // should have no fix +> : JSX.Element +>a : any +>for : string + +; +; // should have no fix +