Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flow/flow-codemod
Flow codemod scripts
https://github.com/flow/flow-codemod
Last synced: 3 months ago
JSON representation
Flow codemod scripts
- Host: GitHub
- URL: https://github.com/flow/flow-codemod
- Owner: flow
- License: mit
- Archived: true
- Created: 2016-06-01T00:11:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-15T15:19:18.000Z (over 5 years ago)
- Last Synced: 2024-05-21T13:55:49.560Z (9 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 15
- Watchers: 8
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-codemods - flow-codemod - Jscodeshift-powered [email protected] to [email protected] transformations . (Misc / ant-design)
README
# flow-codemod
This repository contains a collection of codemod scripts for use with
[JSCodeshift](https://github.com/facebook/jscodeshift) that help update
Flowified JS code.### Setup & Run
* `npm install -g jscodeshift`
* `git clone https://github.com/flowtype/flow-codemod.git`
* `jscodeshift -t `
(but note that individual transforms may require additional options, as documented)
* Use the `-d` option for a dry-run and use `-p` to print the output for comparison##### KNOWN ISSUES
* jscodeshift currently uses Babel 5, which fails to parse certain JS idioms.
Files that fail to parse will not be transformed, unfortunately.### Included Scripts
The following codemods can be found under the `transforms` directory:
#### `strict-type-args`
Adds explicit arguments to polymorphic type application expressions,
based on errors from Flow. For example,```
let map: Map = ...
```...becomes
```
let map: Map = ...
```This prepares code for an upcoming change to strict type argument processing. For instructions and more info, see documentation in the transform subdirectory.
## License
flow-codemod is MIT licensed, as found in the [LICENSE](LICENSE) file.