Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Converts JavaScript to TypeScript and TypeScript to better TypeScript.

Code Style: Prettier TypeScript: Strict Build Status NPM version

TypeStat logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS'


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 --noImplicitAny and --noImplicitThis violations!
  • Annotate missing nulls and undefineds 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.


To get a deeper understanding of TypeStat, read the following docs pages in order:

  1. for an explanation of how TypeStat works
  2. for the type of fixes TypeStat will generate mutations for
  3. for the post-fix cleaning TypeStat may apply to files
  4. for configuring how to work with types in mutations
  5. for using tsquery to ignore sections of source files
  6. Custom for including or creating custom mutators


See 💖