diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 1db21ae46f0..9daf31f7899 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1710,7 +1710,7 @@ namespace ts { return moduleResolution; } - export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "alwaysStrict"): boolean { + export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean { return compilerOptions[flag] === undefined ? compilerOptions.strict : compilerOptions[flag]; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index fb59c9eb881..8749d06b43d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3676,6 +3676,8 @@ namespace ts { export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[] | null | undefined; + export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "alwaysStrict"; + export interface CompilerOptions { /*@internal*/ all?: boolean; allowJs?: boolean;