DevTools Logo

tsconfig Generator

tsconfig Generator

Compose a valid tsconfig.json with sensible presets, strict flags and path aliases.

Runs in your browser
Try an example

Compiler options

9 options · 0 aliases

tsconfig.json

25 lines · 383 chars
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "esnext",
    "moduleResolution": "bundler",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "jsx": "react-jsx",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "noEmit": true
  },
  "include": [
    "src"
  ],
  "exclude": [
    "dist",
    "node_modules"
  ]
}

Details

TypeScript's compiler options interact: node16 modules need matching resolution, bundler resolution pairs with noEmit, and declaration cannot be combined with noEmit. This generator starts from a real-world preset (Next.js, React + Vite, Node service, library, strict or vanilla) and emits a key-ordered tsconfig.json with only the options you need. It validates incompatible combinations and path-alias syntax while still showing the JSON, so you can experiment safely. Everything is computed in the browser.

Next.js app

target ES2017 · module esnext · jsx preserve · paths @/* → ./src/*

Matches the settings a modern Next.js app expects.

Node service

module node16 · moduleResolution node16 · outDir dist · declaration true

Emits declarations into dist with resolution rules Node 16+ understands.

Path aliases

"paths": { "@lib/*": ["./src/lib/*"] }

Aliases need a * wildcard and relative targets; the validator checks both.

About this tool

tsconfig Generator runs entirely in your browser on DevTools — no signup, no upload.

What this tool does not do

  • tsconfig Generator is a free in-browser utility, not a hosted API, and keeps no server-side history.

How to use this tool

  1. Set your options

    Choose the options tsconfig Generator should use.

  2. Generate

    Press the generate action; each run produces fresh output.

  3. Copy or export the result

    Copy or download the generated result. tsconfig Generator keeps no server-side history, so save what you need before leaving the page.

Frequently asked questions

Which preset should I start from?

React + Vite and Next.js apps use bundler resolution with noEmit, because the bundler handles output. Node services use node16/nodenext resolution with outDir and declarations. A library typically emits ESM with declarations, while vanilla is a conservative CommonJS baseline. Pick the closest preset then adjust individual options.

Why do module and moduleResolution need to match?

TypeScript resolves imports differently for Node's ESM rules, CommonJS and bundlers. module node16 or nodenext requires moduleResolution node16/nodenext, and module commonjs cannot use bundler resolution. Mixing them produces imports that type-check but fail at runtime.

What does noEmit mean?

noEmit tells TypeScript to type-check without writing JavaScript files, which is what Vite and Next.js expect because they transpile themselves. If you also want declarations, use emitDeclarationOnly or turn noEmit off; having both declaration and noEmit enabled is a configuration error the tool flags.

How do path aliases work?

A path alias maps an import prefix to one or more relative targets, for example @/* → ./src/*. The key must contain a * wildcard, targets must be relative, and classic Node resolution also needs baseUrl. The generator validates those rules and shows the emitted paths object.

Does strict mode cover every check?

strict is an umbrella for a family of checks such as noImplicitAny and strictNullChecks. You can leave strict on and selectively disable individual checks, or enable extra ones like noUnusedLocals. The form exposes the most common switches and emits only the ones you turn on.

Is my configuration uploaded?

No. Presets and validation are plain browser-side logic; the generated JSON is copied or downloaded locally.