- Notifications
You must be signed in to change notification settings - Fork9
An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
License
es-tooling/eslint-plugin-depend
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is an ESLint plugin to help suggest alternatives to various dependencies.
Primarily, it will help detect dependency tree bloat and redundantpolyfills.
npm i -D eslint-plugin-depend
If you're using the new flat config files, add to youreslint.config.js
:
importdependfrom'eslint-plugin-depend';import{defineConfig}from'eslint/config';exportdefaultdefineConfig([{files:['**/*.js'],plugins:{ depend},extends:['depend/flat/recommended'],}]);
For older legacy projects, add to your.eslintrc.json
:
{"extends": ["plugin:depend/recommended" ]}
Some rules (e.g.ban-dependencies
) can be used against yourpackage.json
.
You can achieve this by using@eslint/json
orjsonc-eslint-parser
.
For example, with@eslint/json
andeslint.config.js
:
importdependfrom'eslint-plugin-depend';importjsonfrom'@eslint/json';import{defineConfig}from'eslint/config';exportdefaultdefineConfig([{files:['package.json'],language:'json/json',plugins:{ depend, json},extends:['depend/flat/recommended'],}]);
Or withjsonc-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 andjsonc-eslint-parser
docs.
MIT
About
An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.