GithubHelp home page GithubHelp logo

Comments (6)

aladdin-add avatar aladdin-add commented on July 2, 2024 1

yes, the configured version should be a subset of the supported range. I have made a fix: #252

from eslint-plugin-n.

scagood avatar scagood commented on July 2, 2024

Thank you for this report!

We have two options here:

  1. Convert the range to a minimum version
  2. 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.

teppeis avatar teppeis commented on July 2, 2024
  1. 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.

  1. 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.

scagood avatar scagood commented on July 2, 2024

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.

teppeis avatar teppeis commented on July 2, 2024

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.

scagood avatar scagood commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.