Skip to content

Commit 8dc4f7e

Browse files
committed
chore: resolve suggestions
1 parent ac87e82 commit 8dc4f7e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/compiler/checker.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16322,8 +16322,12 @@ namespace ts {
1632216322
const propName = symbolToString(prop);
1632316323
const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget);
1632416324
const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined;
16325-
if (suggestion) reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
16326-
else reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
16325+
if (suggestion) {
16326+
reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
16327+
}
16328+
else {
16329+
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
16330+
}
1632716331
}
1632816332
else {
1632916333
// use the property's value declaration if the property is assigned inside the literal itself
@@ -24884,8 +24888,8 @@ namespace ts {
2488424888
function getSuggestedSymbolForNonexistentJSXAttribute(name: Identifier | PrivateIdentifier | string, containingType: Type): Symbol | undefined {
2488524889
const strName = isString(name) ? name : idText(name);
2488624890
const properties = getPropertiesOfType(containingType);
24887-
const jsxSpecific = strName === "for" ? properties.find(x => symbolName(x) === "htmlFor")
24888-
: strName === "class" ? properties.find(x => symbolName(x) === "className")
24891+
const jsxSpecific = strName === "for" ? find(properties, x => symbolName(x) === "htmlFor")
24892+
: strName === "class" ? find(properties, x => symbolName(x) === "className")
2488924893
: undefined;
2489024894
return jsxSpecific ?? getSpellingSuggestionForName(strName, properties, SymbolFlags.Value);
2489124895
}
@@ -28236,7 +28240,7 @@ namespace ts {
2823628240
error(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);
2823728241
return booleanType;
2823828242
}
28239-
if (expr.kind === SyntaxKind.PropertyAccessExpression && isPrivateIdentifier(expr.name)) {
28243+
if (isPropertyAccessExpression(expr) && isPrivateIdentifier(expr.name)) {
2824028244
error(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);
2824128245
}
2824228246
const links = getNodeLinks(expr);

0 commit comments

Comments
 (0)