Skip to content

Commit fcb9d93

Browse files
authored
Merge pull request microsoft#19390 from Microsoft/fix19378
Check for `--strict` along with `--noImplicitAny` for code fix
2 parents 74cbb82 + e0d76d1 commit fcb9d93

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)