@@ -25066,9 +25066,13 @@ namespace ts {
2506625066 }
2506725067
2506825068 const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
25069- const sourceSymbol = localOrExportSymbol.flags & SymbolFlags.Alias ? resolveAlias(localOrExportSymbol) : localOrExportSymbol;
25070- if (sourceSymbol.declarations && getDeclarationNodeFlagsFromSymbol(sourceSymbol) & NodeFlags.Deprecated && isUncalledFunctionReference(node, sourceSymbol)) {
25071- addDeprecatedSuggestion(node, sourceSymbol.declarations, node.escapedText as string);
25069+ if (localOrExportSymbol.flags & SymbolFlags.Alias) {
25070+ checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
25071+ }
25072+ else {
25073+ if (localOrExportSymbol.declarations && getDeclarationNodeFlagsFromSymbol(localOrExportSymbol) & NodeFlags.Deprecated && isUncalledFunctionReference(node, localOrExportSymbol)) {
25074+ addDeprecatedSuggestion(node, localOrExportSymbol.declarations, node.escapedText as string);
25075+ }
2507225076 }
2507325077
2507425078 let declaration = localOrExportSymbol.valueDeclaration;
@@ -39802,8 +39806,35 @@ namespace ts {
3980239806 }
3980339807 }
3980439808
39805- if (isImportSpecifier(node) && target.declarations?.every(d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) {
39806- addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName as string);
39809+ if (isImportSpecifier(node)) {
39810+ checkDeprecatedAliasedSymbol(symbol, node);
39811+ }
39812+ }
39813+ }
39814+
39815+ function checkDeprecatedAliasedSymbol(symbol: Symbol, location: Node) {
39816+ if (!(symbol.flags & SymbolFlags.Alias)) return;
39817+
39818+ const targetSymbol = resolveAlias(symbol);
39819+ if (targetSymbol === unknownSymbol) return;
39820+
39821+ while (symbol.flags & SymbolFlags.Alias) {
39822+ const target = symbol === targetSymbol ? symbol : getImmediateAliasedSymbol(symbol);
39823+ if (target && target.declarations && length(target.declarations)) {
39824+ const deprecated = target.declarations.every(d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated));
39825+ if (deprecated && isUncalledFunctionReference(location, target)) {
39826+ addDeprecatedSuggestion(location, target.declarations, target.escapedName as string);
39827+ break;
39828+ }
39829+ else {
39830+ if (symbol === target) {
39831+ break;
39832+ }
39833+ symbol = target;
39834+ }
39835+ }
39836+ else {
39837+ break;
3980739838 }
3980839839 }
3980939840 }
0 commit comments