← Home ← Codex ← DEBT ← Engine
Browse by Category
+ added · updated 7d
← Back to glossary

tsconfig.json

TypeScript 4.0 Intermediate
debt(d5/e3/b7/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The detection_hints list tsc and typescript itself as the tools. Misconfigured tsconfig issues (wrong module/moduleResolution pairing, missing strict, wrong target) are caught by the TypeScript compiler/language server but not by default linters — you need to actually run tsc or have a TypeScript-aware IDE plugin active. Some mismatches only surface at runtime or in specific tooling contexts, pushing slightly above d5 but not quite to code-review-only (d7).

e3 Effort Remediation debt — work required to fix once spotted

Closest to 'simple parameterised fix' (e3). The quick_fix is essentially a set of top-level tsconfig.json property changes (target, module, strict, moduleResolution). Each individual fix is a one-liner, but addressing a misconfigured tsconfig holistically — especially module/moduleResolution mismatches that ripple into import paths — often requires adjusting several related settings and verifying the build still works, making it slightly more than a single-call swap.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7). tsconfig.json applies to the entire web/cli codebase and is the foundation of TypeScript compilation. Every file in the project is compiled under its rules; strictness settings, module resolution, and target affect every module, every import, and every editor integration. A misconfigured tsconfig shapes all future TypeScript work — developers encounter its constraints on every change, and fixing it late can require touching many files (e.g., enabling strict after the fact).

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7). The misconception field explicitly states that developers believe tsconfig.json is optional and that defaults are safe — in reality, missing or misconfigured tsconfig causes module resolution failures, wrong JS output, and editor/CLI disagreements. The module+moduleResolution pairing is a well-known gotcha that contradicts how many developers expect configuration to work (each setting seeming independent but actually tightly coupled), and the 'optional with sane defaults' belief is directly contradicted by behavior.

About DEBT scoring →

Also Known As

tsconfig TypeScript configuration compiler options

TL;DR

The TypeScript compiler configuration file — controlling which files are compiled, what JavaScript version is targeted, strictness settings, and module resolution.

Explanation

Key tsconfig options: strict (enable all strict checks), target (ES output version — ES2020+ for modern Node), module (CommonJS for Node, ESNext for bundlers), lib (DOM types for browser, ES2022 for Node), paths (import aliases), outDir (compiled output), sourceMap (debugging), and include/exclude (which files to compile). Project references enable monorepo compilation. The extends field enables shared base configs (tsconfig/bases packages).

Common Misconception

tsconfig.json is optional for TypeScript projects — without it, the TypeScript compiler uses defaults that may not match your environment, causing module resolution and strictness surprises.

Why It Matters

A misconfigured tsconfig causes errors in editors but not CLI (or vice versa), module resolution failures, and wrong JavaScript output — it is the foundation of a working TypeScript setup.

Common Mistakes

  • Not setting target appropriately — target: ES5 produces verbose output; ES2020+ is fine for modern Node and bundlers.
  • Mismatching module and moduleResolution — module: CommonJS requires moduleResolution: node; module: ESNext requires bundler or node16.
  • Not including source maps — debugging compiled TypeScript without source maps is painful.
  • Over-broad include patterns — include: ['**/*'] compiles test files and config files into production output.

Code Examples

✗ Vulnerable
// Minimal tsconfig — many unsafe defaults:
{
  "compilerOptions": {
    "outDir": "./dist"
  }
  // No strict mode, no target, no module — compiler guesses
}
✓ Fixed
// Production Node.js tsconfig:
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "lib": ["ES2022"],
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "sourceMap": true,
    "declaration": true,
    "skipLibCheck": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

Added 15 Mar 2026
Edited 22 Mar 2026
Views 144
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
1 ping W 0 pings T 0 pings F 1 ping S 1 ping S 1 ping M 0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 2 pings S 0 pings M 0 pings T 1 ping W 0 pings T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 0 pings S 1 ping M 1 ping T 0 pings W 0 pings T
No pings yet today
No pings yesterday
PetalBot 16 Google 13 Amazonbot 10 Ahrefs 9 ChatGPT 9 Perplexity 8 Scrapy 7 SEMrush 5 Unknown AI 4 Bing 4 Twitter/X 2 Applebot 2 Brave Search 2 Meta AI 1 Baidu 1
crawler 87 crawler_json 5 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Low
⚡ Quick Fix
Start with target: ES2022, module: NodeNext, strict: true, and moduleResolution: bundler for modern projects — these settings catch the most bugs and work with current bundlers
📦 Applies To
typescript 4.0 web cli
🔗 Prerequisites
🔍 Detection Hints
tsconfig.json without strict: true; old target ES5 for modern Node.js; no paths config for absolute imports; no composite for monorepo
Auto-detectable: ✓ Yes typescript tsc
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Low ✓ Auto-fixable Fix: Low Context: File


✓ schema.org compliant