Skip to content

Commit

Permalink
Update lib/util/check-unsupported-builtins.js
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com>
  • Loading branch information
aladdin-add and scagood committed Apr 30, 2024
1 parent d0f6e7f commit a3613eb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/util/check-unsupported-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
"use strict"

const { major, rsort } = require("semver")
const { rsort } = require("semver")
const { ReferenceTracker } = require("@eslint-community/eslint-utils")
const getConfiguredNodeVersion = require("./get-configured-node-version")
const getSemverRange = require("./get-semver-range")
Expand Down Expand Up @@ -39,12 +39,7 @@ function isSupported({ supported }, configured) {

const [latest] = rsort(supported)
const range = getSemverRange(
[
...supported.map(
version => `>= ${version} < ${major(version) + 1}`
),
`>= ${latest}`,
].join("||")
[...supported.map(version => `^${version}`), `>= ${latest}`].join("||")
)

if (range == null) {
Expand Down

0 comments on commit a3613eb

Please sign in to comment.