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

fix(prefer-node-protocol): continue on version range check #206

Merged

Conversation

coderaiser
Copy link

@coderaiser coderaiser commented Mar 20, 2024

We have different supported versions range for node: protocol in ESM and CJS so it is better to also use continue here, it's more safe to make such transformations and also more clear.

image

`,
output: `
const fs = require("fs");
import buffer from 'node:buffer'
Copy link
Author

@coderaiser coderaiser Mar 20, 2024

Choose a reason for hiding this comment

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

node: protocol in CJS isn't supported in v12.20, but it is already supported in ESM, so only ESM fixed. Rare case but still possible with help of createRequire()

Copy link

@scagood scagood left a comment

Choose a reason for hiding this comment

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

💪

@scagood scagood changed the title Fix/prefer node protocol not first2 fix(prefer-node-protocol): continue on version range check Mar 20, 2024
@scagood scagood merged commit 14d2ea9 into eslint-community:master Mar 20, 2024
17 checks passed
@coderaiser coderaiser deleted the fix/prefer-node-protocol-not-first2 branch March 20, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants