Skip to content

feature: prefer-node-protocol #96

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

Closed
benmccann opened this issue Jun 25, 2024 · 6 comments
Closed

feature: prefer-node-protocol #96

benmccann opened this issue Jun 25, 2024 · 6 comments

Comments

@benmccann
Copy link

We're using eslint-plugin-unicorn for a single rule that would make sense to have in this plugin:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md

I'd love to switch to this plugin since it has half as many dependencies. See https://npmgraph.js.org/?q=eslint-plugin-unicorn vs https://npmgraph.js.org/?q=eslint-plugin-import-x (and maybe we could cut it in half again if removing globby from @typescript-eslint/typescript-estree)

@benmccann
Copy link
Author

It should also be noted that this rule is highly requested in the eslint-plugin-import repo: import-js#2717

@benmccann
Copy link
Author

It would be nice to use module.isBuiltin for this, but that would be a breaking change as it got added in node 16.17.0 and 18.6.0 (npm/normalize-package-data#224)

@benmccann
Copy link
Author

There's already a no-nodejs-modules rule. I guess this should have somewhat similar code

@SukkaW
Copy link
Collaborator

SukkaW commented Jun 29, 2024

I also hate loads of transitive dependencies eslint-plugin-unicorn is introducing.

But I notice that the prefer-node-protocol rule is also available in the eslint-plugin-n: https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/rules/prefer-node-protocol.js and it is also a lightweight eslint plugin with rules specific designed for Node.js.

@SukkaW
Copy link
Collaborator

SukkaW commented Jun 29, 2024

As for the globby inside @typescript-eslint/estree, I've created a proposal here: typescript-eslint/typescript-eslint#9453. Please vote on the proposal!

@benmccann
Copy link
Author

Oh, wow! I wish I knew about that earlier 😆 Thanks for letting me know!

Okay, closing in favor of: https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-node-protocol.md

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 a pull request may close this issue.

2 participants