build(typescript): move root project references into tsconfig.typecheck.json

Merged
TH
8d ago
+72-64

Summary

fallow ≥3.20 walks the root tsconfig's references on every import. Since #3289 gave the root tsconfig 28 references, every fallow gate has slowed down: on CI, "Run Fallow audit" went from 6–9s to 440–850s.

This PR moves the references into tsconfig.typecheck.json, which extends tsconfig.json and is now what pnpm typecheck builds with tsc -b. extends does not inherit references, so fallow, freerange, editors and tsdown now read a reference-free root config. The scripts/freerange/tsconfig.json wrapper existed only to hide the references from freerange, so it is deleted. A test pins that tsconfig.json has no references. 6 files changed.

Going back to fallow 3.19 was rejected. Its --fail-on-issues exits 0 on warn findings (checked with a planted unused export), and on main it reports 79 unused production exports where 3.32 reports 0.

Validation

Tested at 590448070a.

  • Typecheck: tsc -b --verbose builds the same 30 projects, and --listFiles gives the same 16,156 files. Errors planted in a package, in src/ and in test/ are all caught.
  • fallow output: identical JSON before and after for dead-code, production-exports, health (with and without --coverage/--diff-stdin) and audit --base. Only the entry-point bookkeeping differs, by +1 for the new tsconfig.
  • Cold local timings (12-core Mac):
commandbasehead
dead-code10.0–11.9s2.0–2.3s
production-exports3.4–4.5s0.9–1.1s
health with coverage10.0–12.8s2.3–2.4s
audit --base15.6–30.6s5.9–7.9s
  • freerange: run from the root, 0 findings in 111s.
  • pnpm check:affected --run: passed except daemon-client-transport.test.ts > auto health probing…, a timing test that failed while a Rust build loaded the machine. It passed 3 of 3 runs alone.
  • Risk: on this PR, audit --base still analyses the base with references, so the full CI gain shows on PRs opened after this merges.