diff --git a/src/services/refactors/installTypesForPackage.ts b/src/services/refactors/installTypesForPackage.ts index ded4a1d47afaf..5edc557071096 100644 --- a/src/services/refactors/installTypesForPackage.ts +++ b/src/services/refactors/installTypesForPackage.ts @@ -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; } } -} \ No newline at end of file +}