Check for --strict along with --noImplicitAny for code fix

This commit is contained in:
Mohamed Hegazy 2017-10-20 14:39:58 -07:00
parent 809674d66e
commit 97eabde79d

View File

@ -12,7 +12,8 @@ namespace ts.refactor.installTypesForPackage {
registerRefactor(installTypesForPackage);
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
if (context.program.getCompilerOptions().noImplicitAny) {
const options = context.program.getCompilerOptions();
if (options.noImplicitAny || options.strict) {
// Then it will be available via `fixCannotFindModule`.
return undefined;
}
@ -60,4 +61,4 @@ namespace ts.refactor.installTypesForPackage {
return false;
}
}
}
}