Repository navigation
Expand file tree
/
Copy pathtsconfig.json
More file actions
42 lines (40 loc) · 1.81 KB
/
Copy pathtsconfig.json
File metadata and controls
42 lines (40 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
"compilerOptions": {
"target": "ES2022",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
// `node` is for the build config (vite.config.ts: the git lookup and
// the chunk-size check) and the tests that run a server or a script
// (ecosystem-client, static-serving, check-health-json). Vite's and
// Vitest's own types reference it too; the entry says so out loud.
// The app itself never touches a node API.
"types": ["vite/client", "node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
// `tests` and the vitest config are here so `tsc` covers them too: a test
// that no longer compiles is a test that stopped guarding anything, and
// `npm test` alone would report that as a passing suite of whatever is
// left.
//
// vite.config.ts for the same reason. It holds the only build-time code in
// the repo — the plugin that emits health.json — and Vite loads it through
// esbuild, which strips types without checking them: a mistyped emitFile
// option (`filename` for `fileName`) still builds cleanly and quietly
// drops /api/health. `tsc` names that mistake; CI's health.json check
// (scripts/check-health-json.mjs) catches whatever typing cannot.
"include": ["src", "tests", "vitest.config.ts", "vite.config.ts"]
}