codemod-proptypes-to-flow

Removes React.PropTypes and attempts to transform to flowtypes

  • 所有者: billyvg/codemod-proptypes-to-flow
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

codemod-proptypes-to-flow Build Status codecov

Removes React.PropTypes and attempts to transform to Flow.

Setup & Run

  • npm install -g jscodeshift
  • git clone https://github.com/billyvg/codemod-proptypes-to-flow
  • jscodeshift -t codemod-proptypes-to-flow/src/index.js <path>
  • Use the -d option for a dry-run and use -p to print the output
    for comparison

Options

Behavior of this codemod can be customized by passing options to jscodeshift e.g.:

jscodeshift -t codemod-proptypes-to-flow/src/index.js --flowComment=line <path>

Following options are accepted:

flowComment

--flowComment=<block, line> - type of flow comment. Defaults to block.

--flowComment=block:  /* @flow */
--flowComment=line:   // @flow
propsTypeSuffix

--propsTypeSuffix=<suffix> - used to customize the type names generated by the codemod. Provided string will be used alone or appended to Component's name when defining props type. Defaults to Props.

Default:

type Props = {...}
type MyComponentProps = {...}

With --propsTypeSuffix=PropsType:

type PropsType = {...}
type MyComponentPropsType = {...}

Not working/Implemented yet

  • Custom validators
  • React.createClass
  • Use of importing PropTypes

Contributors

  • Thanks to @skovhus for adding support for functional components and modernizing the codebase a bit (a lot)

主要指標

概覽
名稱與所有者billyvg/codemod-proptypes-to-flow
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2016-04-21 22:53:50
推送於2018-09-06 21:26:01
最后一次提交2018-07-03 16:03:39
發布數0
用户参与
星數163
關注者數4
派生數28
提交數99
已啟用問題?
問題數10
打開的問題數6
拉請求數12
打開的拉請求數1
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?