Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

react-proptypes-generate

1.3.0 • Public • Published

react-proptypes-generate npm version

This is the VS Code's extension that automatically generates PropTypes code for React components, like ReactPropTypes in the Jetbrains's Platform

Installation

VS Code

Search react-proptypes-generate in Marketplace and install it

Command Line

npm install react-proptypes-generate -g

Usage

VS Code

  1. Select your Component's name
  2. Press command + . (Windows is Ctrl + .) show Code Actions and select PropTypesGenerate, or press shift + command + alt + P (Windows is shift + ctrl + alt + P) in the macOS
  3. Input propType to replace default type

img

Command Line

  1. rpg-cli -h show Help
  2. rpg-cli <JsFilePath> <ComponentName> to generate PropTypes
  3. rpg-cli -c <JsonFilePath> to config Command Line Settings

Extension Settings

This extension contributes the following settings:

  • propTypes.autoImport: set auto import or require PropTypes module(disabled|commonJS|ES6)
  • propTypes.codeStyle: set the PropTypes Generate Style(default|class)

Command Line Settings

Command Line can config the following settings:

  • autoImport: set auto import or require PropTypes module(disabled|commonJS|ES6)
  • codeStyle: set the PropTypes Generate Style(default|class)

Release Notes

V1.0

  1. Support VS Code and Command Line
  2. Support Auto Generate Code

V1.1

  1. Support Config Code Style
  2. Support Config Auto Import
  3. Fixed a bug about Windows OS CRLF

V1.2

  1. Support Pure Function Component
  2. Support ObjectPattern in the Pure Function Component
  3. Fixed a bug that have are multiple component in a file

V1.3

  1. Support Pure ArrowFunction Component

Install

npm i react-proptypes-generate

DownloadsWeekly Downloads

16

Version

1.3.0

License

MIT

Unpacked Size

47.8 kB

Total Files

27

Last publish

Collaborators

  • avatar