From 815ac330e8a80ddac4856d1b0824972a671c51ee Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Fri, 22 Jul 2022 12:46:43 -0700 Subject: [PATCH] docs: mention Node version support of prefer-node-protocol rule --- docs/rules/prefer-node-protocol.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/rules/prefer-node-protocol.md b/docs/rules/prefer-node-protocol.md index 2cf3227a7d..bb5350cad1 100644 --- a/docs/rules/prefer-node-protocol.md +++ b/docs/rules/prefer-node-protocol.md @@ -1,15 +1,19 @@ # Prefer using the `node:` protocol when importing Node.js builtin modules - - -✅ *This rule is part of the [recommended](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config) config.* +💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -🔧 *This rule is [auto-fixable](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems).* - +🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + + 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. -And don't forget to [upvote this issue](https://github.com/nodejs/node/issues/38343) if you agree. +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