-
-
Notifications
You must be signed in to change notification settings - Fork 42
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: no-missing-require incorrectly flagging module as missing #242
Comments
After some looking, this is related to: #182 The error is that the exports are the wrong way around: Therefore this error is getting triggered: |
Yeah, I would tend to agree. I am thinking about what the best course here is. We could:
|
seems it's working as expected - as said in the node.js docs:
https://nodejs.org/docs/latest/api/packages.html#conditional-exports the next steps:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-also supports this |
Well, if node.js can resolve the module and the issue this plugin finds isn’t within the project that runs the linting but rather in one of its dependencies, then I think the linting shouldn’t fail as it’s kind of a false alarm? Such a failed linting should happen in the project that published the incorrect fields instead. |
I agree with this. The current setup for the retry package works fine in Node.js so I don't think it should be considered a problem. This seems more like something that other tooling is trying to enforce rather than an actual problem with the package. That said, I can update the package to swap the order of exports. |
Agreed, I think I will do point two:
It may also be worth seeing if we can add a rule to eslint-plugin-package-json too specifically about this if there is not one already 🤔 |
Environment
Node version: v20.11.0
npm version: v10.4.0
ESLint version: v9.0.0
eslint-plugin-n version: v17.2.0
Operating System: win32 10.0.19045
What rule do you want to report?
no-missing-require
Link to Minimal Reproducible Example
eslint/eslint#18313
What did you expect to happen?
That the rule would correctly find the module
@humanwhocodes/retry
.Worked in v16.6.2, stopped working in v17.0.0.
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: