Awesome
<h1 align="center">TypeStat</h1> <p align="center">Converts JavaScript to TypeScript and TypeScript to better TypeScript. ๐งซ</p> <p align="center"> <!-- prettier-ignore-start --> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <a href="#contributors" target="_blank"><img alt="๐ช All Contributors: 12" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-12-21bb42.svg" /></a> <!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- prettier-ignore-end --> <a href="https://github.com/JoshuaKGoldberg/TypeStat/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="๐ค Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a> <a href="https://codecov.io/gh/JoshuaKGoldberg/TypeStat" target="_blank"><img alt="๐งช Coverage" src="https://img.shields.io/codecov/c/github/JoshuaKGoldberg/TypeStat?label=%F0%9F%A7%AA%20coverage" /></a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/blob/main/LICENSE.md" target="_blank"><img alt="๐ License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"></a> <a href="http://npmjs.com/package/typestat"><img alt="๐ฆ npm version" src="https://img.shields.io/npm/v/typestat?color=21bb42&label=%F0%9F%93%A6%20npm" /></a> <img alt="๐ช TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" /> </p>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:
<ul style="list-style-type:none;padding-left:1rem;"> <li>โจ Convert JavaScript files to TypeScript in a single bound!</li> <li>โจ Add TypeScript types on files freshly converted from JavaScript to TypeScript!</li> <li>โจ Infer types to fix <code>--noImplicitAny</code> and <code>--noImplicitThis</code> violations!</li> <li>โจ Annotate missing <code>null</code>s and <code>undefined</code>s to get you started with <code>--strictNullChecks</code>!</li> </ul>โก 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
<!-- spellchecker: disable --> <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://sourcegraph.com/"><img src="https://avatars.githubusercontent.com/u/1646931?v=4?s=100" width="100px;" alt="Beyang Liu"/><br /><sub><b>Beyang Liu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=beyang" title="Code">๐ป</a></td> <td align="center" valign="top" width="14.28%"><a href="https://danstiner.me/"><img src="https://avatars.githubusercontent.com/u/52513?v=4?s=100" width="100px;" alt="Daniel Stiner"/><br /><sub><b>Daniel Stiner</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Adanstiner" title="Bug reports">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/ghost"><img src="https://avatars.githubusercontent.com/u/10137?v=4?s=100" width="100px;" alt="Deleted user"/><br /><sub><b>Deleted user</b></sub></a><br /><a href="#maintenance-ghost" title="Maintenance">๐ง</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/emday4prez"><img src="https://avatars.githubusercontent.com/u/35363144?v=4?s=100" width="100px;" alt="Emerson"/><br /><sub><b>Emerson</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=emday4prez" title="Code">๐ป</a></td> <td align="center" valign="top" width="14.28%"><a href="https://girish.netlify.app/"><img src="https://avatars.githubusercontent.com/u/61848210?v=4?s=100" width="100px;" alt="Girish Sontakke"/><br /><sub><b>Girish Sontakke</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=girishsontakke" title="Code">๐ป</a></td> <td align="center" valign="top" width="14.28%"><a href="https://maps.guten.me/"><img src="https://avatars.githubusercontent.com/u/377544?v=4?s=100" width="100px;" alt="Guten"/><br /><sub><b>Guten</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Agutenye" title="Bug reports">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://stackoverflow.com/users/5494094/ibrahim-h"><img src="https://avatars.githubusercontent.com/u/1217741?v=4?s=100" width="100px;" alt="Ibrahim H."/><br /><sub><b>Ibrahim H.</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=bitsnaps" title="Code">๐ป</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg โจ"/><br /><sub><b>Josh Goldberg โจ</b></sub></a><br /><a href="#maintenance-JoshuaKGoldberg" title="Maintenance">๐ง</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">๐</a> <a href="#tool-JoshuaKGoldberg" title="Tools">๐ง</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=JoshuaKGoldberg" title="Code">๐ป</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">๐</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=JoshuaKGoldberg" title="Documentation">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/markjm-1/"><img src="https://avatars.githubusercontent.com/u/16494982?v=4?s=100" width="100px;" alt="Mark Molinaro"/><br /><sub><b>Mark Molinaro</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Amarkjm" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=markjm" title="Code">๐ป</a></td> <td align="center" valign="top" width="14.28%"><a href="https://cress.soc.surrey.ac.uk/web/people/ngilbert"><img src="https://avatars.githubusercontent.com/u/1449986?v=4?s=100" width="100px;" alt="Nigel Gilbert"/><br /><sub><b>Nigel Gilbert</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Amicrology" title="Bug reports">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://orionna.me/"><img src="https://avatars.githubusercontent.com/u/85230052?v=4?s=100" width="100px;" alt="orionna319"/><br /><sub><b>orionna319</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Aorionna319" title="Bug reports">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/rubiesonthesky"><img src="https://avatars.githubusercontent.com/u/2591240?v=4?s=100" width="100px;" alt="rubiesonthesky"/><br /><sub><b>rubiesonthesky</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Arubiesonthesky" title="Bug reports">๐</a> <a href="#maintenance-rubiesonthesky" title="Maintenance">๐ง</a> <a href="#tool-rubiesonthesky" title="Tools">๐ง</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=rubiesonthesky" title="Code">๐ป</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=rubiesonthesky" title="Tests">โ ๏ธ</a></td> </tr> </tbody> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END --> <!-- spellchecker: enable -->๐ This package is based on @JoshuaKGoldberg's TypeStat.