Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TypeScript · Const

strict

The strict compiler option enables TypeScript’s strict mode family, giving stronger guarantees of program correctness. Individual strict-family checks can be disabled when needed.

How it works

Set the compiler option to enable TypeScript's strict mode family. This activates the strictness checks together, while explicit settings can selectively disable individual checks when a large codebase needs incremental adoption.

Syntax

{"compilerOptions":{"strict":true}}

Parameters

NameTypeDescription
strictbooleanBoolean compiler option; true enables the strict mode family, while false disables the umbrella setting.

Key points

  • It is an umbrella compiler flag that activates a broad collection of stricter type-checking behavior.
  • Its purpose is to increase the compiler's guarantees about program correctness.
  • Enabling it is equivalent to enabling every option in TypeScript's strict-mode family.

Common mistakes

  • A TypeScript upgrade can introduce new errors because newer strict checks may be added to this option.
  • The umbrella setting is not all-or-nothing: override a specific strict-family option if necessary.

Example: Enable strict checking

{
  "compilerOptions": {
    "strict": true
  }
}

Enable the complete strictness family in a project configuration; individual checks can still be disabled when migration requires it.

When to use it

Establish stronger checking defaults

Starting a new application

Expose safer declaration contracts

Maintaining a shared library

Adopt strictness incrementally

Migrating an existing large codebase

Interview questions

QWhat does TypeScript's strict option do?

strict is a compiler setting that enables the strict mode family, providing stronger correctness guarantees. It is configured as a boolean compiler option in tsconfig.json or via the compiler command line.

Follow-up: How would you adopt it incrementally? Enable strict, then explicitly disable individual strict-family options that currently block migration and remove those exceptions over time.

QWhy is strict useful in a large codebase?

It enables the strict mode family as a group rather than requiring each family option to be listed separately. The resulting checks are intended to provide stronger guarantees of program correctness.

Follow-up: Why can enabling it change compiler output diagnostics after an upgrade? The family can gain additional stricter checks in future TypeScript versions.

QCan individual strict checks be disabled while strict is enabled?

strict does not prevent targeted configuration: individual strict-family checks can be turned off after enabling the umbrella option. This supports staged migrations while preserving the other strict checks.

Follow-up: What should a team review after upgrading TypeScript? Recompile and assess newly reported errors, including errors caused by stricter behavior added under strict.

  • alwaysStrict
  • noImplicitAny
  • strictNullChecks
  • strictFunctionTypes
  • strictBindCallApply
  • strictPropertyInitialization

Source: TSConfig Option: strict - TypeScript. Checked 2026-10-15.