# eslint-plugin-depend

> An ESLint plugin to suggest optimized dependencies, native alternatives and more

Latest version **1.5.0** (published 2026-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-depend
pnpm add eslint-plugin-depend
yarn add eslint-plugin-depend
bun add eslint-plugin-depend
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2026-03-03 |
| First published | 2024-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 495 |
| Author | James Garbutt |
| Maintainers | 43081j |
| Keywords | eslint, optimize, optimise, clutter, cleanup, package |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-depend
- Repository: https://github.com/es-tooling/eslint-plugin-depend
- Homepage: https://github.com/es-tooling/eslint-plugin-depend#readme
- Issues: https://github.com/es-tooling/eslint-plugin-depend/issues
- npm.io page: https://npm.io/package/eslint-plugin-depend

## Dependencies (3)

- [semver](https://npm.io/package/semver.md) ^7.6.3
- [empathic](https://npm.io/package/empathic.md) ^2.0.0
- [module-replacements](https://npm.io/package/module-replacements.md) ^2.10.1

## Recent versions

- 1.5.0 (latest) — 2026-03-03
- 1.3.0-alpha.0 (next) — 2025-09-21
- 1.4.0 — 2025-11-12
- 1.3.1 — 2025-09-21
- 1.3.0 — 2025-09-21
- 1.2.0 — 2025-05-09
- 1.1.0 — 2025-05-06
- 1.0.0 — 2025-04-09
- 1.0.0-esm — 2025-04-09
- 0.12.0 — 2024-11-04
- 0.11.0 — 2024-08-24
- 0.10.0 — 2024-08-11
- 0.9.0 — 2024-07-18
- 0.8.0 — 2024-06-26
- 0.8.0-beta.1 — 2024-06-05
- … 6 more at https://npm.io/package/eslint-plugin-depend/versions

## 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

```sh
npm i -D eslint-plugin-depend
```

## Usage

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

```ts
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`:

```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`:

```ts
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`:

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

Read more at the
[`@eslint/json` docs](https://github.com/eslint/json) and
[`jsonc-eslint-parser` docs](https://github.com/ota-meshi/jsonc-eslint-parser).

## Rules

- [`depend/ban-dependencies`](./docs/rules/ban-dependencies.md)

## License

MIT

---
_Source: https://npm.io/package/eslint-plugin-depend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
