Skip to content

Commit

Permalink
prefer-node-protocol: Mention Node.js version support in docs (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Nov 23, 2022
1 parent 4dcf1e4 commit 5bb563c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/rules/prefer-node-protocol.md
Expand Up @@ -9,6 +9,12 @@

When importing builtin modules, it's better to use the [`node:` protocol](https://nodejs.org/api/esm.html#node-imports) as it makes it perfectly clear that the package is a Node.js builtin module.

Note that Node.js support for this feature began in:

> v16.0.0, v14.18.0 (`require()`)
>
> v14.13.1, v12.20.0 (`import`)
## Fail

```js
Expand Down

0 comments on commit 5bb563c

Please sign in to comment.