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

@@ -125,7 +125,9 @@ export function getChatChannelMeta(id: ChatChannelId): ChatChannelMeta {
export function normalizeChatChannelId(raw?: string | null): ChatChannelId | null {
const normalized = normalizeChannelKey(raw);
if (!normalized) return null;
if (!normalized) {
return null;
}
const resolved = CHAT_CHANNEL_ALIASES[normalized] ?? normalized;
return CHAT_CHANNEL_ORDER.includes(resolved) ? resolved : null;
}
@@ -142,14 +144,18 @@ export function normalizeChannelId(raw?: string | null): ChatChannelId | null {
// monitors, web login, etc). The plugin registry must be initialized first.
export function normalizeAnyChannelId(raw?: string | null): ChannelId | null {
const key = normalizeChannelKey(raw);
if (!key) return null;
if (!key) {
return null;
}
const registry = requireActivePluginRegistry();
const hit = registry.channels.find((entry) => {
const id = String(entry.plugin.id ?? "")
.trim()
.toLowerCase();
if (id && id === key) return true;
if (id && id === key) {
return true;
}
return (entry.plugin.meta.aliases ?? []).some((alias) => alias.trim().toLowerCase() === key);
});
return hit?.plugin.id ?? null;