Lesson 3.3

Strict mode migration strategy

Enabling every strict flag on a large codebase produces thousands of errors and a branch nobody merges.

14mIntermediate14.2k students

Overview

Incremental, or it will not happen

Enabling every strict flag on a large codebase produces thousands of errors and a branch nobody merges. Enable one flag at a time, starting with the one that finds real bugs — null and undefined checking — and fix its errors before moving on.

New code should be strict immediately, even while old code is not. A lint rule that blocks new violations means the number only goes down.

Convert file by file, prioritising the modules that are edited most often. The oldest untouched file is also the one least likely to hurt you.

In this lesson you will:

  • Turn on strict flags one at a time
  • Stop the bleeding before fixing history
  • Track progress without blocking releases

Resources

Previous Lesson
Next Lesson
Strict mode migration strategy — TypeScript Deep Dive — Vertex