Skip to content

Commit

Permalink
Revert "fix: unsupported-features/node-builtins-modules range compare (
Browse files Browse the repository at this point in the history
…#252)"

This reverts commit d50ae85.
  • Loading branch information
aladdin-add committed Apr 24, 2024
1 parent d8d8454 commit b8332aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
3 changes: 1 addition & 2 deletions lib/util/check-unsupported-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const { ReferenceTracker } = require("@eslint-community/eslint-utils")
const getConfiguredNodeVersion = require("./get-configured-node-version")
const getSemverRange = require("./get-semver-range")
const unprefixNodeColon = require("./unprefix-node-colon")
const semverRangeSubset = require("semver/ranges/subset")

/**
* Parses the options.
Expand Down Expand Up @@ -51,7 +50,7 @@ function isSupported({ supported }, configured) {
return false
}

return semverRangeSubset(configured, range)
return configured.intersects(range)
}

/**
Expand Down
17 changes: 0 additions & 17 deletions tests/lib/rules/no-unsupported-features/es-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2424,23 +2424,6 @@ runTests([
},
],
},
// https://github.com/eslint-community/eslint-plugin-n/issues/250
{
code: "function wrap() { globalThis }",
settings: {
node: { version: ">=11.9.9" },
},
errors: [
{
messageId: "not-supported-till",
data: {
name: "globalThis",
supported: "12.0.0",
version: ">=11.9.9",
},
},
],
},
],
},
])

0 comments on commit b8332aa

Please sign in to comment.