Merge pull request #19390 from Microsoft/fix19378

Check for `--strict` along with `--noImplicitAny` for code fix
This commit is contained in:
Mohamed Hegazy
2017-10-20 16:48:23 -07:00
committed by GitHub

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;
}
}
}
}