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

@@ -13,7 +13,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
const handleReactionEvent = async (event: SlackReactionEvent, action: string) => {
try {
const item = event.item;
if (!item || item.type !== "message") return;
if (!item || item.type !== "message") {
return;
}
const channelInfo = item.channel ? await ctx.resolveChannelName(item.channel) : {};
const channelType = channelInfo?.type;
@@ -54,7 +56,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
ctx.app.event(
"reaction_added",
async ({ event, body }: SlackEventMiddlewareArgs<"reaction_added">) => {
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
if (ctx.shouldDropMismatchedSlackEvent(body)) {
return;
}
await handleReactionEvent(event as SlackReactionEvent, "added");
},
);
@@ -62,7 +66,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
ctx.app.event(
"reaction_removed",
async ({ event, body }: SlackEventMiddlewareArgs<"reaction_removed">) => {
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
if (ctx.shouldDropMismatchedSlackEvent(body)) {
return;
}
await handleReactionEvent(event as SlackReactionEvent, "removed");
},
);