eslint-plugin-implicit-dependencies

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

ESLint plugin (v1.1.1) that flags imports or require() calls to modules not listed in the project's package.json dependencies. Uses the 'no-implicit' rule to prevent accidental reliance on transitive dependencies. Lightweight, no runtime dependencies, works with both CJS require and ES import syntax. Differentiates from similar plugins by focusing solely on implicit dependency detection with minimal configuration.

error Error: Failed to load plugin 'implicit-dependencies': Cannot find module 'eslint-plugin-implicit-dependencies'
cause Plugin not installed locally.
fix
npm install eslint-plugin-implicit-dependencies --save-dev
error Definition for rule 'implicit-dependencies/no-implicit' was not found
cause Plugin not listed in 'plugins' section of ESLint config.
fix
Add 'implicit-dependencies' to the plugins array.
gotcha By default, only 'dependencies' are checked. Transient dependencies in devDependencies or peerDependencies are ignored unless explicitly configured.
fix Add options: { dev: true, peer: true, optional: true } to the rule.
gotcha The plugin does not handle dynamic require() or import() expressions; only static imports and requires are detected.
fix Use static import statements or add the dynamic module to package.json explicitly.
gotcha Monorepo setups: Only the root package.json is read; subpackage dependencies may be incorrectly flagged.
fix Run ESLint separately per package, or use a monorepo-aware alternative.
npm install eslint-plugin-implicit-dependencies
yarn add eslint-plugin-implicit-dependencies
pnpm add eslint-plugin-implicit-dependencies

Configure ESLint to error on any import not listed in package.json dependencies or devDependencies.

// .eslintrc.json
{
  "plugins": ["implicit-dependencies"],
  "rules": {
    "implicit-dependencies/no-implicit": ["error", { "dev": true }]
  }
}