Problem
home-tool compiles each module through ts_driver.compileSource, which runs the full checker, then keeps only the .js and discards the diagnostics — paying for type checking with no benefit. The Bun-port runtime path skips types entirely. The engine should be able to guarantee it only executes well-typed code.
Evidence (origin/main @ d4b219507)
packages/runtime/src/jsc/tool_main.zig:25-37packages/runtime/src/jsc/tool_modules.zig:170-185packages/runtime/src/js_parser/parse/parse_skip_typescript.zig:1-30
Scope
- Add
--check(and a bunfig/home config key) that type-checks the module graph before execution and exits non-zero on errors. - Without
--check, passno_checkso the checker phase does not run at all. - In sound mode,
--checkalso enforces the sound-mode rules.
Acceptance criteria
home run --check bad.tsexits 1 and prints TS diagnostics; nothing executes.- Without the flag, a profile shows no checker phase.
- Checked results are cached per file hash so repeated runs are cheap.