CLI tool to "ratchet" your typescript codebase.
To ratchet is the act of tightening or adjusting something incrementally. In the context of static analysis, it is the process of adding new configurations or rules to your codebase to make it more strict while allowing newly reported issues on existing code and disallowing them on new code.
npx typescript-ratchet
- Runs Typescript to find all problems in your codebase.
- Uses JSCodeshift first to transform your ts/tsx codebase. Adds
@ts-expect-error
comments to AST nodes in error. - Uses ts-morph as a fallback for unsupported Typescript keywords (e.g.
satisfies
) with a simple insert comment line strategy.
- Make sure to backup your code to your VCS of choice before running this tool.
- This tool is in beta and may not work as expected, in that case, feel free to open an issue with steps to reproduce.
- Formatting may be necessary after running these codemods (
prettier
,eslint --fix
).
MIT