fix(47256): show deprecated on index signatures (#47400)

This commit is contained in:
Oleksandr T
2022-02-16 03:13:04 +02:00
committed by GitHub
parent 39fe0318e0
commit a0bab5de5c
2 changed files with 34 additions and 0 deletions

View File

@@ -28587,6 +28587,9 @@ namespace ts {
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
}
if (indexInfo.declaration && getCombinedNodeFlags(indexInfo.declaration) & NodeFlags.Deprecated) {
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText as string);
}
}
else {
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {