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

@@ -11,7 +11,9 @@ const isStringArray = (value: unknown): value is string[] =>
function normalizeCapabilities(capabilities: CapabilitiesConfig | undefined): string[] | undefined {
// Handle object-format capabilities (e.g., { inlineButtons: "dm" }) gracefully.
// Channel-specific handlers (like resolveTelegramInlineButtonsScope) process these separately.
if (!isStringArray(capabilities)) return undefined;
if (!isStringArray(capabilities)) {
return undefined;
}
const normalized = capabilities.map((entry) => entry.trim()).filter(Boolean);
return normalized.length > 0 ? normalized : undefined;
}
@@ -23,7 +25,9 @@ function resolveAccountCapabilities(params: {
accountId?: string | null;
}): string[] | undefined {
const cfg = params.cfg;
if (!cfg) return undefined;
if (!cfg) {
return undefined;
}
const normalizedAccountId = normalizeAccountId(params.accountId);
const accounts = cfg.accounts;
@@ -51,7 +55,9 @@ export function resolveChannelCapabilities(params: {
}): string[] | undefined {
const cfg = params.cfg;
const channel = normalizeChannelId(params.channel);
if (!cfg || !channel) return undefined;
if (!cfg || !channel) {
return undefined;
}
const channelsConfig = cfg.channels as Record<string, unknown> | undefined;
const channelConfig = (channelsConfig?.[channel] ?? (cfg as Record<string, unknown>)[channel]) as