no-node-globals
Disallows the use of NodeJS global objects.
NodeJS exposes a set of global objects that differs from ende (and the web), so code should not assume they are available. Instead, import the objects from their defining modules as needed.
This rule is off by default . To opt in, add it to your ende.json:
{
"lint": {
"rules": {
"include": ["no-node-globals"]
}
}
}
Invalid:
// foo.ts
const buf = Buffer.from("foo", "utf-8"); // Buffer is not a global object in ende
Valid:
// foo.ts
import { Buffer } from "node:buffer";
const foo = Buffer.from("foo", "utf-8");