Skip to content

refactor: add node: protocol to imports #9703

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielbayley
Copy link

@danielbayley danielbayley commented Jun 30, 2025

I’m currently looking at cleaning things up a bit, and cutting down on some of the dependencies (e.g. replace rimraf with the builtin node rm implementation, à la e18e/ecosystem-issues#178 (comment)),

But it’s currently difficult to differentiate between node imports and external dependencies. This PR addresses that.

It might be worth considering adding an extra rule to the eslint config (https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md), or even https://biomejs.dev/linter/rules/use-nodejs-import-protocol, if #9740 goes ahead.

@zkochan
Copy link
Member

zkochan commented Jul 10, 2025

But it’s currently difficult to differentiate between node imports and external dependencies. This PR addresses that.

TBH, I don't understand what is the difficulty. There are like 3 or 4 standard libraries.

@danielbayley
Copy link
Author

TBH, I don't understand what is the difficulty. There are like 3 or 4 standard libraries.

It’s just much easier to sift through many files to analyse dependencies. Same logic also applies to imports being sorted in a consistent way, e.g. ESLint sort-imports, or Biome organize-imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants