chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -27,7 +27,9 @@ const lanes = new Map<string, LaneState>();
function getLaneState(lane: string): LaneState {
const existing = lanes.get(lane);
if (existing) return existing;
if (existing) {
return existing;
}
const created: LaneState = {
lane,
queue: [],
@@ -41,7 +43,9 @@ function getLaneState(lane: string): LaneState {
function drainLane(lane: string) {
const state = getLaneState(lane);
if (state.draining) return;
if (state.draining) {
return;
}
state.draining = true;
const pump = () => {
@@ -130,7 +134,9 @@ export function enqueueCommand<T>(
export function getQueueSize(lane: string = CommandLane.Main) {
const resolved = lane.trim() || CommandLane.Main;
const state = lanes.get(resolved);
if (!state) return 0;
if (!state) {
return 0;
}
return state.queue.length + state.active;
}
@@ -145,7 +151,9 @@ export function getTotalQueueSize() {
export function clearCommandLane(lane: string = CommandLane.Main) {
const cleaned = lane.trim() || CommandLane.Main;
const state = lanes.get(cleaned);
if (!state) return 0;
if (!state) {
return 0;
}
const removed = state.queue.length;
state.queue.length = 0;
return removed;