You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add TypeScript type checking to pre-commit or CI #1202
TypeScript type errors in the frontend can slip through to CI/Netlify builds because there is no local type checking step. The current .pre-commit-config.yaml excludes ui/ entirely (line 1: exclude: "^docs/|/migrations/|ui/"), and we only run prettier formatting checks in CI, not tsc.
This was exposed in PR #1198 where a type mismatch (null added to one interface but not a dependent one) passed local commits and was only caught by the Netlify build.
Proposal
Add tsc --noEmit as a check that runs before code reaches CI. Three approaches, from simplest to fastest:
With Husky managing the git hook from the ui/ directory. This is more standard for JS/TS projects and keeps frontend tooling self-contained, but adds another hook manager alongside pre-commit.
Option C: CI-only check (fastest local workflow)
Add tsc --noEmit as a step in the GitHub Actions / Netlify CI pipeline, separate from the build. Catches errors before deploy without slowing local commits. Downside: errors are caught later in the feedback loop.
Notes
tsc --noEmit cannot meaningfully check a subset of files — TypeScript's type system is whole-program, so a change in file A can cause errors in file B through imported types
Current tsc --noEmit takes ~10s on this project
The existing Netlify build already catches these errors, but the feedback loop is slow (~2-3 min)
Good idea! Could be nice to separate type checks from the build step.
I vote fore option C, I'm personally not a big fan of pre-commit hooks, I feel they interrupt my workflow a bit. I like direct feedback in my editor better, together with the more complete CI checks :) But I also don't mind them too much, so I could adjust.
Thanks for looking at this! I guess I use a variety of editors and not always a full IDE. Lately I have been pushing a few changes with type issues that only get caught when Netlify tries to build the deploy preview, which makes for a long development cycle. If there is a fast check that can be added pre-push that is helpful for reducing build minutes (and energy!) in the GitHub CI actions. But the new CI check you added should help speed that up. I can try to remember to run it manually before pushing too.
Activity
annavik commentedon Apr 3, 2026
Good idea! Could be nice to separate type checks from the build step.
I vote fore option C, I'm personally not a big fan of pre-commit hooks, I feel they interrupt my workflow a bit. I like direct feedback in my editor better, together with the more complete CI checks :) But I also don't mind them too much, so I could adjust.
I opened a PR for the CI part: #1207
mihow commentedon Apr 3, 2026
Thanks for looking at this! I guess I use a variety of editors and not always a full IDE. Lately I have been pushing a few changes with type issues that only get caught when Netlify tries to build the deploy preview, which makes for a long development cycle. If there is a fast check that can be added pre-push that is helpful for reducing build minutes (and energy!) in the GitHub CI actions. But the new CI check you added should help speed that up. I can try to remember to run it manually before pushing too.