Skip to content

Commit

Permalink
fix: unsupported-features/node-builtins-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Apr 28, 2024
1 parent cf576cb commit 42d4dcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/check-unsupported-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function isSupported({ supported }, configured) {
...supported.map(
version => `>= ${version} < ${major(version) + 1}`
),
`> ${major(latest)}`,
`>= ${latest}`,
].join("||")
)

Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/no-unsupported-features/node-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5305,6 +5305,12 @@ new RuleTester({ languageOptions: { sourceType: "module" } }).run(
node: { version: "12.11.0" },
},
},

// https://github.com/eslint-community/eslint-plugin-n/issues/253
{
code: `fetch("/api/xxx");`,
settings: { node: { version: ">=18.2.0" } },
},
],
invalid: [
{
Expand Down

0 comments on commit 42d4dcc

Please sign in to comment.