From 97eabde79d59e86b9f614646eb254da2c90d511e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 20 Oct 2017 14:39:58 -0700 Subject: [PATCH] Check for `--strict` along with `--noImplicitAny` for code fix --- src/services/refactors/installTypesForPackage.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/refactors/installTypesForPackage.ts b/src/services/refactors/installTypesForPackage.ts index ded4a1d47af..5edc5570710 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 +}