TypeScript · Compiler and project settings

strict

Turns on the strict family, including strictNullChecks and noImplicitAny. Enable it on every new project.

Syntax
"strict": true

Example

Example
// tsconfig.json
{
  "compilerOptions": {
    "strict": true
  }
}

Notes

The single highest-value compiler flag. It prevents whole classes of null and implicit any bugs.

More in this group

exactOptionalPropertyTypes include / exclude lib moduleResolution noEmit noUncheckedIndexedAccess paths skipLibCheck

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course