C

msw/2/type-args

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

There is a change to generic type interface of rest.method() calls. This codemod puts the generic arguments in the correct order to keep type safety.

WARNING

This codemod runs .fixUnusedIdentifiers() on a target source file. This would remove any unused declarations in the file. This is due to the atomicity of this codemod, which blindly inserts the callback structure into each msw handler callback and then cleans up the variables that are not used anymore.

Before

ts

After

ts

Before

ts

After

ts

Before

ts

After

ts

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.