Package Exports
- eslint-plugin-depend
- eslint-plugin-depend/lib/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-depend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 jsonc-eslint-parser
.
For example, in your .eslintrc.json
:
{
"overrides": [
{
"files": ["package.json"],
"parser": "jsonc-eslint-parser",
"plugins": ["depend"],
"rules": {
"depend/ban-dependencies": "error"
}
}
]
}
Read more at the
jsonc-eslint-parser
docs.
Rules
License
MIT