-
-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathtsconfig.json
More file actions
44 lines (44 loc) · 2.59 KB
/
Copy pathtsconfig.json
File metadata and controls
44 lines (44 loc) · 2.59 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
43
44
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022"],
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["vitest/globals", "node", "@cloudflare/vitest-pool-workers/types"],
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true,
// #9848: both cost ZERO errors today (measured) and lock in what this repo's RUNTIME already assumes.
// `isolatedModules` makes tsc enforce that every file is independently transpilable -- exactly the
// contract `node --experimental-strip-types` and esbuild's per-file transform already rely on, and which
// nothing was checking. `verbatimModuleSyntax` requires type-only imports to say `import type`, so a
// value import can never be silently elided out of the emitted bundle (or, worse, kept and pulled into
// the self-host bundle that must have zero `cloudflare:*` imports). Enabling them turns two runtime
// assumptions into compile-time guarantees rather than conventions.
"isolatedModules": true,
"verbatimModuleSyntax": true,
// #9553. Dead code is the substrate every drift bug in the 2026-07-27 audit grew on: a stale import or an
// orphaned constant reads exactly like a live wire, so the next person greps, finds it, and reasons about
// a code path that no longer runs. Enabling these made the compiler enumerate all 515 instances, and
// triaging them found three real (if latent) problems that were invisible while the noise was tolerated --
// see this commit's message. Unused PARAMETERS are positional, so silence one with a leading underscore
// (`_unusedArg`), which tsc honours by design; never delete it, or every later argument silently re-binds.
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
// CI caches this across runs (validate-code job) to cut typecheck time on an unchanged/mostly-unchanged
// tree -- measured ~13.5s cold vs ~3.6s warm locally. Correctness is unaffected: tsc verifies each file's
// content hash before trusting the cached state, so a fresh checkout's reset mtimes can't cause a false
// cache hit.
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo"
},
"include": ["src", "test", "scripts/check-engine-parity.ts", "worker-configuration.d.ts", "vitest.config.ts", "vitest.workers.config.ts", "drizzle.config.ts"]
}