# eslint-plugin-no-use-extend-native

> ESLint plugin to prevent use of extended native objects

Latest version **0.7.3** (published 2026-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-no-use-extend-native
pnpm add eslint-plugin-no-use-extend-native
yarn add eslint-plugin-no-use-extend-native
bun add eslint-plugin-no-use-extend-native
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.3 |
| Published | 2026-04-27 |
| First published | 2015-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=18.18.0 |
| Dependencies | 4 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Dustin Specker |
| Maintainers | dustinspecker |
| Keywords | eslint, eslintplugin, eslint-plugin, extend, native, prototype |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-no-use-extend-native
- Repository: https://github.com/dustinspecker/eslint-plugin-no-use-extend-native
- Issues: https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/issues
- npm.io page: https://npm.io/package/eslint-plugin-no-use-extend-native

## Dependencies (4)

- [is-js-type](https://npm.io/package/is-js-type.md) ^3.0.0
- [is-obj-prop](https://npm.io/package/is-obj-prop.md) ^2.0.0
- [is-proto-prop](https://npm.io/package/is-proto-prop.md) ^3.0.1
- [is-get-set-prop](https://npm.io/package/is-get-set-prop.md) ^2.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.7.3 (latest) — 2026-04-27
- 0.7.2 — 2024-08-07
- 0.7.1 — 2024-07-05
- 0.7.0 — 2024-06-04
- 0.6.1 — 2024-05-22
- 0.6.0 — 2024-05-22
- 0.5.0 — 2020-04-11
- 0.4.1 — 2019-06-25
- 0.4.0 — 2018-12-23
- 0.3.12 — 2016-10-30
- 0.3.11 — 2016-10-16
- 0.3.10 — 2016-10-16
- 0.3.9 — 2016-10-16
- 0.3.8 — 2016-08-08
- 0.3.7 — 2016-05-03
- … 17 more at https://npm.io/package/eslint-plugin-no-use-extend-native/versions

## README

# eslint-plugin-no-use-extend-native
[![NPM version](https://badge.fury.io/js/eslint-plugin-no-use-extend-native.svg)](https://badge.fury.io/js/eslint-plugin-no-use-extend-native)
[![Coverage Status](https://coveralls.io/repos/github/dustinspecker/eslint-plugin-no-use-extend-native/badge.svg?branch=main)](https://coveralls.io/github/dustinspecker/eslint-plugin-no-use-extend-native?branch=main)

> ESLint plugin to prevent use of extended native objects

## Install
First, install ESLint via
```
npm install --save-dev eslint
```

Then install eslint-plugin-no-use-extend-native
```
npm install --save-dev eslint-plugin-no-use-extend-native
```

## Usage
In your `eslint.config.js` file add the plugin as such:

```javascript
import eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'

export default [
  {
    plugins: {
      'no-use-extend-native': eslintPluginNoUseExtendNative,
    },
    rules: {
      'no-use-extend-native/no-use-extend-native': 2,
    },
  },
]
```

If you want the default of the single rule being enabled as an error, you can also just use the following instead of
all of the above:

```javascript
import eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'

export default [
  eslintPluginNoUseExtendNative.configs.recommended,
]
```

With this plugin enabled, ESLint will find issues with using extended native objects:
```javascript
import colors from 'colors';
console.log('unicorn'.green);
// => ESLint will give an error stating 'Avoid using extended native objects'

[].customFunction();
// => ESLint will give an error stating 'Avoid using extended native objects'
```

More examples can be seen in the [tests](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/blob/master/test/test.js).


## Usage with no-extend-native

ESLint's [`no-extend-native`][no-extend-native] rule verifies code is not **modifying** a native prototype. e.g., with the `no-extend-native` rule enabled, the following lines are each considered incorrect:
```javascript
String.prototype.shortHash = function() { return this.substring(0, 7); };
Object.defineProperty(Array.prototype, "times", { value: 999 });
```

`no-use-extend-native` verifies code is not **using** a non-native prototype. e.g., with the `no-use-extend-native` plugin enabled, the following line is considered incorrect:
```javascript
"50bda47b09923e045759db8e8dd01a0bacd97370".shortHash() === "50bda47";
```

The `no-use-extend-native` plugin is designed to work with ESLint's `no-extend-native` rule. `no-extend-native` ensures that native prototypes aren't extended, and should a third party library extend them, `no-use-extend-native` ensures those changes aren't depended upon.

[no-extend-native]: http://eslint.org/docs/rules/no-extend-native


## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)

---
_Source: https://npm.io/package/eslint-plugin-no-use-extend-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
