File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13040,9 +13040,9 @@ namespace ts {
1304013040 // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal.
1304113041 // However, using an object-literal error message will be very confusing to the users so we give different a message.
1304213042 // TODO: Spelling suggestions for excess jsx attributes (needs new diagnostic messages)
13043- if (prop.valueDeclaration && isNamedDeclaration (prop.valueDeclaration) && prop.valueDeclaration.name && prop.valueDeclaration.name.pos !== -1 ) {
13044- // If the " children" attribute is extraneous `<NoChild>extra</NoChild>` then the declaration's name has no location.
13045- // In that case, do not update the error location, since there's no name to point to .
13043+ if (prop.valueDeclaration && isJsxAttribute (prop.valueDeclaration)) {
13044+ // Note that extraneous children (as in `<NoChild>extra</NoChild>`) don't pass this check,
13045+ // since `children` is a SyntaxKind.PropertySignature instead of a SyntaxKind.JsxAttribute .
1304613046 errorNode = prop.valueDeclaration.name;
1304713047 }
1304813048 reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(errorTarget));
You can’t perform that action at this time.
0 commit comments