TypeStat
Converts JavaScript to TypeScript and TypeScript to better TypeScript. ๐งซ
Install / Use
/learn @JoshuaKGoldberg/TypeStatREADME
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://github.com/LorenVS"><img src="https://avatars.githubusercontent.com/u/528200?v=4?s=100" width="100px;" alt="Loren Van Spronsen"/><br /><sub><b>Loren Van Spronsen</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=lorenvs" title="Code">๐ป</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="http://community.haskell.org/~pj"><img src="https://avatars.githubusercontent.com/u/2082449?v=4?s=100" width="100px;" alt="Peter A. Jonsson"/><br /><sub><b>Peter A. Jonsson</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Apjonsson" title="Bug reports">๐</a> <a href="https://github.com/JoshuaKGoldberg/TypeStat/commits?author=pjonsson" title="Code">๐ป</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/AjiTae"><img src="https://avatars.githubusercontent.com/u/2207245?v=4?s=100" width="100px;" alt="ajitae"/><br /><sub><b>ajitae</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/TypeStat/issues?q=author%3Aajitae" 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> </tr> <tr> <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 -->๐ Thi
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
83.9kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
review-duplication
99.3kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
