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

Use node: protocol for all builtin imports (fs, path, etc.) #4149

Open
Tracked by #2964
nolanlawson opened this issue Apr 15, 2024 · 1 comment
Open
Tracked by #2964

Use node: protocol for all builtin imports (fs, path, etc.) #4149

nolanlawson opened this issue Apr 15, 2024 · 1 comment

Comments

@nolanlawson
Copy link
Contributor

We should use an ESLint plugin like prefer-node-protocol and ensure we're always doing this:

import fs from 'node:fs'

instead of this:

import fs from 'fs'

The node: protocol is clearer, more portable, and less likely to conflict with any accidental non-builtins (e.g. assert).

This has some mild Node compat issues, but since we probably only support Node 16+ anyway, we can probably safely do this. (Or we can do this in a major version bump and then be explicit about our supported Node version.)

@nolanlawson nolanlawson added Up for grabs Issues that are relatively small, self-contained, and ready for implementation enhancement labels Apr 15, 2024
@nolanlawson nolanlawson removed the Up for grabs Issues that are relatively small, self-contained, and ready for implementation label Apr 15, 2024
@nolanlawson
Copy link
Contributor Author

Removed up for grabs because this is a breaking change so probably requires a lot of care and thought.

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

No branches or pull requests

1 participant