Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: n/no-extraneous-import doesn't recognize workspaces #209

Open
1 task done
JoshuaKGoldberg opened this issue Mar 28, 2024 · 1 comment
Open
1 task done

Bug: n/no-extraneous-import doesn't recognize workspaces #209

JoshuaKGoldberg opened this issue Mar 28, 2024 · 1 comment

Comments

@JoshuaKGoldberg
Copy link

Environment

Node version:
npm version:
ESLint version:
eslint-plugin-n version:
Operating System:

What rule do you want to report?

n/no-extraneous-import

Link to Minimal Reproducible Example

https://eslint-online-playground.netlify.app/#eNplUUFOwzAQ/IrlUys1DiAoqBWcuHNBXOoejLNUbhPbWjulKMrfsWNHStObtTM7OzPuqBXyJA7gSovmCNKXecCOzmi6oR3XhHCqRQOcbsIr8zjluqer2324iMbWwDw4z7wLEqqxBj3pSAVOovoG0pMfNE0QO6tI43TLNdcjvAjadEUWS/L6Rrp+uQ1nGLhaaY9y5ssKdIAf1iujXTQ4zCMCshFfgC4AyXgt0q3VyHCmRQmffzYna0zV1uEd8X5gBf26PaikvAstcLrPAAbq9UFdalPAxaPQYFpXpNhJGhANZuWr3mZxKji/g4VQhZZqpp8aSHov7OmZ3U2yJLBIdouc+H7N1uxhwhrrHkD2GBWmYX8Nnlwwlg7vxq35F6elfczR/wO7rrp/

What did you expect to happen?

When in a workspace setup and a root-level package.json has a dependency not listed in nested packages, that dependency should not be considered missing. But I'm setting it as missing.

Note that although the repro playground has a package.json "workspaces" entry, not every workspace setup has that. pnpm workspaces use a separate pnpm-workspace.yaml.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Related, for n/no-missing-imports: #184.

@scagood
Copy link

scagood commented Apr 5, 2024

I think this is a great idea to be able to check up for a workspace package.json. I do a similar thing in yarn fairly commonly 🤔

I do think we should only support the package.json#workspaces entry though, as I dont want to be bespoke to specific package managers where possible. (I am willing to bend a little though 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants