Freerange is a static analysis tool for TypeScript that tracks the numeric range of variables to prevent runtime errors like division by zero, NaN, and out-of-bounds array indexing. It operates at compile time using the official TypeScript API without requiring new syntax, annotations, or language forks.
Highlights
Detects numeric errors such as NaN, Infinity, and division by zero during the build process
Uses the official TypeScript API to ensure compatibility without requiring a new language
Designed for high performance with negligible impact on TypeScript analysis time
Includes an audit mode to provide refactor suggestions that make code more analysis-friendly
Optimized for use by AI agents to guarantee UI layouts and refactor code automatically