repo
One command was observed. Code it does not exercise is not observed; "no difference" means the normalized output and exit status matched, not that the fix is correct.
12 enabled rule(s) already have a finding in the bank (7 more known-risk rules of biome are not enabled here)
style/noNegationElsefix breaks the build
- files changed
- 1: web/src/negate.js
- reduced to
- 1 of 1 hunk(s) in web/src/negate.js, 1 run(s); the patch was applied with git apply and reproduced the same difference
- sites reported
- 1 → 0 in 1 linted file(s)
Change (reduced)
--- a/web/src/negate.js +++ b/web/src/negate.js @@ -1,4 +1,3 @@ export function pick(ok, a, b) { - if (!ok) return a - else return b + if (ok) return b else return a }
Observed
stdout lines only before the fix:
# Subtest: pick
ok 3 - pick
# pass 5
# fail 0
stdout lines only after the fix:
# file:///w/web/src/negate.js:N
# if (ok) return b else return a
# ^^^^
# SyntaxError: Unexpected token 'else'
# at compileSourceTextModule (node:internal/modules/esm/utils:346:16)
# at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:146:18)
# at \#translate (node:internal/modules/esm/loader:497:12)
# at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:544:27)
# Node.js v20.20.0
# Subtest: /w/web/test/negate.test.js
not ok 3 - /w/web/test/negate.test.js
location: '/w/web/test/negate.test.js:N'
failureType: 'testCodeFailure'
exitCode: 1
signal: ~
error: 'test failed'
code: 'ERR_TEST_FAILURE'
# pass 4
# fail 1
exit 0 → 1Output after tail
failureType: 'testCodeFailure' exitCode: 1 signal: ~ error: 'test failed' code: 'ERR_TEST_FAILURE' ... # Subtest: parseAll adds the converter's value ok 4 - parseAll adds the converter's value --- duration_ms: 1.294294 ... # Subtest: util ok 5 - util --- duration_ms: 1.280512 ... 1..5 # tests 5 # suites 0 # pass 4 # fail 1 # cancelled 0 # skipped 0 # todo 0 # duration_ms 87.710965
Judge Nemotron 3 Ultra, advisory
The fix rewrites `if (!ok) return a; else return b;` to `if (ok) return b else return a`, which is invalid JavaScript syntax because an `else` clause cannot directly follow a single-statement `if` without braces. The original code parses and runs correctly, but the fixed code throws a SyntaxError at parse time, breaking the build.
Explanation Nemotron 3 Super, model draft
The rewrite changes control flow syntax incorrectly: `if (ok) return b else return a` lacks braces around the then-branch, causing JavaScript to parse `return b else return a` as invalid syntax due to unexpected `else`, breaking execution entirely whereas the original used valid guarded returns with explicit else block structure preserving semantics when syntactically correct. This is not a semantic preservation but a syntactic error introduction.
Upstream
Files
complexity/noUselessLoneBlockStatementsfix changes program behavior
- files changed
- 1: web/src/block.js
- reduced to
- 1 of 1 hunk(s) in web/src/block.js, 1 run(s); the patch was applied with git apply and reproduced the same difference
- sites reported
- 1 → 0 in 1 linted file(s)
Change (reduced)
--- a/web/src/block.js +++ b/web/src/block.js @@ -1,8 +1,6 @@ // Written without semicolons; the lone block keeps the next line from being read as an index expression. export function run(log) { const items = [1, 2] - { [0, 1].forEach((i) => log(items[i])) - } return log }
Observed
stdout lines only before the fix:
ok 1 - run logs both items
# pass 5
# fail 0
stdout lines only after the fix:
not ok 1 - run logs both items
location: '/w/web/test/block.test.js:N'
failureType: 'testCodeFailure'
error: '[1,2][(0 , 1)].forEach is not a function'
code: 'ERR_TEST_FAILURE'
name: 'TypeError'
stack: |-
run (file:///w/web/src/block.js:N)
TestContext.<anonymous> (file:///w/web/test/block.test.js:N)
Test.runInAsyncScope (node:async_hooks:206:9)
Test.run (node:internal/test_runner/test:796:25)
Test.processPendingSubtests (node:internal/test_runner/test:526:18)
node:internal/test_runner/harness:255:12
node:internal/process/task_queues:140:7
AsyncResource.runInAsyncScope (node:async_hooks:206:9)
AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
# pass 4
# fail 1
exit 0 → 1Output after tail
... # Subtest: pick ok 3 - pick --- duration_ms: 0.935234 ... # Subtest: parseAll adds the converter's value ok 4 - parseAll adds the converter's value --- duration_ms: 1.243567 ... # Subtest: util ok 5 - util --- duration_ms: 1.29201 ... 1..5 # tests 5 # suites 0 # pass 4 # fail 1 # cancelled 0 # skipped 0 # todo 0 # duration_ms 85.518223
Judge Nemotron 3 Ultra, advisory
The rule removes a lone block that was intentionally placed to prevent the following line starting with '[' from being parsed as a computed member access on the preceding array literal. Without the block, '[0, 1].forEach(...)' becomes '[1, 2][0, 1].forEach(...)', which is a property access yielding undefined, causing a TypeError. The documentation claims such blocks are unnecessary, but in ASI-free code they serve as statement separators, so the rewrite is not semantics-preserving.
Explanation Nemotron 3 Super, model draft
Removing the braces turns `[0, 1]` into part of the preceding statement due to JavaScript’s ASI rules: `const items = [1, 2] [0, 1].forEach(...)` parses as accessing property `[0, 1]` on the array `[1, 2]`, which yields `undefined` instead of calling `.forEach`. Thus the loop never runs and the test fails. The original block prevented this misinterpretation by delimiting the statement. Removing it changes the program’s parse tree and runtime behavior, so the rewrite is not semantics‑preserving.
Upstream
Files
style/useNumberNamespacefix changes program behavior
- files changed
- 1: web/src/parse.js
- reduced to
- 1 of 1 hunk(s) in web/src/parse.js, 1 run(s); the patch was applied with git apply and reproduced the same difference
- sites reported
- 1 → 0 in 1 linted file(s)
Change (reduced)
--- a/web/src/parse.js +++ b/web/src/parse.js @@ -1,4 +1,4 @@ // Parse string values with a caller-supplied converter for the non-integer part. export function parseAll(values, Number) { - return values.map((v) => parseInt(v, 10) + Number(v)); + return values.map((v) => Number.parseInt(v, 10) + Number(v)); }
Observed
stdout lines only before the fix:
ok 4 - parseAll adds the converter's value
# pass 5
# fail 0
stdout lines only after the fix:
not ok 4 - parseAll adds the converter's value
location: '/w/web/test/parse.test.js:N'
failureType: 'testCodeFailure'
error: 'Number.parseInt is not a function'
code: 'ERR_TEST_FAILURE'
name: 'TypeError'
stack: |-
file:///w/web/src/parse.js:N
Array.map (<anonymous>)
parseAll (file:///w/web/src/parse.js:N)
TestContext.<anonymous> (file:///w/web/test/parse.test.js:N)
Test.runInAsyncScope (node:async_hooks:206:9)
Test.run (node:internal/test_runner/test:796:25)
Test.processPendingSubtests (node:internal/test_runner/test:526:18)
node:internal/test_runner/harness:255:12
node:internal/process/task_queues:140:7
AsyncResource.runInAsyncScope (node:async_hooks:206:9)
# pass 4
# fail 1
exit 0 → 1Output after tail
file:///w/web/src/parse.js:3:35
Array.map (<anonymous>)
parseAll (file:///w/web/src/parse.js:3:17)
TestContext.<anonymous> (file:///w/web/test/parse.test.js:6:20)
Test.runInAsyncScope (node:async_hooks:206:9)
Test.run (node:internal/test_runner/test:796:25)
Test.processPendingSubtests (node:internal/test_runner/test:526:18)
node:internal/test_runner/harness:255:12
node:internal/process/task_queues:140:7
AsyncResource.runInAsyncScope (node:async_hooks:206:9)
...
# Subtest: util
ok 5 - util
---
duration_ms: 1.280412
...
1..5
# tests 5
# suites 0
# pass 4
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 85.20992Judge Nemotron 3 Ultra, advisory
The rule rewrites the global `parseInt` to `Number.parseInt`, but the function parameter is also named `Number`, shadowing the global `Number` namespace. After the fix, `Number.parseInt` resolves to the parameter (a function), which lacks a `parseInt` property, causing a TypeError. The documentation does not mention this shadowing scenario, so the fix is not safe for this construct.
Explanation Nemotron 3 Super, model draft
The original code calls the parameter `Number` as a function to convert each value’s fractional part; this relies on the caller providing a suitable converter. After rewriting, it attempts to call `Number.parseInt`, which accesses a property of the global built‑in `Number` object rather than the passed‑in argument. Since the test supplies a plain number or other non‑object as the second argument, `Number.parseInt` does not exist, causing a TypeError where the original succeeded. Thus the change alters behavior when the injected `Number` is not the global constructor.
Upstream
Files
style/noUselessElsefix breaks the build
- files changed
- 3: web/src/branch.js, web/src/negate.js, web/src/util.js
- reduced to
- 1 of 3 hunk(s) in web/src/branch.js, 5 run(s); the patch was applied with git apply and reproduced the same difference
- sites reported
- 3 → 0 in 3 linted file(s)
Change (reduced)
--- a/web/src/branch.js +++ b/web/src/branch.js @@ -2,8 +2,7 @@ let text = "none"; if (n > 0) { return "positive"; - } else { + } let text = "non-positive"; return text; - } }
Observed
stdout lines only before the fix:
# Subtest: label
ok 2 - label
# pass 5
# fail 0
stdout lines only after the fix:
# file:///w/web/src/branch.js:N
# let text = "non-positive";
# ^
# SyntaxError: Identifier 'text' has already been declared
# at compileSourceTextModule (node:internal/modules/esm/utils:346:16)
# at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:146:18)
# at \#translate (node:internal/modules/esm/loader:497:12)
# at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:544:27)
# Node.js v20.20.0
# Subtest: /w/web/test/branch.test.js
not ok 2 - /w/web/test/branch.test.js
location: '/w/web/test/branch.test.js:N'
failureType: 'testCodeFailure'
exitCode: 1
signal: ~
error: 'test failed'
code: 'ERR_TEST_FAILURE'
# pass 4
# fail 1
exit 0 → 1Output after tail
... # Subtest: pick ok 3 - pick --- duration_ms: 0.935766 ... # Subtest: parseAll adds the converter's value ok 4 - parseAll adds the converter's value --- duration_ms: 1.267664 ... # Subtest: util ok 5 - util --- duration_ms: 1.244429 ... 1..5 # tests 5 # suites 0 # pass 4 # fail 1 # cancelled 0 # skipped 0 # todo 0 # duration_ms 87.322452
Judge Nemotron 3 Ultra, advisory
The fix hoists the `let text` declaration from the `else` block into the outer scope where `let text = "none"` already exists, creating a duplicate declaration that makes the file fail to parse. The documentation presents the rewrite as equivalent but does not account for variable shadowing across the removed block boundary.
Explanation Nemotron 3 Super, model draft
The rewrite moves `let text = \"non-positive\";` outside the `else` block, causing it to execute unconditionally when `n <= 0`. Since `let text = \"none\"` was already declared in the same scope, this creates a duplicate declaration of `text`, which is invalid in JavaScript and results in a syntax error during module parsing—changing behavior from successful execution to immediate failure.
Upstream
Files
Applied without a difference
1 rule(s) changed 2 file(s) with no difference under the command, applied together. accepted.patch applies with git apply -p1. style/useConst