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
muslnode 18–226 runs
build_error
glibcnode 18–226 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"]
// }
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
fixSwitch 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
fixEnsure 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.
fixUse `"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).
fixImport as `import depend from 'eslint-plugin-depend'` and use as plugin object.
Audit
Dependencies
eslintrequiredpeer dependency required for the plugin to function