@@ -13246,7 +13246,7 @@ namespace ts {
13246
13246
}
13247
13247
else {
13248
13248
let suggestion: string | undefined;
13249
- if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType, /*isJsxAttr*/ false ))) {
13249
+ if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType))) {
13250
13250
if (suggestion !== undefined) {
13251
13251
error(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName as string, typeToString(objectType), suggestion);
13252
13252
}
@@ -16320,7 +16320,8 @@ namespace ts {
16320
16320
errorNode = prop.valueDeclaration.name;
16321
16321
}
16322
16322
const propName = symbolToString(prop);
16323
- const suggestion = getSuggestionForNonexistentProperty(propName, errorTarget, /*isJsxAttr*/ true);
16323
+ const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget);
16324
+ const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined;
16324
16325
if (suggestion) reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
16325
16326
else reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
16326
16327
}
@@ -16336,7 +16337,7 @@ namespace ts {
16336
16337
16337
16338
const name = propDeclaration.name!;
16338
16339
if (isIdentifier(name)) {
16339
- suggestion = getSuggestionForNonexistentProperty(name, errorTarget, /*isJsxAttr*/ false );
16340
+ suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
16340
16341
}
16341
16342
}
16342
16343
if (suggestion !== undefined) {
@@ -24892,8 +24893,8 @@ namespace ts {
24892
24893
return defaultSuggestion();
24893
24894
}
24894
24895
24895
- function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJsxAttr: boolean ): string | undefined {
24896
- const suggestion = (isJsxAttr ? getSuggestedSymbolForNonexistentJSXAttribute : getSuggestedSymbolForNonexistentProperty) (name, containingType);
24896
+ function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type): string | undefined {
24897
+ const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType);
24897
24898
return suggestion && symbolName(suggestion);
24898
24899
}
24899
24900
0 commit comments