babel-plugin-transform-react-remove-prop-types
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -33,2 +33,11 @@ 'use strict'; | ||
if (state.opts.plugins) { | ||
var pluginsVisitors = state.opts.plugins.map(function (pluginName) { | ||
var plugin = require(pluginName); | ||
return plugin({ template: template, types: types }).visitor; | ||
}); | ||
programPath.traverse(_babelTraverse.visitors.merge(pluginsVisitors)); | ||
} | ||
// On program start, do an explicit traversal up front for this plugin. | ||
@@ -146,2 +155,4 @@ programPath.traverse({ | ||
var _babelTraverse = require('babel-traverse'); | ||
var _isAnnotatedForRemoval = require('./isAnnotatedForRemoval'); | ||
@@ -161,2 +172,5 @@ | ||
// weak | ||
/* eslint-disable global-require, import/no-dynamic-require */ | ||
function isPathReactClass(path) { | ||
@@ -174,3 +188,3 @@ if (path.matchesPattern('React.Component') || path.matchesPattern('React.PureComponent')) { | ||
return false; | ||
} // weak | ||
} | ||
@@ -177,0 +191,0 @@ function isReactClass(superClass, scope) { |
{ | ||
"name": "babel-plugin-transform-react-remove-prop-types", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Remove unnecessary React propTypes from the production build", | ||
@@ -32,3 +32,5 @@ "main": "lib/index.js", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"babel-traverse": "^6.24.1" | ||
}, | ||
"devDependencies": { | ||
@@ -38,2 +40,4 @@ "babel-cli": "^6.22.2", | ||
"babel-eslint": "^7.1.1", | ||
"babel-plugin-flow-react-proptypes": "^2.1.3", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
@@ -40,0 +44,0 @@ "babel-preset-react": "^6.22.0", |
// @flow weak | ||
/* eslint-disable global-require, import/no-dynamic-require */ | ||
import { visitors } from 'babel-traverse'; | ||
import isAnnotatedForRemoval from './isAnnotatedForRemoval'; | ||
@@ -77,2 +79,11 @@ import isStatelessComponent from './isStatelessComponent'; | ||
if (state.opts.plugins) { | ||
const pluginsVisitors = state.opts.plugins.map((pluginName) => { | ||
const plugin = require(pluginName); | ||
return plugin({ template, types }).visitor; | ||
}); | ||
programPath.traverse(visitors.merge(pluginsVisitors)); | ||
} | ||
// On program start, do an explicit traversal up front for this plugin. | ||
@@ -79,0 +90,0 @@ programPath.traverse({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31120
654
1
20
2
+ Addedbabel-traverse@^6.24.1
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedbabel-code-frame@6.26.0(transitive)
+ Addedbabel-messages@6.23.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedbabel-traverse@6.26.0(transitive)
+ Addedbabel-types@6.26.0(transitive)
+ Addedbabylon@6.18.0(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedglobals@9.18.0(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedinvariant@2.2.4(transitive)
+ Addedjs-tokens@3.0.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedms@2.0.0(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedto-fast-properties@1.0.3(transitive)