Skip to content

Commit caecf3e

Browse files
authoredApr 24, 2024
Revert "fix: unsupported-features/node-builtins-modules range compare" (#254)
Revert "fix: unsupported-features/node-builtins-modules range compare (#252)" This reverts commit d50ae85.
1 parent d8d8454 commit caecf3e

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed
 

‎lib/util/check-unsupported-builtins.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const { ReferenceTracker } = require("@eslint-community/eslint-utils")
99
const getConfiguredNodeVersion = require("./get-configured-node-version")
1010
const getSemverRange = require("./get-semver-range")
1111
const unprefixNodeColon = require("./unprefix-node-colon")
12-
const semverRangeSubset = require("semver/ranges/subset")
1312

1413
/**
1514
* Parses the options.
@@ -51,7 +50,7 @@ function isSupported({ supported }, configured) {
5150
return false
5251
}
5352

54-
return semverRangeSubset(configured, range)
53+
return configured.intersects(range)
5554
}
5655

5756
/**

‎tests/lib/rules/no-unsupported-features/es-builtins.js

-17
Original file line numberDiff line numberDiff line change
@@ -2424,23 +2424,6 @@ runTests([
24242424
},
24252425
],
24262426
},
2427-
// https://github.com/eslint-community/eslint-plugin-n/issues/250
2428-
{
2429-
code: "function wrap() { globalThis }",
2430-
settings: {
2431-
node: { version: ">=11.9.9" },
2432-
},
2433-
errors: [
2434-
{
2435-
messageId: "not-supported-till",
2436-
data: {
2437-
name: "globalThis",
2438-
supported: "12.0.0",
2439-
version: ">=11.9.9",
2440-
},
2441-
},
2442-
],
2443-
},
24442427
],
24452428
},
24462429
])

0 commit comments

Comments
 (0)