import-js / import-js/eslint-plugin-import

New rule: `no-unused-dependencies`

Open
#877 10 comments 54 reactions 0 assignees View on GitHub
evaluating rule proposal
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

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:
```json
[2, {
"dependencies": false,
"devDependencies": true
}]
```

```json
[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".

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by examining the plugin's existing rule and configuration patterns, then define how package.json dependencies, devDependencies, ignored packages, and script-referenced binaries should be detected. Done means the proposed rule and schemas cover the stated cases without false positives.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.