eslint-plugin-node-dependencies

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

ESLint plugin (v2.2.0, active development) that lints package.json dependencies for issues like missing or mismatched engines, deprecated packages, or improper provenance. Requires Node >= 20.19 and ESLint >= 9.38. Released as needed with minor and patch updates. Differentiated from other ESLint plugins by focusing specifically on dependency metadata integrity rather than code style or security scanning.

error Error: Cannot find module 'eslint-plugin-node-dependencies'
cause Package not installed or not in node_modules.
fix
npm install --save-dev eslint-plugin-node-dependencies
error TypeError: plugin.configs is not a function
cause Using legacy eslintrc config or incorrect import style.
fix
Use import nodeDependenciesPlugin from 'eslint-plugin-node-dependencies' and spread plugin.configs.recommended.
error Error: Failed to load config 'plugin:node-dependencies/recommended'
cause Legacy eslintrc config format used; plugin requires flat config.
fix
Switch to eslint.config.js with flat config; do not use 'extends' with plugin: prefix.
error Error: ESLint configuration is invalid: - Unexpected top-level property "rules". Did you mean to use plugins?
cause Misconfigured flat config: placing rules directly at top level instead of inside a config object.
fix
Wrap rules in an object with 'plugins' and 'rules' properties.
breaking v2.0.0 dropped support for legacy (eslintrc) config. Only flat config is supported.
fix Migrate from .eslintrc.* to eslint.config.js using flat config format.
breaking Requires Node.js ^20.19.0 || ^22.13.0 || >=24. Older Node versions are incompatible.
fix Update Node.js to ^20.19.0, ^22.13.0, or >=24.
breaking Requires ESLint >=9.38.0. ESLint v8 and older are not supported.
fix Upgrade ESLint to v9.38.0 or later.
gotcha The plugin is experimental; rules may change without major version bump.
fix Pin exact version in package.json and test upgrades thoroughly.
gotcha The package uses eslint-json-compat-utils for compatibility with eslint/json, which may introduce additional behavior for JSON files.
fix Ensure eslint/json is installed if using JSON-related features.
npm install eslint-plugin-node-dependencies
yarn add eslint-plugin-node-dependencies
pnpm add eslint-plugin-node-dependencies

Sets up the recommended rules for eslint-plugin-node-dependencies in an ESLint flat config file.

import nodeDependenciesPlugin from 'eslint-plugin-node-dependencies';

export default [
  ...nodeDependenciesPlugin.configs.recommended,
];