Skip to content

react native codemod scripts by NetEase Cloud Music team

Notifications You must be signed in to change notification settings

x-orpheus/mrn-codemod

Repository files navigation

MRN-CODEMOD

coverage report pipeline status

Description

Codemod for updateing ReactNative projects by NetEase Cloud Music team

Usage

mrn-codemod transform [options] <sourceDirectory>
Commands:
  transform [options] <sourceDirectory>
  
    --f Bypass Git safety checks and forcibly run codemods

Examples:
  $ mrn-codemod transform src
  $ mrn-codemod transform src -f

Included Transform Rules

Navigator

  • replace Navigator with react-native-deprecated-custom-components
  • Navigator.props.sceneStyle must be a plain object, not a stylesheet!

ChangeLog Source

Image.resizeMode

  • Stop expose Image.resizeMode. Exposing this enum is essentially useless and at worst is a runtime cost that isn't necessary by just using the string.

ChangeLog Source

export-default-declaration

  • Export default declaration cannot be undefined.

ChangeLog Source

image-children

  • Image cannot contain children, instead of ImageBackground.

ChangeLog Source

nest

  • Text cannot contain View.

PropTypes

  • Replaces React.PropTypes references with prop-types.

ChangeLog Source

view-propTypes

  • Replaces View.propTypes references with ViewPropTypes and adds the appropriate import or require statement. This codemod is intended for ReactNative 44+..

ChangeLog Source

About

react native codemod scripts by NetEase Cloud Music team

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published