Skip to content

Commit

Permalink
feat: n/no-unsupported-features/node-builtins ignore fetch
Browse files Browse the repository at this point in the history
[Global fetch](https://nodejs.org/api/globals.html#fetch) has been
supported without the `--experimental-fetch` CLI flag since Node.js
18.0.0.  Although it was considered experimental until 21.0.0, there
are no functional changes that I am aware of.  I see no risk of using it
on projects targeting Node.js >=18.

FIXME: fetch should not be ignored for Node.js <18, but there does not
appear to be a way to configure this.

Signed-off-by: Kevin Locke <[email protected]>
  • Loading branch information
kevinoid committed Nov 2, 2024
1 parent c2e5dee commit 6555383
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rules/n.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ module.exports = {

// allow process.exit()
// this rule is redundant with the built-in no-process-exit rule
"n/no-process-exit": "off"
"n/no-process-exit": "off",

// disallow unsupported Node.js built-ins
// Ignore fetch experimental warning on Node.js >=18 <21
"n/no-unsupported-features/node-builtins": ["error", {
"ignores": [
"fetch"
]
}]
}
};

0 comments on commit 6555383

Please sign in to comment.