eslint-plugin-depend
An ESLint plugin to suggest optimized dependencies, native alternatives and more
Last updated 9 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install eslint-plugin-depend 
SYNC missed versions from official npm registry.

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 @eslint/json or jsonc-eslint-parser.

For example, with @eslint/json and eslint.config.js:

import depend from 'eslint-plugin-depend';
import json from '@eslint/json';
import {defineConfig} from 'eslint/config';

export default defineConfig([
  {
    files: ['package.json'],
    language: 'json/json',
    plugins: {
      depend,
      json
    },
    extends: ['depend/flat/recommended'],
  }
]);

Or with jsonc-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 and jsonc-eslint-parser docs.

Rules

License

MIT

Current Tags

  • 1.5.0                                ...           latest (9 months ago)
  • 1.3.0-alpha.0                                ...           next (a year ago)

21 Versions

  • 1.5.0                                ...           9 months ago
  • 1.4.0                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.3.0-alpha.0                                ...           a year ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-esm                                ...           2 years ago
  • 0.12.0                                ...           2 years ago
  • 0.11.0                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.8.0-beta.1                                ...           2 years ago
  • 0.7.0                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Total 109
Today 0
This Week 0
This Month 65
Last Day 0
Last Week 14
Last Month 44
Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE