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

Rule suggestion: prefer node: prefixed imports when possible #344

Open
JoshuaKGoldberg opened this issue Oct 2, 2022 · 0 comments
Open

Comments

@JoshuaKGoldberg
Copy link

Older built-in Node modules such as fs now can be imported via either their name or node: + their name:

import fs from "fs";
import fs from "node:fs";

The prefixed versions are nice because they can't be overridden by user modules and are similarly formatted to to prefix-only modules such as node:test.

Suggestion: let's add a linter rule to enforce using them, with an auto-fixer?

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

No branches or pull requests

1 participant