Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention Node version support in prefer-node-protocol rule #1874

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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