File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -24884,13 +24884,10 @@ namespace ts {
24884
24884
function getSuggestedSymbolForNonexistentJSXAttribute(name: Identifier | PrivateIdentifier | string, containingType: Type): Symbol | undefined {
24885
24885
const strName = isString(name) ? name : idText(name);
24886
24886
const properties = getPropertiesOfType(containingType);
24887
- const defaultSuggestion = () => getSpellingSuggestionForName(strName, properties, SymbolFlags.Value);
24888
- const getCandidate = (expectedName: string) => properties.find(x => symbolName(x) === expectedName);
24889
- switch (strName) {
24890
- case "for": return getCandidate("htmlFor") || defaultSuggestion();
24891
- case "class": return getCandidate("className") || defaultSuggestion();
24892
- }
24893
- return defaultSuggestion();
24887
+ const jsxSpecific = strName === "for" ? properties.find(x => symbolName(x) === "htmlFor")
24888
+ : strName === "class" ? properties.find(x => symbolName(x) === "className")
24889
+ : undefined;
24890
+ return jsxSpecific ?? getSpellingSuggestionForName(strName, properties, SymbolFlags.Value);
24894
24891
}
24895
24892
24896
24893
function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type): string | undefined {
You can’t perform that action at this time.
0 commit comments