1001Ferramentas
🔷Dev

tsconfig Strict Generator

Generate a strict tsconfig.json.



  

A strict tsconfig you can paste

You started a TypeScript project, ran tsc --init and got back a file full of commented-out lines. Then comes the usual question: which flags do I turn on today, and which ones can wait? This page skips the debate. It shows one finished block with strict already on plus a few hygiene checks, and you paste it over your tsconfig.json.

There is nothing to fill in. The Generate button always returns the same JSON, and it is already on screen when the page loads. Inside it: target ES2022, module ESNext, moduleResolution bundler, esModuleInterop, skipLibCheck, forceConsistentCasingInFileNames, noUnusedLocals, noUnusedParameters, noImplicitReturns, outDir dist, an include for src and node_modules plus dist excluded.

Check two things before your first build. moduleResolution bundler needs TypeScript 5.0 or newer and assumes Vite, webpack or esbuild resolves your imports, so a plain Node build on CommonJS will make tsc complain. And strict:true is not the whole story, since noUncheckedIndexedAccess and exactOptionalPropertyTypes stay off. React projects still need jsx: react-jsx. Everything runs in your browser.

Frequently asked questions

Can I pick the target or outDir on the page?
No. The tool prints a fixed block with no options, and the Generate button just redraws the same text. Tweak the values after you paste them into your file.
Does this tsconfig work for a Node project?
Only after edits. As printed, it assumes a bundler: module ESNext and moduleResolution bundler. For CommonJS on Node, switch to module commonjs and moduleResolution node16.
Why did my build fail over an unused variable?
Because noUnusedLocals and noUnusedParameters are both on. That helps in CI and gets annoying while you are drafting code. Drop the two lines if they get in the way.

Related Tools