Tool

jsconfig.json generator

Choose your project shape and how strict the checker should be. The config, the npm scripts and the install line update as you go, ready to copy.

Each shape matches a setup page in the quick start. Options that do not apply to a shape are hidden for it, such as Node.js types for the browser.

How strict
Options

jsconfig.json

{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "target": "es2024",
    "types": ["node"],
    "skipLibCheck": true
  },
  "include": ["src/**/*.js", "test/**/*.js"]
}

Save it next to package.json.

package.json

{
  "type": "module",
  "scripts": {
    "lint": "tsc -p jsconfig.json",
    "lint:watch": "tsc -p jsconfig.json --watch --preserveWatchOutput"
  }
}

Merge these keys into your package.json.

Install

npm install --save-dev typescript @types/node

Development dependencies only: nothing here ships with your code.

The same options with tsc --init

npx tsc --init --checkJs --noEmit --strict --module nodenext --moduleResolution nodenext --target es2024 --types node --skipLibCheck --sourceMap false --declaration false --declarationMap false --noUncheckedIndexedAccess false --exactOptionalPropertyTypes false --verbatimModuleSyntax false --isolatedModules false --noUncheckedSideEffectImports false --moduleDetection auto

Writes tsconfig.json with exactly these compiler options (and "jsx", which does nothing without JSX). Rename it to jsconfig.json and add the include list by hand.

How it works

The generator starts from the checked config on the project shape's quick-start page, for example the Node.js ES modules setup, then applies the strictness level and the options you pick. It works from the choices on this page and does not read your files.

Every combination it can produce is parsed by TypeScript 5.9 in this site's tests, and its tsc --init line is run through TypeScript's own init code to confirm it writes the same compiler options.

The three levels

  • Relaxed. Checks what TypeScript can infer; untyped parameters stay allowed. A first step for an existing codebase.
  • Recommended. strict on: a parameter TypeScript cannot infer needs a type, and null and undefined are checked. The setting for new code.
  • Strict. strict plus checked index access, exact optional properties, and no missing returns or switch fall-through.

Not sure? Start with recommended on new code. On an existing codebase, start relaxed, fix what it finds, then move up; checkJs explains the order.