Type Checking
GitAuto runs static type checking on generated code to catch type errors before committing. For example, for TypeScript projects it runs tsc --noEmit with smart config selection, preferring test-specific configs like tsconfig.test.json when available and using --incremental false to avoid stale cache errors.
Type Errors Waste Review Cycles
Type errors in generated tests are common. Catching them before committing saves human reviewers from having to diagnose and fix type mismatches themselves.
Without this step, a PR might contain test files that look correct but fail type checking in CI, requiring another round of iteration just to fix types.
Why Models Produce Type Errors
Models reason about types conceptually but don't run a type checker. A model "knows" that a function returns a string, but it can't verify that the actual TypeScript compiler agrees. Complex type interactions - generics, conditional types, overloads - are especially prone to errors because the model is pattern-matching, not type-checking. Code generation benchmarks primarily test Python and JavaScript - languages with weaker type systems. TypeScript's strict type checking is underrepresented in training and evaluation, so models are less practiced at getting complex types right.
How It Works
GitAuto detects the project's type system and runs the appropriate checker. For example, for TypeScript it searches for test-specific configs in priority order: tsconfig.test.json, tsconfig.jest.json, tsconfig.vitest.json, then falls back to the default tsconfig.json. It runs tsc --noEmit --incremental false with the selected config to avoid picking up stale build info from previous runs.
The output is filtered to remove errors from node_modulessince those are third-party type issues outside GitAuto's control. Only errors in the generated files and project source are reported back to the agent for correction.
Related Features
- Linting - catches code quality issues that type checking does not cover
- Test Execution - verifies runtime behavior after type checking passes
Need Help?
Have questions or suggestions? We're here to help you get the most out of GitAuto.
Contact us with your questions or feedback!