eslint-plugin-no-use-extend-native
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "eslint-plugin-no-use-extend-native", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "ESLint plugin to prevent use of extended native objects", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -52,2 +52,4 @@ 'use strict'; | ||
proto = binaryExpressionProduces(node.object); | ||
} else if (node.object.type === 'Identifier') { | ||
proto = node.object.name; | ||
} else { | ||
@@ -60,2 +62,7 @@ proto = node.object.type.replace('Expression', ''); | ||
if (methodName === 'prototype') { | ||
// Array.prototype.map, etc. | ||
methodName = node.parent.property.name; | ||
} | ||
if (!isJsType(proto)) { | ||
@@ -66,3 +73,4 @@ return; | ||
if (type === 'ExpressionStatement' && !isGetSetProp(proto, methodName) && !isProtoProp(proto, methodName) || | ||
type === 'CallExpression' && (isGetSetProp(proto, methodName) || !isProtoProp(proto, methodName))) { | ||
type === 'CallExpression' && (isGetSetProp(proto, methodName) || !isProtoProp(proto, methodName)) || | ||
type === 'MemberExpression' && !isProtoProp(proto, methodName)) { | ||
context.report(node, 'Avoid using extended native objects'); | ||
@@ -69,0 +77,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
7112
73