Strict Mode and Eliminating any
Enable all strict flags in tsconfig, use unknown instead of any, apply type assertions safely, and migrate a weakly-typed file to strict.
Why Strict Mode?
strict: true in tsconfig.json turns on every TypeScript safety flag — the bar for serious projects. It catches null bugs, untyped parameters, and unsafe assignments at compile time.
What strict Enables
strict is a meta-flag that turns on: noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, alwaysStrict, noImplicitThis, useUnknownInCatchVariables.
All lessons in this course
- Template Literal Types
- Decorators and Metadata
- TypeScript with React: FC generics hooks
- Strict Mode and Eliminating any