Skip to content

Commit 41a1cd9

Browse files
committed
chore: more change
1 parent 4fce495 commit 41a1cd9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13246,7 +13246,7 @@ namespace ts {
1324613246
}
1324713247
else {
1324813248
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))) {
1325013250
if (suggestion !== undefined) {
1325113251
error(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName as string, typeToString(objectType), suggestion);
1325213252
}
@@ -16320,7 +16320,8 @@ namespace ts {
1632016320
errorNode = prop.valueDeclaration.name;
1632116321
}
1632216322
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;
1632416325
if (suggestion) reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
1632516326
else reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
1632616327
}
@@ -16336,7 +16337,7 @@ namespace ts {
1633616337

1633716338
const name = propDeclaration.name!;
1633816339
if (isIdentifier(name)) {
16339-
suggestion = getSuggestionForNonexistentProperty(name, errorTarget, /*isJsxAttr*/ false);
16340+
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
1634016341
}
1634116342
}
1634216343
if (suggestion !== undefined) {
@@ -24892,8 +24893,8 @@ namespace ts {
2489224893
return defaultSuggestion();
2489324894
}
2489424895

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);
2489724898
return suggestion && symbolName(suggestion);
2489824899
}
2489924900

0 commit comments

Comments
 (0)