tsconfig.json controls TypeScript's compiler behaviour. The most impactful setting is the strict flag (enables 7 checks). target determines emitted JS syntax. module/moduleResolution must match your runtime (Node.js bundler vs browser). paths define module aliases. Project references enable incremental compilation of large monorepos. Understanding these settings prevents subtle bugs and improves compilation performance.
What strict: true enables and why each check matters.
Enabling strict on an existing codebase with 10k lines surfaces 500+ errors. Start every new project with strict: true. The compiler-enforced null safety alone prevents dozens of production bugs.
Wrong moduleResolution causes "cannot find module" errors at runtime despite passing type checks. Use "Bundler" for Vite/webpack projects. Use "NodeNext" for Node.js native ESM.
Without project references, tsc must re-check every package on every change. With composite: true and references, only changed packages are recompiled. 10x speedup on large monorepos.
Sign in to share your feedback and join the discussion.