Use case
Framework
Owner
React/Create Element To Jsx
This codemod transforms React.createElement calls into JSX syntax, making your code more readable and maintainable.
React/Update React Imports
This codemod transforms React imports to use named imports instead of default or namespace imports. This helps reduce bundle size by allowing better tree-shaking of unused React exports.
TypeScript/V5.6/Arrow Function Condition To Binary Expression
Identify cases where an arrow function is mistakenly used instead of a comparison operator (e.g., x => 0 instead of x >= 0) and convert the arrow function expressions to proper comparison operations.
TypeScript/V5.6/Add Test For Regex In Conditional
Add .test() to regex literals in conditionals
E18e Module Replacements Recipe
This recipe has 150+ codemods in this repo: https://github.com/es-tooling/module-replacements-codemods
React/19/Migration Recipe
This recipe is a set of codemods that will fix some of React 19 breaking changes.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Msw/2/Upgrade Recipe
This recipe is a set of codemods that will upgrade your project from using msw v1 to v2.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React/19/Replace Create Factory
Replaces deprecated
React.createFactory
method with JSX.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Use History Hook
Run this codemod to deprecate
browserHistory
and use history fromuseHistory
hook instead.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Replace Param Prop
Replaces
params
prop passed by react-router withmatch.params
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Replace Nested Routes
Run this codemod to deprecate nested components through the use of
render
prop of the parent component.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Replace Location Query
This codemod replaces instances of
location.query
withparse(location.search)
, whereparse
is a function imported fromquery-string
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Rename Imports
Replace
react-router
import source withreact-router-dom
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Index Route
Replace
IndexRoute
withRoute
havingexact
prop set totrue
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Hash Router
Run this codemod to replace
Router
usinghashHistory
toHashRouter
in v4.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Browser Router
Run this codemod to replace
Router
usingbrowserHistory
toBrowserRouter
in v4.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
React Router/4/Add Exact Prop
Add
exact
prop to all instances ofRoute
component.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community