# biome style/useNumberNamespace: fix changes program behavior

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: biome 2.5.15
- Rule: style/useNumberNamespace (tool labels the fix: safe, this fix reported as safe)
- Oracle: fix-changes-behavior
- Judge (Nemotron 3 Ultra, advisory): real, severity medium. The rule rewrites `parseInt` to `Number.parseInt` assuming `Number` refers to the global namespace, but the program declares a local variable `Number` that shadows it. After the fix, `Number.parseInt` attempts to access a property on the loop variable (a number), causing a TypeError. The documentation does not mention this shadowing scenario, so the fix is not safe for this construct.
- Program: minimized from 4 to 4 lines

## Reproducer

```js
for (var i = 0; i < 2; i++) {
  var Number = i;
  console.log(typeof parseInt('1'));
}
```

## Commands

```sh
node prog.js
bunx @biomejs/biome lint --only=style/useNumberNamespace --write prog.js
node prog.js
```

## Observed

```
stdout before:
number
number
stdout after:

exit 0 → 1
stderr before: (none)
stderr after: TypeError: Number.parseInt is not a function
```

## Diff applied by the fix

```diff
--- orig.js	2026-10-22 13:35:42.934304679 -0400
+++ fixed.js	2026-10-22 13:35:45.079340882 -0400
@@ -1,4 +1,4 @@
 for (var i = 0; i < 2; i++) {
   var Number = i;
-  console.log(typeof parseInt('1'));
+  console.log(typeof Number.parseInt('1'));
 }
```

## Why the rewrite is not equivalent (model draft, verify before use)

The variable declaration `var Number = i;` creates a local binding that shadows the global constructor `Number`. Inside the loop body, any reference to `Number` resolves to this local variable holding numeric values (`0` then `1`). Replacing `parseInt` with `Number.parseInt` attempts to access a method on those numbers, which do not possess such a property, causing a runtime type error whereas the original code correctly invoked the global `parseInt` function each iteration. This change alters observable behavior by introducing an exception where none existed before.

## Upstream search

Queries: "useNumberNamespace fix", "style/useNumberNamespace global variable shadowing", "parseInt call reassignment to local Number", "typeof check of built-in function after override"

- related: https://github.com/biomejs/biome/issues/1228
  same rule (useNumberNamespace) but tracking implementation, not this specific broken fix on shadowed Number
- related: https://github.com/biomejs/biome/issues/3578
  same rule (useNumberNamespace) but different construct (Infinity property vs parseInt method)
- related: https://github.com/biomejs/biome/issues/2075
  same rule (useNumberNamespace) but different construct (isNaN function vs parseInt method)

<details><summary>All hits</summary>

- [github, open] 💅 `noUnnecessaryConditions`: false positive on an overloaded call with `undefined` as the default argument (Vue `inject`) — https://github.com/biomejs/biome/issues/12040
- [github, open] 💅 `noSkippedTests` conditionally skip fix suggestion — https://github.com/biomejs/biome/issues/9295
- [github, open] 💅 useLiteralKeys flags `__proto__` in a computed member expression and offers an unsafe fix that conflicts with noProto — https://github.com/biomejs/biome/issues/10769
- [github, open] Extension chokes on large files — https://github.com/biomejs/biome/issues/3860
- [github, open] 💅 noLeakedRender false positive when using useState<boolean> — https://github.com/biomejs/biome/issues/10790
- [github, open] 💅 `lint/correctness/noUnusedImports` does not consider uses inside comments that precede non-declaration statements (start/end of file, etc.) — https://github.com/biomejs/biome/issues/8762
- [github, closed] 💅 `useSimplifiedLogicExpression` "safe" fix breaks code — https://github.com/biomejs/biome/issues/11351
- [github, closed] 💅 `useExplicitLengthCheck` false positive and broken fix — https://github.com/biomejs/biome/issues/11558
- [github, closed] 💅 Performance regression in noFloatingPromises in 2.5.6+ (and is still an issue in 2.5.11) — https://github.com/biomejs/biome/issues/11534
- [github, closed] 💅 noUselessTernary double space in quick fix — https://github.com/biomejs/biome/issues/11092
- [tavily] 📎 Implement `lint/useNumberNamespace` - `eslint-unicorn/prefer-number-properties` · Issue #1228 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/1228
- [tavily] 📝 Astro JSX-like syntax can't be parsed without errors · Issue #7871 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/7871
- [tavily] 🐛 `--write` applies fixes to all rules ignoring `--only` · Issue #3470 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/3470
- [tavily] 💅 Incorrect error message when type `Infinity` · Issue #3578 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/3578
- [tavily] 💅 Biome replaces isNan by Number.isNan, which is a different function · Issue #2075 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/2075
- [tavily] 💅 Biome encountered an unexpected error when setting noExplicitAny=off in an override in CLI · Issue #1349 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/1349
- [tavily] 🐛 LSP daemon initial scan never converges: AddedOrChanged(Index(InitialScan)) cascade re-indexes the same files forever at ~350% CPU · Issue #11520 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/11520
- [tavily] 💅 `noUselessUndefined` safe fix removes `= undefined` parameter defaults, changing `arguments` and `length` · Issue #11934 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/11934

</details>
