TypeScript strict mode enabled
Why it matters
Without TypeScript strict mode, the compiler silently allows implicit any types, skips null-safety checks, and misses a family of type errors that only surface at runtime. ISO 25010:2011 §6.5.4 classifies these as reliability defects. A single null dereference in an authentication path or payment flow can take down production. Strict mode is the umbrella flag — disabling it means noImplicitAny, strictNullChecks, and strictFunctionTypes are all off simultaneously.
Severity rationale
Critical because disabling strict mode silently opts out of the compiler's entire null-safety and implicit-any detection family, letting whole classes of runtime crashes ship undetected.
Remediation
Enable strict mode in tsconfig.json. Do not compensate by disabling individual sub-flags — that defeats the flag's purpose. To migrate an existing codebase without a full-stop build failure, temporarily set "noEmitOnError": false while you work through the errors one file at a time.
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true
}
}
Use // @ts-expect-error (with a comment) to suppress individual stubborn errors during migration — never // @ts-ignore without context.
Detection
-
ID:
strict-mode -
Severity:
critical -
What to look for: Open
tsconfig.jsonand readcompilerOptions. Look for"strict": true. Thestrictflag is a convenience flag that enables a family of strict type checking options simultaneously:noImplicitAny,strictNullChecks,strictFunctionTypes,strictBindCallApply,strictPropertyInitialization,noImplicitThis, andalwaysStrict. Ifstrictis absent or false, check whether these sub-flags are individually enabled (partial credit scenario: note which are missing). Astrict: truesetting that is then partially overridden by explicit"noImplicitAny": falsestill fails this check. -
Detector snippet (shell-capable tools only): If
jqis available, read the explicitcompilerOptions.strictvalue. Output"true"means pass. Output"false"or"null", or exit >=2 (file not found / malformed JSON), means the snippet is inconclusive — fall back to the prose reasoning below and walk anyextends:chain manually.jq -r '.compilerOptions.strict // "null"' tsconfig.json -
Pass criteria: Quote the actual
strictvalue fromtsconfig.json. On pass, report the count of strict-related compiler options enabled. Count alltsconfig.jsonfiles.compilerOptions.strictistrueand is not overridden by explicit disabling of individual sub-flags with at least 1 verified location. -
Fail criteria:
strictisfalse, missing, orstrict: trueis paired with explicitfalseoverrides on sub-flags. A project that relies only on individual strict flags without the umbrellastrict: truedoes not count as pass. -
Skip (N/A) when: Project has no TypeScript files — all source files are
.jsor.jsxwith notsconfig.json. -
Detail on fail:
"tsconfig.json has strict: false (or missing); noImplicitAny and strictNullChecks are not enforced"(max 500 chars) -
Cross-reference: Compare with
code-quality-essentials.type-safety.strict-null-checks— strict mode enables strictNullChecks, but this check verifies the umbrella flag. -
Remediation: Enable strict mode in
tsconfig.json. If the project has existing code that does not compile under strict mode, enable it progressively using// @ts-expect-erroron specific lines while you fix each class of issue. Never disable a sub-flag to silence the migration — that defeats the purpose.{ "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true } }To see what errors strict mode surfaces without failing your build, temporarily add
"noEmitOnError": falseduring migration.
External references
- iso-25010:2011 · maintainability.modifiability — Maintainability — Modifiability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-quality-essentials·automated
- 2026-04-20·v1.1.0·Add Phase 6.0 detect-jq snippet for deterministic tsconfig.strict parse·by cakleinman