Strict tsconfig.json for a real TypeScript project

11 steps · about 2 h 52 min · Intermediate

  1. What is a tsconfig.json (doc, TypeScript Handbook (typescriptlang.org), 15 min)

    Start with what the file is for, how the compiler finds it, and how include, exclude and extends work.

  2. How to Enable and Use TypeScript Strict Mode Effectively (article, OneUptime, 15 min)

    Next, see which individual flags the single strict switch turns on, shown in a complete example config.

  3. TSConfig Reference (reference, TypeScript (typescriptlang.org), 30 min)

    This is the official source for every option and its default. Use it to check what any flag does, especially the strict family.

  4. The TSConfig Cheat Sheet (guide, Total TypeScript (Matt Pocock), 15 min)

    It gives a practical baseline config and explains which options depend on whether you transpile, build a library or target the DOM.

  5. The Strictest TypeScript Config (article, whatislove.dev, 15 min)

    Shows before-and-after code for three beyond-strict flags, so you can see the errors each one raises.

  6. Modules: Choosing Compiler Options (doc, TypeScript Handbook (typescriptlang.org), 20 min)

    Strictness is only part of a tsconfig. This guide helps you choose module, moduleResolution and target to match your app, library or bundler.

  7. Sensible tsconfig.json Defaults (article, Patrick Kerschbaum, 10 min)

    A worked example of a full modern config for a package, with a note on the TypeScript 6.0 change to the types default.

  8. tsconfig/bases (repo, GitHub (tsconfig), 15 min)

    Lets you extend a maintained base config such as strictest or recommended, then see exactly which flags it sets, instead of copying options by hand.

  9. TypeScript 5.9 release notes (doc, TypeScript (typescriptlang.org), 10 min)

    Explains how the minimal tsc --init output works today and why you should rely on the reference and your editor instead of a long commented file.

  10. TypeScript strict mode: 6 tsconfig options and production impact (article, juanchi.dev, 12 min)

    Covers the costs and trade-offs of the stricter flags, such as exactOptionalPropertyTypes with ORMs, before you turn them on in a real codebase.

  11. How to Configure TypeScript Strict Mode (article, OneUptime, 15 min)

    Last, it covers migrating an existing project in phases, starting with noImplicitAny and strictNullChecks, so you can adopt strictness without a flood of errors.