A module that Node has built in is loaded by its bare name, without node:

tx0/ts:node-builtin-without-protocolstrictwarningstyle

What it finds

import fs from "fs" could also load a package named fs from node_modules in a bundler or another runtime; "node:fs" names the built-in module unmistakably and tells the reader it is part of Node.

Reported are imports, re-exports and require calls of the modules that Node has built in, by their bare names. The fix adds the node: prefix; it is unsafe, since older Node versions and some bundlers do not accept it.

From the rule's source, node_builtin_without_protocol.rs.

Example from the rule's tests
import fs from "fs";tx0 reports: fs is built inimport path from "node:path";import lodash from "lodash";const cp = require("child_process");tx0 reports: child_process is built inexport { readFile } from "fs/promises";tx0 reports: fs/promises is built inexport const all = [fs, path, lodash, cp];
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:node-builtin-without-protocol" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:node-builtin-without-protocol] reason="..."

tx0 explain tx0/ts:node-builtin-without-protocol shows the same in the terminal. Found a false positive? Report it.