Skip to content

perf(hooks): add an opt-in switch to skip builder test files in the type check - #1640

Merged
viethung0o0 merged 1 commit into
mainfrom
perf/hook-skip-test-types
Nov 3, 2026
Merged

viethung0o0 merged 1 commit into
mainfrom
perf/hook-skip-test-types

Conversation

@viethung0o0

@viethung0o0 viethung0o0 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds an opt-in switch for the pre-commit type check: with CHECK_TYPES_SKIP_TESTS=1, the apps/builder check-types script uses a new tsconfig.check.json, which is tsconfig.json without test files.
  • Default behavior is unchanged: the hook still type-checks test files. Developers who want a lighter hook can export the variable in their local shell.
  • With the switch on, a cold builder check goes from about 43s to about 39s, and peak memory from about 6.5 GB to about 5.4 GB.
  • CI is unchanged: it runs turbo run check-types with the full tsconfig.json, so type errors in tests are always caught there.
  • The variable is declared in the builder turbo.json so results with and without it never share a cache entry.
  • This is independent of any TypeScript version upgrade: it only adds a tsconfig and an env switch.

Verification

  • With a deliberate type error in a test file, skip mode passes and the default mode fails as expected.
  • Not measured: the effect on the worker type check, which is unchanged.

Related to #1620

- The hook sets CHECK_TYPES_SKIP_TESTS so builder checks tsconfig.check.json
- CI still type-checks the full program, including tests
- Cold check drops from 43s to 39s and from 6.5 GB to 5.4 GB peak memory
@github-actions github-actions Bot added the improvement Refactor or performance improvement label Nov 3, 2026
@viethung0o0
viethung0o0 marked this pull request as ready for review November 3, 2026 11:34
@viethung0o0
viethung0o0 merged commit e037e73 into main Nov 3, 2026
15 checks passed
@viethung0o0 viethung0o0 changed the title perf(hooks): skip builder test files in the pre-commit type check perf(hooks): add an opt-in switch to skip builder test files in the type check Nov 3, 2026
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Refactor or performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants