"tsconfig has 100+ options. Ten of them matter most of the time."
The options that matter most
target— JavaScript version to emit.ES2022is the modern default; older targets transpile syntax down. Match your runtime.module— module system to emit.NodeNextfor Node ESM,ESNextfor bundlers,CommonJSonly for legacy Node.moduleResolution— how imports get resolved.NodeNextfor modern Node,Bundlerfor Vite/esbuild.strict— the safety meta-flag. Alwaystrue. Covered in detail in the next track.esModuleInterop— makes CommonJS interop saner. Set totrue.skipLibCheck— skip type checks on.d.tsfiles.truefor most projects (faster, and you can't fix library types anyway).forceConsistentCasingInFileNames— catch case mismatches in imports (./MyFilevs./myfile). Alwaystrue.outDir— where compiled JS goes (only matters if you emit).rootDir— where source TS comes from. Pairs with outDir.include/exclude— file patterns.include: ['src']is typical;excludeusually defaults to node_modules + dist.
tsconfig bases
The @tsconfig/* packages on npm provide pre-tuned tsconfig bases for common scenarios. extends: "@tsconfig/node20" inherits the right defaults for Node 20. Use these — they cover the boring parts and let you focus on your project's specifics.
Start with a known-good base, override only what you must. Hand-tuning every option of a fresh tsconfig is a waste; the community has converged on sensible defaults. Use them.