eslint-plugin-depend
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

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

Add to your .eslintrc.json:

{
  "extends": [
    "plugin:depend/recommended"
  ]
}

Or if you're using (flat) config files, add to your eslint.config.js:

import {configs} from 'eslint-plugin-depend';

export default [
  configs.recommended,

  // or if you want to specify `files`, or other options
  {
    ...configs.recommended,
    files: ['test/**/*.js']
  }
];

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

/eslint-plugin-depend/

    Package Sidebar

    Install

    npm i eslint-plugin-depend

    Weekly Downloads

    33

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    28.6 kB

    Total Files

    17

    Last publish

    Collaborators

    • 43081j