TypeScript - tsconfig Deep Dive
        
           
        
        
        
        
Strictness
  - strict: Enables all strict options.
- noImplicitAny,- strictNullChecks,- exactOptionalPropertyTypes,- noUncheckedIndexedAccess
Module & Target
  - target: JS language level to emit (e.g., ES2020).
- module: ESM/CJS/ESNext; bundlers often prefer- ESNext.
- moduleResolution:- bundler,- node, or- nodenext.
JSX
  - jsx:- react-jsx,- react-jsxdev, or- preserve.
Emit & Declarations
  - declaration,- declarationMap,- sourceMap
- outDir,- rootDir,- removeComments
Project Layout
  - baseUrl&- pathsfor import aliases
- composite&- referencesfor multi-project builds
- incremental&- tsBuildInfoFilefor faster rebuilds
Example tsconfig
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "outDir": "dist",
    "rootDir": "src",
    "baseUrl": ".",
    "paths": { "@/*": ["src/*"] }
  },
  "include": ["src"],
  "exclude": ["dist", "node_modules"]
}