Prefer to add "node:" prefix to require() which imports Node.js built-in module

Created on 9 September 2024, 7 months ago
Updated 17 September 2024, 7 months ago

Problem/Motivation

At present, require() which imports Node.js built-in module like "fs" is written require('fs').
Current Node.js supports "node:" import which identifies Node built-in module clearly.
The Node.js native test runner must needs "node:" prefix when it import. New Node.js built-in modules may require "node:" when it import in near the future.

FYI: eslint-plugin-unicorn can enforce "node:" prefix to require() which imports Node.js built-in module. (Ref)

Proposed resolution

Add "node:" prefix to all of require() which import Node.js builtin module such as util, fs, path and so on.

Merge request link

Remaining tasks

User interface changes

No.

API changes

No.

Data model changes

No.

Release notes snippet

πŸ“Œ Task
Status

Needs review

Version

11.0 πŸ”₯

Component
JavascriptΒ  β†’

Last updated 4 days ago

Created by

πŸ‡―πŸ‡΅Japan tom konda Kanagawa, Japan

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024