Ctrl K
ComunidadGuías…

tsconfig.base.json

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
// Shared by the root tsconfig.json and every package under packages/*
// (each extends this with `../../tsconfig.base.json` and its own `include`).
// The six configs this replaces had drifted independently; where they
// disagreed, the stricter or more complete setting won:
//   - noUnusedLocals: only the five packages had it: added here, so the root
//     tsconfig now enforces it too.
//   - noImplicitOverride / noFallthroughCasesInSwitch: only root had them:
//     added here, so every package now enforces them too.
//   - lib: only auth omitted DOM/DOM.Iterable (a leftover from before its
//     browser-adjacent types existed): every package needs the same globals
//     as its siblings, so DOM/DOM.Iterable is included for all.
//   - customConditions: ["development"]: every exports entry of core and of
//     each add-on lists `development` first, naming its `.ts` source, so a
//     typecheck resolves `@jimhoyd/urlcode/...` and sibling add-ons to source
//     with no build (#1056). Each add-on's tsconfig.build.json sets it back to
//     [] so its emit (rootDir src) reads core's built declarations instead.
//     Packing strips the condition (scripts/published-manifest.mjs).
// `noEmit` is deliberately NOT here: the root's typecheck config sets it
// directly, and each package's tsconfig.build.json (which must emit `dist/`)
// extends the same tsconfig.json a package's `tsc --noEmit` typecheck uses,
// so noEmit has to come from the CLI flag or a build-specific override, not
// from a config every consumer shares.
{
  "compilerOptions": {
    "target": "ES2024",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "lib": ["ES2024", "DOM", "DOM.Iterable"],
    "types": ["node"],
    "strict": true,
    "useUnknownInCatchVariables": true,
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "erasableSyntaxOnly": true,
    "verbatimModuleSyntax": true,
    "isolatedModules": true,
    "allowImportingTsExtensions": true,
    "rewriteRelativeImportExtensions": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "customConditions": ["development"]
  }
}