TypeScript Compiler Flags Reference

All tsc CLI flags with effect, default and tsconfig.json equivalent.

Searchable TypeScript compiler flag reference covering strict-mode members, module/target settings, emit options and their tsconfig.json compilerOptions equivalents with defaults. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Which flags does --strict turn on?

The strict family enables noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, noImplicitThis, useUnknownInCatchVariables and alwaysStrict. You can set --strict and then disable individual members if needed.

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 tsc writes 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 — turns tsc into 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.ts declaration files from your node_modules. Dramatically speeds up builds in large projects with many third-party packages at the cost of missing errors inside those packages.
  • target vs moduletarget sets the JavaScript syntax level of the emitted code (e.g. ES2022 keeps optional chaining and nullish coalescing native); module sets the module system (CommonJS, ESNext, NodeNext) independently. You can target modern syntax but emit CommonJS for Node, for example.
  • module: "NodeNext" with moduleResolution: "NodeNext" — the right pair for modern Node.js. Resolution follows the exports map in each package’s package.json and requires .js extensions on relative imports in ESM files.
  • exactOptionalPropertyTypes — a stricter variant of strictNullChecks that distinguishes between { x?: string } (property may be absent) and { x: string | undefined } (property must be present but can be undefined). Off by default even under strict.

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.