Skip to content

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

@nolanlawson

Description

@nolanlawson

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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions