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 {
13040
13040
// JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal.
13041
13041
// However, using an object-literal error message will be very confusing to the users so we give different a message.
13042
13042
// 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 .
13046
13046
errorNode = prop.valueDeclaration.name;
13047
13047
}
13048
13048
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