Registry / testing / eslint-plugin-depend

eslint-plugin-depend

JSON →
library1.5.0jsnpmunverified

An ESLint plugin (v1.5.0) that suggests optimized dependencies, native alternatives, and detects package bloat. It helps reduce dependency tree size and redundant polyfills by analyzing imports and providing rule-based suggestions. Active development with regular releases; supports flat config and legacy config. Ships TypeScript types. Requires eslint >=8.40.0 and is ESM-only since v1.0.0.

npm install eslint-plugin-depend
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-DEPE
E
eslint-plugin-depend
testingjavascriptv1.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import depend from 'eslint-plugin-depend'
const depend = require('eslint-plugin-depend')
ESM-only since v1.0.0; default export is the plugin object.
depend (plugin)
import depend from 'eslint-plugin-depend'
const depend = require('eslint-plugin-depend').default
No named default export; import the default and use as plugins.depend.
flat config extension
import depend from 'eslint-plugin-depend'; export default [{ plugins: { depend }, extends: ['depend/flat/recommended'] }]
export default [{ plugins: { 'eslint-plugin-depend': depend } }]
Use 'depend/flat/recommended' string in extends; do not import a config object.

Shows how to set up the plugin with flat config for JS files, including the correct import and extends pattern.

// Install: npm i -D eslint-plugin-depend // eslint.config.js (flat config) import depend from 'eslint-plugin-depend'; import { defineConfig } from 'eslint/config'; export default defineConfig([ { files: ['**/*.js'], plugins: { depend }, extends: ['depend/flat/recommended'], } ]); // or .eslintrc.json (legacy) // { // "extends": ["plugin:depend/recommended"] // }
Debug
Known issues
breakingv1.0.0 dropped CommonJS support. require() will fail.
fix
Migrate to ESM: use import statements and flat config.
affects: >=1.0.0
breakingv1.0.0 changed the default export. The plugin object no longer requires .default.
fix
import depend from 'eslint-plugin-depend' (not require(...).default).
affects: >=1.0.0
deprecatedLegacy .eslintrc configs are still supported but not recommended.
fix
Use flat config with eslint.config.js and the 'depend/flat/recommended' extends.
affects: >=0.12.0
gotchaWhen linting package.json, you must use a JSON parser (e.g., @eslint/json or jsonc-eslint-parser) and set files: ['package.json'].
fix
Add a separate config block for package.json with appropriate language/parser.
affects: *
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() to import eslint-plugin-depend which is ESM-only since v1.0.0
fix
Switch to import syntax or downgrade to v0.12.0 (last CJS version).
Oops! Something went wrong! :( ESLint: 8.x.x ESLint couldn't find the plugin "eslint-plugin-depend"
Missing or incorrectly configured plugin in flat config
fix
Ensure you have `import depend from 'eslint-plugin-depend'` and `plugins: { depend }` in your config.
Configuration for rule "depend/ban-dependencies" is invalid: Value "error" should be a boolean or object.
Using string severity in flat config; flat config expects severity as number or string but rule config is nested incorrectly.
fix
Use `"depend/ban-dependencies": "error"` inside rules object, not as a string value in extends.
TypeError: eslint-plugin-depend is not a function
Importing the plugin incorrectly (e.g., using default export as function).
fix
Import as `import depend from 'eslint-plugin-depend'` and use as plugin object.
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for the plugin to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-depend — npm install eslint-plugin-depend · libregistry