Skip to content

Commit e0d76d1

Browse files
committed
Check for --strict along with --noImplicitAny for code fix
1 parent 8a22767 commit e0d76d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/refactors/installTypesForPackage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace ts.refactor.installTypesForPackage {
1212
registerRefactor(installTypesForPackage);
1313

1414
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
15-
if (context.program.getCompilerOptions().noImplicitAny) {
15+
const options = context.program.getCompilerOptions();
16+
if (options.noImplicitAny || options.strict) {
1617
// Then it will be available via `fixCannotFindModule`.
1718
return undefined;
1819
}
@@ -60,4 +61,4 @@ namespace ts.refactor.installTypesForPackage {
6061
return false;
6162
}
6263
}
63-
}
64+
}

0 commit comments

Comments
 (0)