Compiler Options Reference in TypeScript

From the TypeScript cheat sheet ยท TSConfig Reference ยท verified Jul 2026

Compiler Options Reference

Complete reference of TypeScript compiler options with descriptions and values

typescript
// tsconfig.json
{
  "compilerOptions": {
    // Target & Module
    "target": "ES2020",              // ES5, ES2020, ES2022, ESNext
    "module": "commonjs",            // commonjs, ESNext, node16
    "lib": ["ES2020", "DOM"],        // Standard library types
    
    // Type Checking
    "strict": true,                  // Enable all strict checks
    "noImplicitAny": true,          // Error on 'any' type
    "strictNullChecks": true,       // Strict null/undefined checks
    
    // Module Resolution
    "moduleResolution": "bundler",  // bundler, node16, nodenext
    "esModuleInterop": true,        // CommonJS interop
    "resolveJsonModule": true,      // Import JSON files
    
    // Emit
    "outDir": "./dist",             // Output directory
    "rootDir": "./src",             // Source directory
    "sourceMap": true,              // Generate sourcemaps
    "declaration": true,            // Generate .d.ts files
    
    // JavaScript
    "allowJs": true,                // Allow .js files
    "checkJs": false,               // Type check .js files
    
    // Skip Checks
    "skipLibCheck": true,           // Skip .d.ts checking
    "forceConsistentCasingInFileNames": true
  }
}
๐Ÿ’ก Start with strict: true and adjust as needed
๐Ÿ“Œ Use paths for clean import aliases
โšก skipLibCheck speeds up compilation significantly
โœ… Different project types need different configs
Back to the full TypeScript cheat sheet