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

@@ -21,7 +21,9 @@ export type SlackChannelConfigResolved = {
function firstDefined<T>(...values: Array<T | undefined>) {
for (const value of values) {
if (typeof value !== "undefined") return value;
if (typeof value !== "undefined") {
return value;
}
}
return undefined;
}
@@ -36,13 +38,19 @@ export function shouldEmitSlackReactionNotification(params: {
}) {
const { mode, botId, messageAuthorId, userId, userName, allowlist } = params;
const effectiveMode = mode ?? "own";
if (effectiveMode === "off") return false;
if (effectiveMode === "off") {
return false;
}
if (effectiveMode === "own") {
if (!botId || !messageAuthorId) return false;
if (!botId || !messageAuthorId) {
return false;
}
return messageAuthorId === botId;
}
if (effectiveMode === "allowlist") {
if (!Array.isArray(allowlist) || allowlist.length === 0) return false;
if (!Array.isArray(allowlist) || allowlist.length === 0) {
return false;
}
const users = normalizeAllowListLower(allowlist);
return allowListMatches({
allowList: users,