fixhunt

biome correctness/noProcessGlobal

labelled safe
Runs / 2026-10-17T20-45-09-321Z-2mqm-biome-correctness_noProcessGlobalbiome 2.5.152026-10-17 20:45 UTC8 programs × 2 round(s)13 programs, 6 fired, 6 fixed, 0 findings, 1 rejectedmodel cost $0.0025

Analysis Nemotron 3 Super

Flags any direct reference to the `process` global variable.

Fix: Replaces every occurrence of the identifier `process` with an imported binding by adding `import process from 'node:process';` at the top of the file (if not already present) and rewriting the reference to use that imported binding.

8 hazards
  • Replacing `process` in a catch clause like `catch (process)` would rename the exception parameter, altering what is caught.
  • If a local variable named `process` is declared later in the same scope, the import would hoist above it and cause the local variable to shadow the import instead of the global, changing runtime behavior.
  • When `process` is used as a label (e.g., `process: break process;`), the rewrite would break syntax because labels cannot be replaced with imported identifiers.
  • In indirect eval calls such as `eval('process.env')`, the string is not rewritten, so the eval would still resolve to the global `process` if it exists, diverging from the direct-reference behavior.
  • If the file already contains an import named `process` from a different source (e.g., `import process from './local-process'`), adding another import would cause a duplicate identifier error.
  • When `process` is accessed via destructuring with a default value like `{process = fallback} = obj`, the rewrite would fail to produce valid syntax.
  • Comments attached to the `process` token (e.g., `process/* TODO */.env`) would be lost because the autofix replaces the entire token without preserving trailing or inline comments.
  • In non-ESM environments where `import` statements are not supported (e.g., CommonJS without `type: module`), inserting the import would cause a parse error or runtime failure.

Programs

idresulttitlehazard
r1-p001silent prediction offLabel usage breaks syntax when replacedWhen `process` is used as a label (e.g., `process: break process;`), the rewrite would break syntax because labels cannot be replaced with imported identifiers.
r1-p002silent prediction offTemporal dead zone after hoisting/reorderingtemporal dead zone after code is hoisted or reordered
r1-p004silent prediction offVar hoisting and redeclaration inside loopsvar hoisting and re-declaration inside loops or after use
r1-p005silent prediction offCatch clause parameter renamed alters exception handlingReplacing `process` in a catch clause like `catch (process)` would rename the exception parameter, altering what is caught.
r1-p006silent prediction offLocal variable later shadows imported bindingIf a local variable named `process` is declared later in the same scope, the import would hoist above it and cause the local variable to shadow the import instead of the global, changing runtime behav
r1-p007fix okInline comments attached to token are lostComments attached to the `process` token (e.g., `process/* TODO */.env`) would be lost because the autofix replaces the entire token without preserving trailing or inline comments.
r1-p008fix okFunction declarations inside blocks/switch/labeled statementsfunction declarations inside blocks, switch cases, labeled statements
r2-p001fix okClass field referencing processclass fields, static blocks, private names, super calls
r2-p002fix okInline comment on process tokenComments attached to the `process` token (e.g., `process/* TODO */.env`) would be lost because the autofix replaces the entire token without preserving trailing or inline comments.
r2-p003fix okFunction declaration in switch casefunction declarations inside blocks, switch cases, labeled statements
r2-p005silent prediction offLocal variable process declared after useIf a local variable named `process` is declared later in the same scope, the import would hoist above it and cause the local variable to shadow the import instead of the global, changing runtime behav
r2-p006fix okCommonJS environment without ES modulesIn non-ESM environments where `import` statements are not supported (e.g., CommonJS without `type: module`), inserting the import would cause a parse error or runtime failure.
r2-p008invalidStrict mode function using processstrict vs sloppy mode semantics

Sources

r1-p001 · Label usage breaks syntax when replaced
1process: {
2 console.log('inside label block');
3 break process;
4}
5console.log('after label');
inside label block
after label
r1-p002 · Temporal dead zone after hoisting/reordering
1console.log(typeof process); // should be 'object' before fix
2let process = { version: 'local' };
3console.log(process.version);
r1-p004 · Var hoisting and redeclaration inside loops
1for (var i = 0; i < 2; i++) {
2 if (typeof process === 'undefined') console.log('undef');
3 else console.log(process.version);
4 var process = { version: 'loop' + i };
5}
undef
loop0
r1-p005 · Catch clause parameter renamed alters exception handling
1try {
2 throw { message: 'test' };
3} catch (process) {
4 console.log('caught:', process.message);
5}
6console.log('after catch');
caught: test
after catch
r1-p006 · Local variable later shadows imported binding
1if (true) {
2 console.log(process.version); // expects global
3 let process = { version: 'local' };
4 console.log(process.version);
5}
r1-p007 · Inline comments attached to token are lost
1console.log(process/* version */.version);
2console.log('done');
--- orig.js	2026-10-17 16:45:18.826564821 -0400
+++ fixed.js	2026-10-17 16:45:19.131573203 -0400
@@ -1,2 +1,3 @@
+import process from "node:process";
 console.log(process/* version */.version);
 console.log('done');
v26.8.1
done
r1-p008 · Function declarations inside blocks/switch/labeled statements
1switch (1) {
2 case 1:
3 function process() { return 'func'; }
4 console.log(process());
5 break;
6}
7console.log(typeof process);
--- orig.js	2026-10-17 16:45:19.316578284 -0400
+++ fixed.js	2026-10-17 16:45:19.596585973 -0400
@@ -1,3 +1,4 @@
+import process from "node:process";
 switch (1) {
   case 1:
     function process() { return 'func'; }
func
object
r2-p001 · Class field referencing process
1class C {
2 static #p = process;
3 static {
4 console.log(C.#p === process ? 'same' : 'diff');
5 }
6}
--- orig.js	2026-10-17 16:45:23.981706046 -0400
+++ fixed.js	2026-10-17 16:45:24.254713496 -0400
@@ -1,3 +1,4 @@
+import process from "node:process";
 class C {
   static #p = process;
   static {
same
r2-p002 · Inline comment on process token
1console.log(process/* TODO */.env.NODE_ENV ?? 'unset');
--- orig.js	2026-10-17 16:45:24.428718244 -0400
+++ fixed.js	2026-10-17 16:45:24.695725530 -0400
@@ -1 +1,2 @@
+import process from "node:process";
 console.log(process/* TODO */.env.NODE_ENV ?? 'unset');
unset
r2-p003 · Function declaration in switch case
1switch (1) {
2 case 1:
3 function f() { return process.pid; }
4 console.log(f());
5 break;
6}
--- orig.js	2026-10-17 16:45:24.882730632 -0400
+++ fixed.js	2026-10-17 16:45:25.153738022 -0400
@@ -1,3 +1,4 @@
+import process from "node:process";
 switch (1) {
   case 1:
     function f() { return process.pid; }
2
r2-p005 · Local variable process declared after use
1console.log(typeof process);
2var process = 42;
undefined
r2-p006 · CommonJS environment without ES modules
1console.log(process.pid);
--- orig.js	2026-10-17 16:45:25.570749386 -0400
+++ fixed.js	2026-10-17 16:45:25.837756662 -0400
@@ -1 +1,2 @@
+import process from "node:process";
 console.log(process.pid);
2
r2-p008 · Strict mode function using process (generated program is not deterministic)
1"use strict";
2(function() {
3 console.log(process.uptime());
4})();