babel-plugin-transform-react-remove-prop-types
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -43,6 +43,6 @@ 'use strict'; | ||
if (node.key.name === 'propTypes') { | ||
var className = scope.block.id.name; | ||
var binding = scope.getBinding(className); | ||
var superClass = binding.path.get('superClass'); | ||
var id = scope.block.id; | ||
var superClass = scope.path.get('superClass'); | ||
if (superClass.matchesPattern('React.Component') || superClass.node.name === 'Component') { | ||
@@ -52,4 +52,4 @@ path.remove(); | ||
// Check for inheritance | ||
className = superClass.node.name; | ||
binding = scope.getBinding(className); | ||
var className = superClass.node.name; | ||
var binding = scope.getBinding(className); | ||
superClass = binding.path.get('superClass'); | ||
@@ -56,0 +56,0 @@ |
{ | ||
"name": "babel-plugin-transform-react-remove-prop-types", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Remove unnecessary React propTypes from the production build", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -37,6 +37,6 @@ import isStatelessComponent from './isStatelessComponent'; | ||
if (node.key.name === 'propTypes') { | ||
let className = scope.block.id.name; | ||
let binding = scope.getBinding(className); | ||
let superClass = binding.path.get('superClass'); | ||
const id = scope.block.id; | ||
let superClass = scope.path.get('superClass'); | ||
if (superClass.matchesPattern('React.Component') || | ||
@@ -46,4 +46,4 @@ superClass.node.name === 'Component') { | ||
} else if (superClass.node.name) { // Check for inheritance | ||
className = superClass.node.name; | ||
binding = scope.getBinding(className); | ||
const className = superClass.node.name; | ||
const binding = scope.getBinding(className); | ||
superClass = binding.path.get('superClass'); | ||
@@ -50,0 +50,0 @@ |
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
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
12618
267