Look up TypeScript compiler flags without the handbook
The TypeScript compiler tsc exposes dozens of flags that change type checking, the emitted JavaScript, and module resolution. This reference lets you search every common flag by name or effect, filter by group (Strict, Module, Emit, Type-checking), and see both the CLI form and the tsconfig.json compilerOptions equivalent along with its default. It runs entirely in your browser — useful for a quick lookup mid-project without leaving your editor.
How flags are organised
Each entry pairs the CLI flag (kebab-case with a -- prefix) with its tsconfig.json camelCase key, records the default, marks whether it belongs to the --strict family, and explains its effect. The compiler reads compilerOptions from tsconfig.json first, then applies any CLI overrides on top, so a tsc --noEmit in a CI script will override whatever noEmit is set to in the file.
The four main groups are:
- Strict — type-safety flags bundled under
strict: true(noImplicitAny,strictNullChecks,strictFunctionTypes,noImplicitThis, and more) - Module — controls the module system (
module,moduleResolution,esModuleInterop,allowSyntheticDefaultImports) - Emit — controls what
tscwrites out (target,outDir,declaration,noEmit,sourceMap) - Type-checking — additional checks outside the strict family (
noUnusedLocals,noFallthroughCasesInSwitch,exactOptionalPropertyTypes)
A practical starting tsconfig.json
This covers the common web/Node project baseline:
{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"declaration": true,
"outDir": "dist"
}
}
Flag-by-flag tips
strict— enable it on day one; relaxing individual members later ("noImplicitAny": false) is much easier than retrofitting strict mode to an existing codebase.noEmit: true— turnstscinto a pure type checker. Useful in CI alongside a bundler (esbuild, SWC, Vite) that handles the actual JavaScript output, which is usually faster.skipLibCheck: true— skips type-checking.d.tsdeclaration files from yournode_modules. Dramatically speeds up builds in large projects with many third-party packages at the cost of missing errors inside those packages.targetvsmodule—targetsets the JavaScript syntax level of the emitted code (e.g.ES2022keeps optional chaining and nullish coalescing native);modulesets the module system (CommonJS,ESNext,NodeNext) independently. You can target modern syntax but emit CommonJS for Node, for example.module: "NodeNext"withmoduleResolution: "NodeNext"— the right pair for modern Node.js. Resolution follows theexportsmap in each package’spackage.jsonand requires.jsextensions on relative imports in ESM files.exactOptionalPropertyTypes— a stricter variant ofstrictNullChecksthat distinguishes between{ x?: string }(property may be absent) and{ x: string | undefined }(property must be present but can be undefined). Off by default even understrict.
Common mistakes
Mixing "module": "CommonJS" with "moduleResolution": "NodeNext" produces confusing errors — keep them consistent. Similarly, omitting "esModuleInterop" when importing CommonJS packages with default exports (like Express) causes import express from 'express' to fail at runtime even if it type-checks.
All lookups run in your browser and nothing is sent to any server.