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

@@ -181,7 +181,9 @@ const stopGatewayInstance = async (inst: GatewayInstance) => {
}
const exited = await Promise.race([
new Promise<boolean>((resolve) => {
if (inst.child.exitCode !== null) return resolve(true);
if (inst.child.exitCode !== null) {
return resolve(true);
}
inst.child.once("exit", () => resolve(true));
}),
sleep(5_000).then(() => false),
@@ -299,17 +301,23 @@ const connectNode = async (
commands: ["system.run"],
deviceIdentity,
onHelloOk: () => {
if (settled) return;
if (settled) {
return;
}
settled = true;
resolveReady?.();
},
onConnectError: (err) => {
if (settled) return;
if (settled) {
return;
}
settled = true;
rejectReady?.(err);
},
onClose: (code, reason) => {
if (settled) return;
if (settled) {
return;
}
settled = true;
rejectReady?.(new Error(`gateway closed (${code}): ${reason}`));
},
@@ -341,7 +349,9 @@ const waitForNodeStatus = async (inst: GatewayInstance, nodeId: string, timeoutM
},
)) as NodeListPayload;
const match = list.nodes?.find((n) => n.nodeId === nodeId);
if (match?.connected && match?.paired) return;
if (match?.connected && match?.paired) {
return;
}
await sleep(50);
}
throw new Error(`timeout waiting for node status for ${nodeId}`);