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

ESLint plugin to prevent use of extended native objects

  • 0.7.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
152K
increased by26.31%
Maintainers
1
Weekly downloads
 
Created

What is eslint-plugin-no-use-extend-native?

The eslint-plugin-no-use-extend-native package is an ESLint plugin that helps developers avoid using extended native objects. It ensures that code does not extend or modify native objects like Array, Object, etc., which can lead to unpredictable behavior and maintenance issues.

What are eslint-plugin-no-use-extend-native's main functionalities?

Prevent extending native objects

This feature prevents developers from adding custom methods to native objects like Array. The code sample shows an attempt to add a custom method to Array.prototype, which would be flagged by the plugin.

/* eslint no-use-extend-native/no-use-extend-native: 2 */

Array.prototype.customMethod = function() {
  // some custom logic
};

Prevent modifying native object prototypes

This feature ensures that developers do not modify the prototypes of native objects like Object. The code sample demonstrates an attempt to add a custom property to Object.prototype, which would be flagged by the plugin.

/* eslint no-use-extend-native/no-use-extend-native: 2 */

Object.prototype.customProperty = 'customValue';

Other packages similar to eslint-plugin-no-use-extend-native

Keywords

FAQs

Package last updated on 07 Aug 2024

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

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