Socket
Book a DemoInstallSign in
Socket

babel-plugin-remove-proptypes

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-remove-proptypes

Remove static declarations of React propTypes

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

babel-plugin-remove-proptypes

Babel plugin for removing static declarations of React propTypes on classes.

Input:

// MyComponent extends React.Component
MyComponent.propTypes = {
  someString: React.PropTypes.string.isRequired,
  someBoolean: React.PropTypes.bool
};

Output:

// Does not contain any propTypes declarations

The plugin can be used to remove PropTypes from production environments, where they have no effect.

Installation

$ npm install babel-plugin-remove-proptypes

Usage

Via .babelrc

{
  "plugins": ["remove-proptypes"]
}

Via CLI

$ babel --plugins remove-proptypes script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['remove-proptypes']
});

Keywords

babel-plugin

FAQs

Package last updated on 11 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts