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-missing-imports doesn't work correctly for workspace modules #184

Closed
1 task done
JeremyLoy opened this issue Feb 13, 2024 · 2 comments · Fixed by #139
Closed
1 task done

Bug: n/no-missing-imports doesn't work correctly for workspace modules #184

JeremyLoy opened this issue Feb 13, 2024 · 2 comments · Fixed by #139
Labels

Comments

@JeremyLoy
Copy link

Environment

Node version: 20
yarn version: 4
ESLint version: 8.56
eslint-plugin-n version: 16.6.2
Operating System: MacOS

What rule do you want to report?

no-missing-imports

Link to Minimal Reproducible Example

https://github.com/JeremyLoy/hidden-module-import-issue-example/tree/main

What did you expect to happen?

In this monorepo using yarn workspaces, I have a local package named @myorg/math. It is encapsulating an implementation, and only exposing one module via it's package.json exports property.

All imports from this package are getting reported as missing by eslint-plugin-n, when only the private module implementation.js should be getting reported as missing. See the test file for comments.

Participation

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

Additional comments

I'm willing to help contribute if you point me in the correct direction!

@JeremyLoy JeremyLoy added the bug label Feb 13, 2024
@scagood
Copy link

scagood commented Feb 14, 2024

I will take a look at your example at the end of the day (UK time)
I do know that in eslint v17 the resolution mechanisms are completely overhauled (#139).

You could try using version 17 (yarn add -D eslint-plugin-n@next)

@JeremyLoy
Copy link
Author

That works, thanks!

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

Successfully merging a pull request may close this issue.

2 participants