-
-
Notifications
You must be signed in to change notification settings - Fork 43
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: unsupported-features/node-builtins-modules
doesn't work for semver range in v17
#250
Comments
Thank you for this report! We have two options here:
I think in this context that converting it to a minimum version is the best course of action. What do you think @aladdin-add? |
What about the
When the engines field is It would be better to use the same logic as before. |
The same section you highlighted can be found here on master: |
The difference:
|
fixes #250 Signed-off-by: 唯然 <weiran.zsd@outlook.com>
yes, the configured version should be a subset of the supported range. I have made a fix: #252 |
fixes #250 Signed-off-by: 唯然 <weiran.zsd@outlook.com>
A fix was implemented in #252, but due to an issue in semver we needed to revert it. For now I wonder if we can solve this another way 🤔 |
…257) * fix: unsupported-features/node-builtins-modules #250 * Reapply "fix: unsupported-features/node-builtins-modules range compare" (#254) This reverts commit caecf3e. * Update lib/util/check-unsupported-builtins.js Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com> * chore: remove a unrelated test --------- Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com>
Environment
Node version: v20.12.2
npm version: 10.5.0
ESLint version: 8.57.0
eslint-plugin-n version: 17.2.1
Operating System: macOS
What rule do you want to report?
unsupported-features/node-builtins-modules
Link to Minimal Reproducible Example
https://eslint-online-playground.netlify.app/#eNpdkl1PwyAUhv8K4Woma7cmxmnNduW9N8abMROkx6WzBTzAnNn63z2U7pMr+nJ4eDh0zx2qCexkaxvIN46XXBntPJPOAXo2Zwg/oUYYCZ4iwe+ehdbwO5TkCBtQ3o1izMc8B9fU2qMimtHE2wvNmOCw86ArJ3jJlvTVF5UIyrQt5VAJPqYq24R1rUs9uVpZjRPDSqQjX62vyTGSenZPV618B3S0EHPBG+nBkWy/M1Y4E1DB25+FVNCaKjQ0j+vdwEdKLrlpCK4n2mRBu2CtQQ9V9gXSBwRHeQXZZ6gbXyej5XknWSEaPDnEcQPeXiov5k/5NJ8mpTS643TVawrdUYetVN9yHV/rqr+aGndlT95kl9gfxX1ezPIpOxzYYl48nA863r2C7QvY2HCt6htOeq1Eerzoacqz9GjZcI1iNoDJlv6I7h9Tur5F
What did you expect to happen?
This works fine (expectedly fail),
but this doesn't work (unexpectedly success) in v17: demo
v16 works fine: demo
Participation
Additional comments
Since specifying the version by range is common in the engines field of package.json, this bug is likely to occur in many cases.
However, this is not included in the test cases.
The logic of this range comparison seems to be the cause.
eslint-plugin-n/lib/util/check-unsupported-builtins.js
Lines 40 to 53 in eb11b5b
The text was updated successfully, but these errors were encountered: