JoshuaKGoldberg/TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫

TypeScript

2,253

2,151 commits

updated Oct 9, 2026

See the code

README

TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫

πŸ‘ͺ All Contributors: 15 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

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 --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.

Configuration

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

  1. Usage.md for an explanation of how TypeStat works
  2. Fixes.md for the type of fixes TypeStat will generate mutations for
  3. Cleanups.md for the post-fix cleaning TypeStat may apply to files
  4. Types.md for configuring how to work with types in mutations
  5. Filters.md for using tsquery to ignore sections of source files
  6. 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.

conversion
javascript
mutations
static-analysis
typescript

JoshuaKGoldberg/TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫

TypeScript

2,253

2,151 commits

updated Oct 9, 2026

See the code

README

TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫

πŸ‘ͺ All Contributors: 15 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

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 --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.

Configuration

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

  1. Usage.md for an explanation of how TypeStat works
  2. Fixes.md for the type of fixes TypeStat will generate mutations for
  3. Cleanups.md for the post-fix cleaning TypeStat may apply to files
  4. Types.md for configuring how to work with types in mutations
  5. Filters.md for using tsquery to ignore sections of source files
  6. 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.

conversion
javascript
mutations
static-analysis
typescript

Project health

Overall

5.8/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Latest release

0.8.18 Β· Feb 25, 2025

Releases this year

0

Significant stargazers

(top 24 of 45)

Anthony Fu

40,401 followers Β· starred Aug 2023

Hiroki Osame

3,979 followers Β· starred Aug 2023

Tom MacWright

3,743 followers Β· starred Apr 2025

Simon Lydell

576 followers Β· starred Aug 2022