Just check all declarations, don't call isUncalledFunction
This commit is contained in:
parent
6e5d75b58b
commit
e2eb319e72
2 changed files with 12 additions and 1 deletions
|
@ -35323,7 +35323,7 @@ namespace ts {
|
||||||
error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
error(node, Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isImportSpecifier(node) && isUncalledFunctionReference(target.valueDeclaration, target)) {
|
if (isImportSpecifier(node) && every(target.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) {
|
||||||
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
|
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
11
tests/cases/fourslash/jsdocDeprecated_suggestion9.ts
Normal file
11
tests/cases/fourslash/jsdocDeprecated_suggestion9.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
///<reference path="fourslash.ts" />
|
||||||
|
|
||||||
|
// @Filename: first.ts
|
||||||
|
//// export class logger { }
|
||||||
|
// @Filename: second.ts
|
||||||
|
//// import { logger } from './first';
|
||||||
|
//// new logger()
|
||||||
|
|
||||||
|
goTo.file('second.ts')
|
||||||
|
verify.noErrors()
|
||||||
|
verify.getSuggestionDiagnostics([]);
|
Loading…
Reference in a new issue