Enabling TypeScript Strict Mode in a Legacy React Project: A Gradual Approach
Our App was created in 2017. It is a React application written in TypeScript. At the time, TypeScript was gaining popularity, but strict type safety wasn’t a major concern for most teams. Our knowledge of TypeScript was limited, and the primary goal was to use it for basic type annotations rather than enforcing a fully type-safe codebase. As a result, strict mode was never turned on. The codebase ran without the safeguards strict mode brings: strict null checks, no implicit any, and tighter type inference. As the project grew, that gap started to cost us. Subtle bugs slipped through, and refactoring carried more risk than it should have. ...