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

@@ -7,7 +7,9 @@ export type GatewayDiscoverOpts = {
};
export function parseDiscoverTimeoutMs(raw: unknown, fallbackMs: number): number {
if (raw === undefined || raw === null) return fallbackMs;
if (raw === undefined || raw === null) {
return fallbackMs;
}
const value =
typeof raw === "string"
? raw.trim()
@@ -17,7 +19,9 @@ export function parseDiscoverTimeoutMs(raw: unknown, fallbackMs: number): number
if (value === null) {
throw new Error("invalid --timeout");
}
if (!value) return fallbackMs;
if (!value) {
return fallbackMs;
}
const parsed = Number.parseInt(value, 10);
if (!Number.isFinite(parsed) || parsed <= 0) {
throw new Error(`invalid --timeout: ${value}`);
@@ -48,7 +52,9 @@ export function dedupeBeacons(beacons: GatewayBonjourBeacon[]): GatewayBonjourBe
String(b.port ?? ""),
String(b.gatewayPort ?? ""),
].join("|");
if (seen.has(key)) continue;
if (seen.has(key)) {
continue;
}
seen.add(key);
out.push(b);
}