# biome complexity/noUselessLoneBlockStatements on repo: fix changes the outcome of the project's command

Evidence sheet generated by fixhunt from a repository scan. 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 (fix labelled safe)
- Project: /home/sun/dev/diaghunt/demo/repo
- Command: `cd web && node --test` (exit 0 before, 1 after)
- Files changed by the fix: 1; reduced to 1 of 1 hunk(s) in web/src/block.js (delta debugging complete; the patch below was applied with git apply and reproduced the same difference)
- Sites reported by the rule in 1 changed file(s): 1 before, 0 after the fix
- Judge (Nemotron 3 Ultra, advisory): real, severity high. 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.

## Change (reduced; applies to the project with `git apply -p1`)

```diff
--- 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 → 1
```

## Output of the command (last 40 lines)

Before:

```
TAP version 13
# Subtest: run logs both items
ok 1 - run logs both items
  ---
  duration_ms: 1.249256
  ...
# Subtest: label
ok 2 - label
  ---
  duration_ms: 0.928985
  ...
# Subtest: pick
ok 3 - pick
  ---
  duration_ms: 0.924077
  ...
# Subtest: parseAll adds the converter's value
ok 4 - parseAll adds the converter's value
  ---
  duration_ms: 1.250568
  ...
# Subtest: util
ok 5 - util
  ---
  duration_ms: 1.304258
  ...
1..5
# tests 5
# suites 0
# pass 5
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 84.622619
```

After:

```
  stack: |-
    run (file:///w/web/src/block.js:4:12)
    TestContext.<anonymous> (file:///w/web/test/block.test.js:7:3)
    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)
  ...
# Subtest: label
ok 2 - label
  ---
  duration_ms: 0.915694
  ...
# 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
```

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

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 search

Queries: "noUselessLoneBlockStatements fix", "complexity/noUselessLoneBlockStatements array literal call", "noUselessLoneBlockStatements bracket notation method invocation", "lone block statement array access pattern"

- duplicate: https://github.com/biomejs/biome/issues/11935
- related: https://github.com/biomejs/biome/issues/834
- related: https://github.com/biomejs/biome/issues/8685
- related: https://github.com/biomejs/biome/issues/39

## Reproduce

```sh
# /home/sun/dev/diaghunt/demo/repo: apply the change above (minimal.patch), then run the command
git apply -p1 minimal.patch
cd web && node --test
# or run the fixer itself on the changed files
bunx @biomejs/biome lint --only=complexity/noUselessLoneBlockStatements --write 'web/src/block.js'
```
