Skip to content

unicorn/prefer-node-protocol Restriction

🛠️ An auto-fix is available for this rule.

What it does

Prefer using the node:protocol when importing Node.js builtin modules

Example

Examples of incorrect code for this rule:

javascript
import fs from "fs";

Examples of correct code for this rule:

javascript
import fs from "node:fs";

References

Released under the MIT License.