diff --git a/lib/util/check-unsupported-builtins.js b/lib/util/check-unsupported-builtins.js index e76a5e39..db2ae46f 100644 --- a/lib/util/check-unsupported-builtins.js +++ b/lib/util/check-unsupported-builtins.js @@ -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. @@ -51,7 +50,7 @@ function isSupported({ supported }, configured) { return false } - return semverRangeSubset(configured, range) + return configured.intersects(range) } /** diff --git a/tests/lib/rules/no-unsupported-features/es-builtins.js b/tests/lib/rules/no-unsupported-features/es-builtins.js index a78c9cce..1ca57dd1 100644 --- a/tests/lib/rules/no-unsupported-features/es-builtins.js +++ b/tests/lib/rules/no-unsupported-features/es-builtins.js @@ -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", - }, - }, - ], - }, ], }, ])