README.md
May 5, 2026 ยท View on GitHub
TypeStat
Converts JavaScript to TypeScript and TypeScript to better TypeScript. ๐งซ
Usage
TypeStat is a CLI utility that modifies TypeScript types in existing code. The built-in mutators will only ever add or remove types and will never change your runtime behavior. TypeStat can:
- โจ Convert JavaScript files to TypeScript in a single bound!
- โจ Add TypeScript types on files freshly converted from JavaScript to TypeScript!
- โจ Infer types to fix
--noImplicitAnyand--noImplicitThisviolations! - โจ Annotate missing
nulls andundefineds to get you started with--strictNullChecks!
โก To start, the typestat command will launch an interactive guide to setting up a configuration file. โก
npx typestat
๐ Welcome to TypeStat! ๐ This will create a new typestat.json for you. ...
After, use typestat --config typestat.json to convert your files.
Configuration
To get a deeper understanding of TypeStat, read the following docs pages in order:
- Usage.md for an explanation of how TypeStat works
- Fixes.md for the type of fixes TypeStat will generate mutations for
- Cleanups.md for the post-fix cleaning TypeStat may apply to files
- Types.md for configuring how to work with types in mutations
- Filters.md for using tsquery to ignore sections of source files
- Custom Mutators.md for including or creating custom mutators
Development
See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md for general tooling documentation.
For understanding the project, see ./docs in general, and especially ./docs/Architecture.md.
Thanks! ๐
Contributors
๐ This package is based on @JoshuaKGoldberg's TypeStat.