MCPcopy Index your code
hub / github.com/es-tooling/eslint-plugin-depend

github.com/es-tooling/eslint-plugin-depend @1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.5.0 ↗ · + Follow
13 symbols 65 edges 13 files 1 documented · 8% 5 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

eslint-plugin-depend

This is an ESLint plugin to help suggest alternatives to various dependencies.

Primarily, it will help detect dependency tree bloat and redundant polyfills.

Install

npm i -D eslint-plugin-depend

Usage

If you're using the new flat config files, add to your eslint.config.js:

import depend from 'eslint-plugin-depend';
import {defineConfig} from 'eslint/config';

export default defineConfig([
  {
    files: ['**/*.js'],
    plugins: {
      depend
    },
    extends: ['depend/flat/recommended'],
  }
]);

For older legacy projects, add to your .eslintrc.json:

{
  "extends": [
    "plugin:depend/recommended"
  ]
}

With package.json

Some rules (e.g. ban-dependencies) can be used against your package.json.

You can achieve this by using @eslint/json or jsonc-eslint-parser.

For example, with @eslint/json and eslint.config.js:

import depend from 'eslint-plugin-depend';
import json from '@eslint/json';
import {defineConfig} from 'eslint/config';

export default defineConfig([
  {
    files: ['package.json'],
    language: 'json/json',
    plugins: {
      depend,
      json
    },
    extends: ['depend/flat/recommended'],
  }
]);

Or with jsonc-eslint-parser and .eslintrc.json:

{
  "overrides": [
    {
      "files": ["package.json"],
      "parser": "jsonc-eslint-parser",
      "plugins": ["depend"],
      "rules": {
        "depend/ban-dependencies": "error"
      }
    }
  ]
}

Read more at the @eslint/json docs and jsonc-eslint-parser docs.

Rules

License

MIT

Extension points exported contracts — how you extend this code

BanDependenciesOptions (Interface)
(no doc)
src/rules/ban-dependencies.ts

Core symbols most depended-on inside this repo

closestPackageSatisfiesNodeVersion
called by 6
src/util/package-json.ts
getReplacementsDocUrl
called by 5
src/util/rule-meta.ts
getNodeConstraint
called by 5
src/util/package-json.ts
getMdnUrl
called by 4
src/util/rule-meta.ts
isFlatConfig
called by 2
src/test/configs_test.ts
getDocsUrl
called by 2
src/util/rule-meta.ts
getClosestPackage
called by 2
src/util/package-json.ts
replacementListenerCallback
called by 2
src/util/imports.ts

Shape

Function 12
Interface 1

Languages

TypeScript100%

Modules by API surface

src/util/imports.ts4 symbols
src/util/rule-meta.ts3 symbols
src/util/package-json.ts3 symbols
src/test/configs_test.ts1 symbols
src/rules/ban-dependencies.ts1 symbols
src/configs/recommended.ts1 symbols

For agents

$ claude mcp add eslint-plugin-depend \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page