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

@@ -201,11 +201,17 @@ async function promptDiscordAllowFrom(params: {
const parseInputs = (value: string) => parseDiscordAllowFromInput(value);
const parseId = (value: string) => {
const trimmed = value.trim();
if (!trimmed) return null;
if (!trimmed) {
return null;
}
const mention = trimmed.match(/^<@!?(\d+)>$/);
if (mention) return mention[1];
if (mention) {
return mention[1];
}
const prefixed = trimmed.replace(/^(user:|discord:)/i, "");
if (/^\d+$/.test(prefixed)) return prefixed;
if (/^\d+$/.test(prefixed)) {
return prefixed;
}
return null;
};
@@ -387,7 +393,9 @@ export const discordOnboardingAdapter: ChannelOnboardingAdapter = {
([guildKey, value]) => {
const channels = value?.channels ?? {};
const channelKeys = Object.keys(channels);
if (channelKeys.length === 0) return [guildKey];
if (channelKeys.length === 0) {
return [guildKey];
}
return channelKeys.map((channelKey) => `${guildKey}/${channelKey}`);
},
);
@@ -463,7 +471,9 @@ export const discordOnboardingAdapter: ChannelOnboardingAdapter = {
const channelKey =
entry.channelId ??
(entry.channelName ? normalizeDiscordSlug(entry.channelName) : undefined);
if (!channelKey && guildKey === "*") continue;
if (!channelKey && guildKey === "*") {
continue;
}
allowlistEntries.push({ guildKey, ...(channelKey ? { channelKey } : {}) });
}
next = setDiscordGroupPolicy(next, discordAccountId, "allowlist");