flow / flow-codemod

Flow codemod scripts
MIT License
15 stars 3 forks source link

Feature Request: Convert back and forth between normal and comment based syntax #7

Open ssotangkur-kahuna opened 6 years ago

ssotangkur-kahuna commented 6 years ago

Using the standard flowtype syntax in code, severely limits the other codemods that we can use because they cannot parse the flowtype syntax. The Comment Types make it easy for tools unfamiliar w/ the flow syntax to parse your code, however it is quite cumbersome to use compared to the standard syntax. By providing 2 codemods, one in each direction, we can get the best of both worlds. We can continue coding in the standard syntax. If and when we need to run an flowtype unaware codemod, we first convert them to comment-based syntax before passing them through our target codemod, then through the standard based syntax codemod to get us back.