-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.typecheck.json
More file actions
46 lines (46 loc) · 2.35 KB
/
Copy pathtsconfig.typecheck.json
File metadata and controls
46 lines (46 loc) · 2.35 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
45
46
{
// Source-health typecheck. Identical compiler options to tsconfig.json, but it
// never reads Next's generated route types under `.next/`.
//
// Why this file exists (see docs/outstanding-issues.md #210): the base config
// includes `.next/types/**/*.ts` and `.next/dev/types/**/*.ts`, which are
// gitignored build artifacts. Delete or rename a page — a mockup route, most
// often — and the stale generated validator still imports the removed module,
// so `npm run typecheck` reports errors that no longer exist in source. CI
// never sees it (fresh checkout, no `.next`), so the gate reads as red locally
// and green in CI, and gets abandoned. A permanently-red gate is why real type
// errors reach CI instead of being caught before push.
//
// Route-signature validation is NOT lost: `next build` (CI's Build job) still
// typechecks the generated types against the real routes. This config answers
// the narrower question the pre-push guard needs — "is the source itself
// sound?" — deterministically, without depending on build-artifact freshness.
//
// Incremental cache: pin a distinct buildinfo so a direct
// `tsc -p tsconfig.typecheck.json` does not collide with the base config's
// `tsconfig.tsbuildinfo` (extends inherits that path and TypeScript discards
// the cache when root-file sets differ). `scripts/run-heavy.mjs` still
// injects a per-worktree `--tsBuildInfoFile` under tmp for
// `typecheck:source:internal`, which overrides this pin across shared
// node_modules checkouts.
"extends": "./tsconfig.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsc/tsconfig.typecheck.tsbuildinfo"
},
// `next-env.typecheck.d.ts` stands in for `next-env.d.ts`, which Next 16
// regenerates with `import "./.next/dev/types/routes.d.ts"` in it. An
// `exclude` cannot drop a file that an included file imports, so that one line
// silently reinstated the `.next` dependency this config exists to remove.
// `next-env.d.ts` is excluded explicitly because `**/*.ts` matches `.d.ts`
// too, so dropping it from `include` alone would not keep it out.
"include": ["next-env.typecheck.d.ts", "**/*.ts", "**/*.tsx", "**/*.mts"],
"exclude": [
"node_modules",
".next/**",
"next-env.d.ts",
"scratch/**",
"supabase/functions/**",
"worktrees/**",
"scripts/archive/**"
]
}