eslint-plugin-no-use-extend-native

raw JSON →
0.7.2 verified Sat Apr 25 auth: no javascript

ESLint plugin (v0.7.2) to prevent use of extended native objects like arrays, strings, and prototypes. Works alongside ESLint's no-extend-native rule to ensure code doesn't depend on prototype modifications from libraries such as 'colors'. Requires Node >=18.18.0 and ESLint ^9.3.0 (flat config only). Actively maintained with periodic updates.

error Error: Failed to load plugin 'no-use-extend-native' declared in 'plugins': Cannot find module 'eslint-plugin-no-use-extend-native'
cause Plugin not installed or wrong import path.
fix
Run 'npm install --save-dev eslint-plugin-no-use-extend-native' and ensure package.json includes it.
error ESLint couldn't determine the plugin name from ESLint configuration: 'no-use-extend-native'
cause Using deprecated .eslintrc config format with flat config plugin.
fix
Switch to eslint.config.js and import the plugin as shown in Quickstart.
error Parsing error: The keyword 'import' is reserved
cause Using require() instead of import in ESM-only context.
fix
Use ESM import syntax: import eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'
breaking v0.5.0 dropped CommonJS support; flat config only.
fix Use ESM imports and eslint.config.js file; remove .eslintrc usage.
breaking v0.4.0 changed rule name from 'no-use-extend-native/no-use-extend-native' to same but broke some custom configurations.
fix Update rule key if you had custom rule configuration.
gotcha Plugin does not detect extensions made after the check – only static analysis.
fix Use dynamic import or manual review for runtime prototype modifications.
deprecated v0.3.x was last to support Node <10 and ESLint <6.
fix Upgrade to latest version and use ESLint flat config.
npm install eslint-plugin-no-use-extend-native
yarn add eslint-plugin-no-use-extend-native
pnpm add eslint-plugin-no-use-extend-native

Shows how to configure the plugin in eslint.config.js using the provided recommended config or manual setup.

// eslint.config.js
import eslintPluginNoUseExtendNative from 'eslint-plugin-no-use-extend-native'

export default [
  // Preset config (enables rule as error)
  eslintPluginNoUseExtendNative.configs.recommended,
  // Or manually:
  // {
  //   plugins: { 'no-use-extend-native': eslintPluginNoUseExtendNative },
  //   rules: { 'no-use-extend-native/no-use-extend-native': 2 },
  // },
]