Tous les exports

@adrienlcp/tsconfig

The strictest TypeScript settings, for a type-check-only project bundled by something else

Fonctionne avec

  • TypeScript

Installation

pnpm add -D @adrienlcp/tsconfig

Exports

Groupés par la section de la documentation qui les explique. Une ligne mène à sa section.

Documentation

Le README et les documents à côté, tels qu’écrits dans le dépôt.

PrésentationREADME.md

The strictest TypeScript settings, for a project where tsc only checks and a bundler (Vite, tsdown) emits.

pnpm add -D @adrienlcp/tsconfig
{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  },
  "extends": "@adrienlcp/tsconfig/web-app.json",
  "include": ["scripts", "src", "vite.config.ts"]
}
File For
base.json Any TypeScript: Node, a library, a script. lib: ["esnext"]
web-app.json A React app in the browser: base.json plus jsx: "react-jsx" and the DOM libs

Every flag is on because a bug once paid for it: strict, noUncheckedIndexedAccess, noUnusedLocals / Parameters, noFallthroughCasesInSwitch, noImplicitOverride, erasableSyntaxOnly (no enum, no namespace with values, no parameter properties), verbatimModuleSyntax, noUncheckedSideEffectImports, allowUnreachableCode: false. noEmit is on: a library build sets noEmit: false in its own tsconfig.build.json.

paths, include and types stay in the project: TypeScript resolves paths against the file that declares them, so an alias set here would point inside node_modules.