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

Conversation

bmish
Copy link
Sponsor Collaborator

@bmish bmish commented Aug 8, 2022

Document the supported Node versions for the node protocol import feature to reduce potential confusion or mistaken adoption of this lint rule.

While eslint-plugin-unicorn only supports Node 14.18 and above:

"node": ">=14.18"

Some libraries that intend to support all versions of Node 14 might accidentally adopt this lint rule since it's very common to only test against the latest Node 14 and not necessarily against early versions of it.

Fixes #1867.

@@ -11,6 +11,12 @@ When importing builtin modules, it's better to use the [`node:` protocol](https:

And don't forget to [upvote this issue](https://github.com/nodejs/node/issues/38343) if you agree.

Note that this feature is not available in early versions of Node 12 and Node 14:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to mention Node.js 12 as it's not supported anymore.

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed "Node 12" from this sentence. However, I do think we should continue to mention it in the versions list below for completeness / to accurately satisfy the wording "Node.js support for this feature began in". Once all of eslint-plugin-unicorn's Node versions support this feature, I think we can just remove this section completely.

@sindresorhus
Copy link
Owner

Bump

@bmish bmish force-pushed the prefer-node-protocol-support-doc branch 2 times, most recently from b79b64d to 815ac33 Compare November 23, 2022 01:47
@bmish bmish force-pushed the prefer-node-protocol-support-doc branch from 815ac33 to 7bfb3a2 Compare November 23, 2022 01:48
@bmish
Copy link
Sponsor Collaborator Author

bmish commented Nov 23, 2022

Sorry for the delay. Should be ready if still interested.

@sindresorhus sindresorhus merged commit 5bb563c into sindresorhus:main Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node: imports aren't supported in Node.js v14
3 participants