Comments (6)
yes, the configured version should be a subset of the supported range. I have made a fix: #252
from eslint-plugin-n.
Thank you for this report!
We have two options here:
- Convert the range to a minimum version
- Throw an error to state that the config must not be a version range
I think in this context that converting it to a minimum version is the best course of action.
What do you think @aladdin-add?
from eslint-plugin-n.
- Throw an error to state that the config must not be a version range
What about the engines
field of package.json? Mostly range is used there.
- Convert the range to a minimum version
When the engines field is >=18.10.0 || >= 20.0.0
, it should be converted to 18.10.0
? When supported versions are ["20.1.0", "18.9.0"]
, it cannot be determined whether it is supported using the minimum version.
It would be better to use the same logic as before.
https://github.com/eslint-community/eslint-plugin-n/blob/16.6.2/lib/util/check-unsupported-builtins.js#L54-L60
from eslint-plugin-n.
The same section you highlighted can be found here on master:
https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/util/check-unsupported-builtins.js#L40-L47
from eslint-plugin-n.
The difference:
- v16:
return !configured.intersects(unsupportedRange)
(configured
is expected to be range) - v17:
return configured.intersects(supportedRange)
(configured
is expected to be only minimum version)
from eslint-plugin-n.
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 🤔
from eslint-plugin-n.
Related Issues (20)
- Bug: False-positive in `n/no-unsupported-features/node-builtins` HOT 1
- Bug: no-missing-require incorrectly flagging module as missing HOT 12
- Bug: False positive for `canParse` in `n/no-unsupported-features/node-builtins`
- duplicate line with line 135 HOT 1
- Bug: unexpected token ??= HOT 2
- Bug: no-unsupported-features/es-builtins: fetch reported unsupported despite Node.js >=18.16.0 HOT 7
- ✨ Update to node v22.0.0 HOT 1
- Bug: no-unsupported-features/es-builtins false positives HOT 1
- Bug: The 'Buffer' is still an experimental feature The configured version range is '>=18.6'. HOT 1
- New option: Support `"fetch"` in `"ignore"` option of `n/no-unsupported-features/node-builtins` HOT 3
- Bug: [`n/no-unsupported-features/node-builtins`] false-positive when writing to the variable HOT 1
- Change Request: Add option to allow `NODE_ENV` in `n/no-process-env` HOT 4
- Support for "import attributes" and "import assertions" HOT 2
- Bug: package.json import results in no-missing-import HOT 5
- Bug: import type fails with no-missing-import if node fails to resolve the import HOT 4
- Rule ideas
- Change Request: Missing issue template for "rule change"?
- New Rule: `n/no-path-concat` for `import.meta.*`
- Bug: Make disabling the no-unpublished-x rules in private packages opt-in HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-n.