fixhunt

biome style/noUselessElse

labelled safe
Runs / 2026-10-17T19-31-04-008Z-biome-style_noUselessElsebiome 2.5.152026-10-17 19:31 UTC8 programs × 1 round(s)8 programs, 6 fired, 6 fixed, 0 findings, 1 rejectedmodel cost $0.0010

Programs

idresulttitlehazard
r1-p001silent prediction offTemporal Dead Zone - Else Removal Exposes Premature Accesstemporal dead zone
r1-p002fix ok__proto__ Key Conflict After Else Lifting__proto__ keys, prototype access, Object.assign vs spread
r1-p003fix okAsync Await Promise Order Changed by Control Flowasync/await, promise ordering, generators and yield position
r1-p004fix okLabel Break Interaction With Lifted Else Blocklabel/break/continue control flow, finally blocks, early returns in nested blocks
r1-p005fix okSparse Array Hole Preservation Depends On Else Executionsparse arrays, holes, Array(n) vs [n], array-likes
r1-p006invalidNumeric Coercion Side Effect In Else Block Expressionnumeric/string coercion: + vs template literal, String(x) vs ${x}, Symbol, BigInt, objects with toString/valueOf
r1-p007fix okStrict Mode This Value Captured By Closure In Elsestrict vs sloppy mode semantics (this, octal, duplicate params, with)
r1-p008fix okException Thrown In Else Changes Control Flow After Fixexceptions thrown inside the code the fix removes or rewrites

Sources

r1-p001 · Temporal Dead Zone - Else Removal Exposes Premature Access
1function f() {
2 if (false) {}
3 else {
4 console.log(a);
5 const a = 1;
6 }
7}
r1-p002 · __proto__ Key Conflict After Else Lifting
1function f(obj) {
2 if (!obj) return;
3 else {
4 obj.__proto__ = null;
5 return obj;
6 }
7}
8console.log(f({a:1})['a']);
--- orig.js	2026-10-17 15:31:08.736251088 -0400
+++ fixed.js	2026-10-17 15:31:09.005265676 -0400
@@ -1,8 +1,7 @@
 function f(obj) {
   if (!obj) return;
-  else {
+  
     obj.__proto__ = null;
     return obj;
-  }
 }
 console.log(f({a:1})['a']);
1
r1-p003 · Async Await Promise Order Changed by Control Flow
1async function f() {
2 if (true) return await Promise.resolve(1);
3 else {
4 console.log('skipped');
5 return 2;
6 }
7}
8f().then(console.log);
--- orig.js	2026-10-17 15:31:09.153273657 -0400
+++ fixed.js	2026-10-17 15:31:09.416287839 -0400
@@ -1,8 +1,7 @@
 async function f() {
   if (true) return await Promise.resolve(1);
-  else {
+  
     console.log('skipped');
     return 2;
-  }
 }
 f().then(console.log);
1
r1-p004 · Label Break Interaction With Lifted Else Block
1outer: {
2 if (false) break outer;
3 else {
4 console.log('else');
5 break outer;
6 }
7}
8console.log('done');
--- orig.js	2026-10-17 15:31:09.584296898 -0400
+++ fixed.js	2026-10-17 15:31:09.844310917 -0400
@@ -1,8 +1,7 @@
 outer: {
   if (false) break outer;
-  else {
+  
     console.log('else');
     break outer;
-  }
 }
 console.log('done');
else
done
r1-p005 · Sparse Array Hole Preservation Depends On Else Execution
1function f() {
2 if (true) return [,1];
3 else {
4 return [2,];
5 }
6}
7console.log(JSON.stringify(f()));
--- orig.js	2026-10-17 15:31:10.009319812 -0400
+++ fixed.js	2026-10-17 15:31:10.266333589 -0400
@@ -1,7 +1,6 @@
 function f() {
   if (true) return [,1];
-  else {
+  
     return [2,];
-  }
 }
 console.log(JSON.stringify(f()));
[null,1]
r1-p006 · Numeric Coercion Side Effect In Else Block Expression (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T19-31-0)
1let x = { valueOf: () => { console.log('coerced'); return 0; } };
2if (true) return;
3else {
4 console.log(+x);
5}
6console.log('end');
r1-p007 · Strict Mode This Value Captured By Closure In Else
1"use strict";
2function f() {
3 if (true) return;
4 else {
5 return function() { console.log(this); };
6 }
7}
8const g = f();
9g && g();
--- orig.js	2026-10-17 15:31:10.454343668 -0400
+++ fixed.js	2026-10-17 15:31:10.687356158 -0400
@@ -1,9 +1,8 @@
 "use strict";
 function f() {
   if (true) return;
-  else {
+  
     return function() { console.log(this); };
-  }
 }
 const g = f();
 g && g();
r1-p008 · Exception Thrown In Else Changes Control Flow After Fix
1function f() {
2 if (true) return;
3 else {
4 throw new Error('trapped');
5 }
6}
7try { f(); } catch(e) { console.log(e.name); }
--- orig.js	2026-10-17 15:31:10.838364253 -0400
+++ fixed.js	2026-10-17 15:31:11.079377148 -0400
@@ -1,7 +1,6 @@
 function f() {
   if (true) return;
-  else {
+  
     throw new Error('trapped');
-  }
 }
 try { f(); } catch(e) { console.log(e.name); }