Developer Tools
TSConfig Generator
Build a clean tsconfig.json with presets for Next.js, Vite, Node, Bun, and libraries. Strictness, paths, lib, JSX, and emit options in your browser.
TSConfig generator
Start from a preset
Pick a project shape
Each preset overwrites the options below. You can still tweak any switch afterwards.
Target and modules
What the compiler emits
JavaScript version of the emitted output. ES2022 is a safe modern default.
Output module system. ESNext for bundlers, NodeNext for native Node ESM, CommonJS for classic Node.
How modules are looked up. Bundler for Vite, Next.js, Webpack, esbuild. NodeNext for native Node ESM.
react-jsx uses the automatic runtime (no import React needed). preserve leaves JSX for the bundler to transform.
Lib
Built-in type libraries
Which globals are available without imports. Pick DOM for browser code, skip DOM for pure Node servers.
Type checking
Strictness and linting checks
Interop and modules
Module behavior
Emit
What tsc writes to disk
Path aliases
baseUrl and paths
Aliases like @/utils point to a real folder. Targets accept comma-separated locations.
Extends
extends
Optional. Inherit options from another tsconfig (file path or npm package, no .json suffix required).
Files
include
One pattern per line. Globs allowed.
Files
exclude
One pattern per line. node_modules is excluded by default.
Output
tsconfig.json
15 compiler options, 39 lines
{
"compilerOptions": {
"strict": true,
"noFallthroughCasesInSwitch": true,
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": [
"ES2022",
"DOM",
"DOM.Iterable"
],
"jsx": "react-jsx",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
},
"include": [
"src",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules",
"dist",
".next",
"build"
]
}Quick rules of thumb
- strict is the single switch that turns on every important type check. Leave it on for new code.
- Use module: ESNext + moduleResolution: Bundler when a bundler (Vite, Next.js, Webpack, esbuild) produces the final JavaScript.
- Use module: NodeNext + moduleResolution: NodeNext for native Node ESM with a real
.mjsortype: modulesetup. - For libraries that ship to npm, enable declaration and declarationMap so consumers get types and a working Go to Definition.
- isolatedModules is non-negotiable for esbuild, swc, Babel, Vite, and Next.js. Keep it on.
Common pitfalls
- Combining module: CommonJS with moduleResolution: Bundler produces confusing failures. Pick one world.
- allowImportingTsExtensions also needs noEmit (or emitDeclarationOnly). The bundler emits the runtime.
- paths only changes how TypeScript resolves names. Your bundler also needs to know. Vite, Next.js, and Webpack 5 ts-loader configs each have their own way to forward the aliases.
- noUncheckedIndexedAccess catches a real class of bugs (
arr[i]can beundefined) but it does add noise to existing code. Turn it on intentionally on a new project, not in the middle of an old one.
How to use
- Pick a preset that matches your project shape, for example Next.js (App Router), React + Vite, Node.js library, Node.js application, Browser library (ESM), Bun project, Deno-friendly ESM, Monorepo base, or Minimal strict. Each preset overwrites the options below.
- Adjust target, module, moduleResolution, and jsx in the Target and modules card. ES2022 with ESNext + Bundler is the right modern default for projects built by Vite, Next.js, Webpack, or esbuild; NodeNext + NodeNext is the right pair for native Node ESM.
- Tick the type libraries you need under Lib. Include DOM and DOM.Iterable for browser code, drop DOM for pure server code.
- Tune the Type checking switches. Leave strict on for new code. The individual strict flags become read-only while strict is on, so the output stays a single line.
- Set Emit options. Turn noEmit on for bundler-driven projects; turn it off and set outDir, rootDir, declaration, declarationMap, and sourceMap when tsc itself emits the JavaScript.
- Add path aliases. baseUrl defaults to . when you add a path. Each alias maps to one or more comma-separated target locations. Include and exclude accept one glob per line.
- Read the diagnostics under the output for any incompatible combinations, then click Copy or Download to save the file as tsconfig.json at the root of your project.
About this tool
TSConfig Generator builds a clean, copy-ready tsconfig.json from the choices people actually make on real TypeScript projects. Start with a preset for Next.js (App Router), React with Vite, a Node.js library, a Node.js application, a browser library that ships ESM, a Bun project, a Deno-friendly ESM setup, a monorepo base for extends, or a minimal strict baseline; every preset writes the modern, well-supported defaults instead of legacy ones (ES2022, ESNext, NodeNext, bundler resolution, isolatedModules). From there, every option is a single toggle: the strict master switch with the underlying noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, noImplicitThis, alwaysStrict, and useUnknownInCatchVariables, plus the linting-style checks noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, noImplicitReturns, noUncheckedIndexedAccess, exactOptionalPropertyTypes, and noPropertyAccessFromIndexSignature. Module behavior is exposed through esModuleInterop, allowSyntheticDefaultImports, forceConsistentCasingInFileNames, resolveJsonModule, isolatedModules, verbatimModuleSyntax, allowImportingTsExtensions, and skipLibCheck. Emit settings cover noEmit, outDir, rootDir, declaration, declarationMap, sourceMap, removeComments, and emitDeclarationOnly with the right ones disabled automatically when noEmit is on. baseUrl and paths support multiple comma-separated targets, so you can model the @/utils style alias used in Next.js, the ~/components alias common in Nuxt or Vue, or a multi-target alias for a monorepo. The top-level extends, include, and exclude fields are editable. The output is rendered as a stable, minimal JSON file: defaults are dropped, the strict family collapses into a single line when strict is on, and you can optionally output JSONC with one-line inline comments documenting every emitted option. Choose 2 or 4 space indent, copy with one click, or download as tsconfig.json. A live diagnostics panel warns about incompatible combinations: CommonJS with bundler resolution, NodeNext module without NodeNext resolution, allowImportingTsExtensions without noEmit, declarationMap without declaration, emitDeclarationOnly without declaration, and paths without baseUrl. Useful for new repos, replacing the create-react-app or create-next-app default with something tighter, building a strict baseline for a library, standing up a monorepo workspace tsconfig that downstream packages extend, or settling a debate about which strict flags should be on. Everything runs locally in your browser. The chosen options are never uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
JSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
ConverterJSON5 to JSON Converter
Convert JSON5 or JSONC to strict JSON with comments and trailing commas stripped.
Open tool
DeveloperGitignore Generator
Build a .gitignore from curated language, framework, editor, and OS templates.
Open tool
DeveloperJSON to TypeScript Converter
Generate TypeScript interfaces or types from any JSON value with full inference.
Open tool
DeveloperTypeScript to Zod Converter
Generate Zod v3 schemas with z.infer types from TypeScript declarations.
Open tool
DeveloperDockerfile Generator
Build a production Dockerfile with multi-stage build, non-root user, BuildKit cache, and healthcheck.
Open tool