Skip to content

fix(check-types): guard tsc -b against emitting into source tree - #22

Merged
robdmoore merged 1 commit into
mainfrom
fix/check-types-emit-guard
Oct 6, 2026
Merged

robdmoore merged 1 commit into
mainfrom
fix/check-types-emit-guard

Conversation

@PaulRobson

@PaulRobson PaulRobson commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #21.

  • Emit guard: when check-types uses tsc -b, it first reads every config in the reference graph (with extends applied, no file globbing; ~5 ms). If any config with inputs has no noEmit, outDir or outFile, the check fails with the offending configs and the fix, instead of tsc -b writing .js next to the source. The Vite template and composite builds into outDir pass.
  • Malformed tsconfig on Windows: ts.readConfigFile threw an internal Debug Failure on backslash paths when the tsconfig had a syntax error. Paths are now forward-slashed and read errors fall back to tsc --noEmit, so tsc reports the real syntax error.
  • .tsbuildinfo: tsc -b rejects --tsBuildInfoFile/--outDir on the CLI (TS5094), so it can't be suppressed. README and the guard message point to tsBuildInfoFile under node_modules/.tmp.
  • Registry test covers the command being resolved per cwd at eject time.

Verification

  • Scratch project with root include + references and no noEmit: verifyx check-types fails with the message and writes no files (previously wrote src/a.js).
  • Tested against a client project, type check errors are found that were not found before. No new files are created outside of .gitignored directories.

- fail before tsc -b when a config in the reference graph has no noEmit/outDir
- fall back to tsc --noEmit on malformed tsconfig (TS Debug Failure on Windows paths)
- registry test for per-cwd command resolution
- README: tsbuildinfo note
@robdmoore
robdmoore merged commit e9eff65 into main Oct 6, 2026
1 check passed
@robdmoore
robdmoore deleted the fix/check-types-emit-guard branch October 6, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants