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

import/no-extraneous-dependencies - whitelist and self reference use cases (PNPM)

Open
#2,453 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Hey there guys,

Just ran into a dead end with the import/no-extraneous-dependencies rule. Specifically, we are using PNPM and mono-repos.
In this setup, we use the rule to help us ensure that all dependencies are available for distributed packages (like API client)...

However, in other cases it doesn't make sense to worry about if a package is extraneous. For example, we don't care with testing and development libraries or when referencing a module from itself.

We can resolve these issues by actually listing the dependency in package.json but this can introduce other problems and is tedious.

As a suggestion, we were wondering if it were possible to get a whitelist option or a allowSelfReference option?
Would be helpful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the import/no-extraneous-dependencies rule and its current option handling, then review how PNPM monorepos and self-references appear in the reported cases. Define the behavior and tests for a whitelist and/or allowSelfReference option; done means the agreed use cases work without requiring package.json workarounds.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.