Q48: What individual compiler options are enabled by setting `"strict": true` in `tsconfig.json`?

Difficulty:MediumTopic:Compiler Options

Enabling "strict": true activates strict type checking compiler options:

  • noImplicitAny: Raises errors on expressions inferred as any.
  • strictNullChecks: Ensures null and undefined are not assignable to other types unless explicitly unioned.
  • strictFunctionTypes: Enforces contravariant parameter checking on function signatures.
  • strictBindCallApply: Enforces strict type matching on .bind(), .call(), and .apply().
  • strictPropertyInitialization: Ensures class properties are initialized in the constructor.
Key Takeaways
  • Always enable "strict": true in modern TypeScript projects.