Skip to content

Menu

TSConfig Generator

Generate tsconfig.json with presets for Next.js, Node, React, and libraries.

Runs entirely in your browserDevOpsFree, no sign-up
Loading tool

01What is TSConfig Generator?

Half the tsconfig problems we see come from mismatched module settings. Someone sets module to esnext and forgets moduleResolution, or copies a Node config into a Vite app. This tool hands you a tsconfig.json for one of four project types, with the module pair that suits each toolchain. There are four preset buttons. Next.js is based on the file create-next-app writes: target ES2017, the dom and esnext libs, allowJs, isolatedModules, bundler resolution, the next plugin and an @/* alias pointing at ./src/*. Its include list picks up next-env.d.ts and .next/types. React (Vite) follows the create-vite template, with bundler resolution, react-jsx, allowImportingTsExtensions, moduleDetection force and the unused-locals checks. Node.js uses module and moduleResolution nodenext, outputs to ./dist from ./src, and targets es2022. The TypeScript handbook recommends nodenext for code Node runs directly. Library is like Node.js but adds declaration, declarationMap and sourceMap so you can publish types. Three checkboxes sit under the presets: strict, skipLibCheck and noEmit. Picking a preset also resets noEmit. It is on for Next.js and Vite, where another tool compiles your code, and off for Node.js and Library, where tsc writes dist/. A note under the checkboxes explains each preset. It also warns you if noEmit is on for a preset that relies on tsc output. Here is a small worked case. Pick React (Vite) and untick noEmit. The output drops allowImportingTsExtensions, because TypeScript raises error TS5096 if that flag is set while emitting. Untick skipLibCheck too and the key disappears from the JSON. The tool leaves unchecked skipLibCheck and noEmit out rather than writing false. strict is different and always appears, as true or false. Limits are worth knowing. There is no editing of individual options, no project references, no monorepo setup and no extends support. The Next.js preset may not match the newest create-next-app output exactly, and Next.js can rewrite parts of the file on the next dev run anyway. The JSON is pretty-printed with two-space indentation and one array item per line. Treat it as a correct base, then add flags from the official TSConfig reference as you need them.

TypeScript developers setting up a new app, service or package use it to get a tsconfig.json whose module settings match their build tool. The tool runs entirely in your browser, so your data never leaves your device.

02How to use TSConfig Generator

  1. Click a preset button: Next.js, Node.js, React (Vite) or Library
  2. Tick or untick strict, skipLibCheck and noEmit
  3. Read the note under the checkboxes for preset-specific caveats
  4. Click the copy icon in the top right of the JSON panel
  5. Save it as tsconfig.json in your project root and run npx tsc --noEmit to check your files

03Worked examples

Input: Node.js preset, strict on, skipLibCheck on (noEmit off by default)
Result: { "compilerOptions": { "target": "es2022", "lib": ["es2023"], "module": "nodenext", "moduleResolution": "nodenext", "esModuleInterop": true, "resolveJsonModule": true, "outDir": "./dist", "rootDir": "./src", "strict": true, "skipLibCheck": true }, "include": ["src"], "exclude": ["node_modules"] }
Arrays are shown on one line here. The tool prints one item per line. noEmit is left out rather than written as false.
Input: Next.js preset, defaults (strict, skipLibCheck and noEmit on)
Result: "jsx": "react-jsx", "incremental": true, "plugins": [{ "name": "next" }], "paths": { "@/*": ["./src/*"] }, "strict": true, "skipLibCheck": true, "noEmit": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "**/*.mts"],
End of compilerOptions plus include, with arrays and objects collapsed onto one line.
Input: React (Vite) preset, skipLibCheck off, noEmit off
Result: "moduleResolution": "bundler", "isolatedModules": true, "moduleDetection": "force", "jsx": "react-jsx", "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "strict": true },
Excerpt. allowImportingTsExtensions is gone because TypeScript only allows it without emit, and skipLibCheck is omitted.
Input: React (Vite) preset, defaults
Result: "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, … "strict": true, "skipLibCheck": true, "noEmit": true
Excerpt. With noEmit on, allowImportingTsExtensions stays in.
Input: Library preset, strict off
Result: "target": "es2022", "module": "nodenext", "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "./dist", "rootDir": "./src", "strict": false, "skipLibCheck": true
All of compilerOptions. strict is always written, as false when unticked. The Library preset sets no lib.

04Common use cases

  • Starting a Vite + React app and wanting tsconfig settings that match the create-vite template
  • Setting up a Node.js service in TypeScript that compiles src/ into dist/ with nodenext resolution
  • Publishing an npm package that needs .d.ts files, declaration maps and source maps in dist/
  • Fixing a config that set module to esnext without moduleResolution and broke package imports
  • Turning off emit for a Vite project to see which options TypeScript only allows without emit
  • Comparing the module, target and lib settings of four common project types side by side

05Tips

  • With module nodenext and "type": "module" in package.json, relative imports need .js extensions, like import './util.js', even though the file is util.ts.
  • paths aliases only change type checking. Next.js and Vite resolve them, but plain Node won't, so a Node.js project needs package.json imports or a bundler for @/ paths.
  • No src/ folder in your Next.js app? Change the alias to "@/*": ["./*"], as the preset note says.
  • Turning strict on late in a large codebase surfaces hundreds of errors at once. Keep it on from day one.
  • If tsc writes nothing, check whether noEmit is ticked. The note under the checkboxes warns you for the Node.js and Library presets.

06Related concepts

TypeScript compiler, Module resolution, Strict mode, nodenext, Declaration files.

Frequently Asked Questions

What is TSConfig Generator?

TSConfig Generator is a free, browser-based developer tool on AIDToolStack. Generate tsconfig.json with presets for Next.js, Node, React, and libraries. It requires no installation or sign-up and works entirely in your browser.

Is TSConfig Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does TSConfig Generator store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe