UNPKG

1.85 kBMarkdownView Raw
1# Prop-replace
2[![Build Status](https://travis-ci.org/vichu1988/move-prop-types.svg?branch=master)](https://travis-ci.org/vichu1988/move-prop-types)
3
4Simple way to refactor your code to use the new prop-types package that has been separated out of the core react package.
5
6## Why
7
8I was helping with a couple of humongous projects to audit and clean up the code and that was the n-th time i saw a project started about an year ago or so where prop type check was still done from React core package.
9The movement of prop-types from `react` to `prop-types` is as mundane a task possible and that was a reason to write a simpler way of getting the code updated.
10
11## Usage
12
13```bash
14 Usage: move-prop-types|mpt [options] [file|folder]
15
16
17 Options:
18
19 -V, --version output the version number
20 -I, --install install the latest proptypes and then continue with rest of the commands
21 -P, --path input path information of the file to update
22 -F, --folder input folder info where all the files would be updated
23 -h, --help output usage information
24```
25
26## Examples
27
28To install globally, run
29
30 npm i -g move-prop-types
31
32and now you should be able to run the package via `move-prop-types` or `mpt` and for single files by invoking
33
34 mpt -P <folder>/<filename>.<ext>
35
36,currently supports usage on .js or .jsx files. For folder level usage, try using
37
38 mpt -F <folder>
39
40If you feel lazy and lucky, try using `-I` in the command and we install `prop-types` for you in your project for you. :)
41
42## Issues
43Please do share your comments as well comments and do raise issues for any specific requests or bugs you face.
44
45### Backlog
46* test cases for the code
47* implement es5 support
48* refactor code in a more efficient way.
49
50
51## License
52Prop-replace is released under MIT license.
53[LICENSE](LICENSE)