Strict mode is the difference between "TypeScript as a suggestion" and "TypeScript as a safety net".
Direct answer
Setting "strict": true in tsconfig.json turns on several checks, including noImplicitAny, strictNullChecks and strictFunctionTypes. It catches more bugs at compile time, especially null and undefined mistakes. New projects should start with it on.
What it catches
// noImplicitAny
function double(x) { // error: parameter has an implicit any type
return x * 2;
}
// strictNullChecks
let name: string = null; // error
const user = users.find(u => u.id === 1);
console.log(user.name); // error: user may be undefined
Adopting it in an existing project
- Turn on one flag at a time.
- Fix the errors it reveals.
- Use
// @ts-expect-errorsparingly for temporary exceptions.
Where Teyro fits
Teyro's TypeScript for Beginners course turns this into short lessons you can play in a few minutes a day. It has 20 lessons, and you can start free.
The bottom line
Turn it on early. The errors it shows are real bugs waiting to happen.


