New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

babel-plugin-styled-require

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-styled-require

Babel plugin that adds Styled from styled components import declaration if file contains JSX tags.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-proptypes-require

Babel plugin that adds PropTypes import declaration if file contains JSX tags.

Example

Your component.js that contains this code:

export default function Component() {
  return <div />;
}

will be transpiled into something like this:

import PropTypes from 'prop-types';

export default function Component() {
  /* this part will be transpiled by babel itself as usual */
  return React.createElement('div');
}

Usage

  • Install babel-plugin-proptypes-require.
npm install babel-plugin-proptypes-require --save-dev
  • Add proptypes-require into .babelrc. This plugin should be defined before transform-es2015-modules-commonjs plugin because it's using ES2015 modules syntax to import React into scope.
{
  "plugins": ["proptypes-require"]
}

Keywords

babel

FAQs

Package last updated on 15 Aug 2019

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