https://github.com/es-tooling/eslint-plugin-depend
An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
https://github.com/es-tooling/eslint-plugin-depend
Last synced: 20 days ago
JSON representation
An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
- Host: GitHub
- URL: https://github.com/es-tooling/eslint-plugin-depend
- Owner: es-tooling
- License: mit
- Created: 2024-03-09T14:12:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-06T15:39:33.000Z (27 days ago)
- Last Synced: 2025-05-06T16:51:49.966Z (27 days ago)
- Language: TypeScript
- Size: 178 KB
- Stars: 389
- Watchers: 5
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-eslint - depend - Helps detect dependency tree bloat and redundant polyfills. (Plugins / Code Quality)
- fucking-awesome-eslint - depend - Helps detect dependency tree bloat and redundant polyfills. (Plugins / Code Quality)
- fucking-awesome-eslint - depend - Helps detect dependency tree bloat and redundant polyfills. (Plugins / Code Quality)
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 `jsonc-eslint-parser`.
For example, in your `.eslintrc.json`:
```json
{
"overrides": [
{
"files": ["package.json"],
"parser": "jsonc-eslint-parser",
"plugins": ["depend"],
"rules": {
"depend/ban-dependencies": "error"
}
}
]
}
```Read more at the
[`jsonc-eslint-parser` docs](https://github.com/ota-meshi/jsonc-eslint-parser).## Rules
- [`depend/ban-dependencies`](./docs/rules/ban-dependencies.md)
## License
MIT