Stop Type Erosion: Building a Zero-Dependency Type-Health Auditor for TypeScript
Description and use
Any-Hunter is a zero-dependency tool that audits TypeScript codebases, producing a Type-Health Score (0–100) and SARIF reports, enabling teams to track and mitigate type erosion in CI pipelines.
Problem
TypeScript projects often start with strict typing but over time developers introduce type bypasses (any, @ts-ignore, non-null assertions, unvalidated JSON.parse) leading to type erosion and runtime failures.
Outcome
Teams receive a concrete type health score, actionable SARIF reports, and can enforce type safety thresholds in CI, reducing runtime errors caused by type erosion.
Workflow
- Generate a .anyhunterrc.json with
npx any-hunter --init - Run an audit against tsconfig.json using
npx any-hunter ./tsconfig.json --threshold=85 - Review the Type-Health score and SARIF report
- Add any-hunter-disable-next-line comments for justified exceptions
- Integrate Any-Hunter into CI via a GitHub Actions workflow
Evidence
Any-Hunter approaches typing from an architectural health perspective
Outputs GitHub Step Summaries and standard OASIS SARIF files for GitHub Code Scanning
- Record date: 2026-09-05T18:52:38.631Z