Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.

License

NotificationsYou must be signed in to change notification settings

es-tooling/eslint-plugin-depend

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.

Install

npm i -D eslint-plugin-depend

Usage

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"  ]}

Withpackage.json

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.

Rules

License

MIT

About

An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp