no-process-global
NOTE: this rule is part of the
recommended
rule set.Enable full set in
deno.json
:{ "lint": { "rules": { "tags": ["recommended"] } } }
Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include
or exclude
array in deno.json
:{ "lint": { "rules": { "include": ["no-process-global"], "exclude": ["no-process-global"] } } }
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;