Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-no-use-extend-native

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-use-extend-native - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc