Home/Config Files/tsconfig.json
Config File Wiki

tsconfig.json config guide

TypeScript compiler options, path aliases, JSX mode, strictness, and emitted output behavior.

Field explanations

  • compilerOptions: TypeScript behavior
  • include/exclude: files included in type checking
  • paths/baseUrl: editor path aliases
  • strict: type safety mode

Minimal template

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true
  },
  "include": ["src"]
}

Common usage patterns

  • Keep tsconfig.json small and reviewable
  • Use comments only when the format supports them
  • Commit example files with placeholder values
  • Validate locally before deploying

Common errors

  • paths works in editor but not Vite
  • moduleResolution mismatch
  • strict disabled hides real bugs
  • include excludes generated files

Online validation

Validate syntax first, then compare behavior against your deploy target. For JSON-based configs, use the JSON formatter before debugging tool-specific behavior.

Related tools