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

@@ -50,9 +50,13 @@ export async function removeOwnReactionsDiscord(
const identifiers = new Set<string>();
for (const reaction of message.reactions ?? []) {
const identifier = buildReactionIdentifier(reaction.emoji);
if (identifier) identifiers.add(identifier);
if (identifier) {
identifiers.add(identifier);
}
}
if (identifiers.size === 0) {
return { ok: true, removed: [] };
}
if (identifiers.size === 0) return { ok: true, removed: [] };
const removed: string[] = [];
await Promise.allSettled(
Array.from(identifiers, (identifier) => {
@@ -78,7 +82,9 @@ export async function fetchReactionsDiscord(
}>;
};
const reactions = message.reactions ?? [];
if (reactions.length === 0) return [];
if (reactions.length === 0) {
return [];
}
const limit =
typeof opts.limit === "number" && Number.isFinite(opts.limit)
? Math.min(Math.max(Math.floor(opts.limit), 1), 100)
@@ -87,7 +93,9 @@ export async function fetchReactionsDiscord(
const summaries: DiscordReactionSummary[] = [];
for (const reaction of reactions) {
const identifier = buildReactionIdentifier(reaction.emoji);
if (!identifier) continue;
if (!identifier) {
continue;
}
const encoded = encodeURIComponent(identifier);
const users = (await rest.get(Routes.channelMessageReaction(channelId, messageId, encoded), {
limit,