Skip to content

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

License

Notifications You must be signed in to change notification settings

es-tooling/eslint-plugin-depend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9e92bf4 · Nov 4, 2024

History

42 Commits
Jun 5, 2024
Jun 27, 2024
Aug 11, 2024
Mar 9, 2024
Mar 9, 2024
Mar 9, 2024
Mar 9, 2024
Mar 9, 2024
Mar 9, 2024
Jun 26, 2024
Aug 11, 2024
Nov 4, 2024
Aug 11, 2024
Mar 9, 2024

Repository files navigation

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 * as depend from 'eslint-plugin-depend';

export default [
  depend.configs['flat/recommended'],

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

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published