Explain tsconfig.json code

Paste a tsconfig.json and Vibe explains what each compiler option changes, which files TypeScript checks and why strict suddenly finds errors.

tsconfig.json

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe17 lines selected

Press Explain it for the sample, or paste your own code first.

What this tsconfig.json sample shows

compilerOptions
target is the JavaScript version to write, rootDir and outDir say where the .ts files are and where the .js files go. declaration adds a .d.ts type file next to each .js file and sourceMap a .js.map, so one npx tsc wrote six files for two sources: index.js, index.d.ts, index.js.map and the same three for prices.
strict checks
strict turns on a group of checks. One of them stopped function double(x) with error TS7006: Parameter 'x' implicitly has an 'any' type. noUncheckedIndexedAccess isn't part of strict: it treats prices[0] as maybe missing, so first.toFixed(2) failed with 'first' is possibly 'undefined'. and passed with the option off.
modules
NodeNext makes TypeScript follow Node's own rules for imports, which depend on package.json's "type": "module". Under them a relative import needs its file extension, and you write .js even though the file on disk is .ts: import { total } from "./prices" failed with error TS2835: Relative import paths need explicit file extensions, and "./prices.js" worked. Without the "type" line, the same import compiled.
include and exclude
include lists the files to start from and exclude takes some of them back out, so npx tsc --listFilesOnly named src/prices.ts and src/index.ts but not the test file. Patterns use ** for any number of folders.

Good to know

  • Run with TypeScript 5.9.3 on a two-file project: npx tsc finished with no errors, and node dist/index.js printed total 19.75 and cheapest 3.25.
  • Unlike package.json, a tsconfig.json may have // comments, and the compiler read this one, comment included, without complaint.
  • skipLibCheck skips checking every .d.ts file, the ones in installed packages and any you write yourself (TypeScript's docs: "Skip type checking of declaration files."). Builds get faster, and errors inside those files go unreported; your .ts files are still checked.

Watch out: exclude only changes where TypeScript starts, not what it compiles. When src/run-tests.ts imported ./prices.test.js, the test file was checked and written to dist/ anyway, and --listFilesOnly listed it. To keep a file out of the build, nothing the build includes may import it.

Explain tsconfig.json code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open