Skip to main content

no-process-globals

NOTE: this rule is part of the recommended rule set.
Enable full set in deno.json:
{
  "lint": {
    "tags": ["recommended"]
  }
}
Enable full set using the Deno CLI:
deno lint --tags=recommended

Disallows the use of NodeJS process global.

NodeJS and Deno expose process global but they are hard to statically analyze by tools, so code should not assume they are available. Instead, import process from "node:process".

Invalid:

// foo.ts
const foo = process.env.FOO;

Valid:

// foo.ts
import process from "node:process";

const foo = process.env.FOO;

Did you find what you needed?

Privacy policy