Before usage of the codemod you should install jscodeshift first.
-
Clone repo
git clone https://github.com/mikhail-hatsilau/proptypes-to-flow-codemod.git
-
Run
npm install
inside codemod directory -
Run
npm run build
to transpile javascript -
Run
jscodeshift -t proptypes-to-flow-codemod/dist/propsToFlow.js <path>
By default codemod leaves proptypes statements. But you can pass remove-prop-types
option: jscodeshift -t proptypes-to-flow-codemod/dist/propsToFlow.js <path> --remove-prop-types=true
. It will remove proptypes statements and import declaration