Skip to content

New rule: no-unused-dependencies #877

Open
@ljharb

Description

@ljharb

The thought here is that this rule would lint package.json itself and warn on any deps or dev deps that are not explicitly imported somewhere in the linted JS files.

This would be independently configurable for deps as well as dev deps, with the following example schemas:

[2, {
  "dependencies": false,
  "devDependencies": true
}]
[2, {
  "dependencies": {
    "enable": false
  },
  "devDependencies": {
    "ignore": ["something-side-effecty", "a command-line tool"]
  }
}]

Ideally, it would also not warn on unused dev deps that had a "bin" name that was explicitly referenced in any of the "scripts".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions