Experimental
This repository contains a collection of codemod scripts for use with JSCodeshift that help update Kdu.js APIs.
Inspired by react-codemod.
npx kdu-codemod <path> -t <transformation> --params [transformation params] [...additional options]
transformation
(required) - name of transformation, see available transformations below; or you can provide a path to a custom transformation module.path
(required) - files or directory to transform.--params
(optional) - additional transformation specific args.
runTransformation(fileInfo, transformation, params)
See https://github.com/facebook/jscodeshift#transform-module
- Running transformations will generally ruin the formatting of your files. A recommended way to solve that problem is by using Prettier or
eslint --fix
. - Even after running prettier its possible to have unnecessary new lines added/removed. This can be solved by ignoring white spaces while staging the changes in git.
git diff --ignore-blank-lines | git apply --cached