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

@@ -25,7 +25,9 @@ export function createBlockReplyCoalescer(params: {
let idleTimer: NodeJS.Timeout | undefined;
const clearIdleTimer = () => {
if (!idleTimer) return;
if (!idleTimer) {
return;
}
clearTimeout(idleTimer);
idleTimer = undefined;
};
@@ -37,7 +39,9 @@ export function createBlockReplyCoalescer(params: {
};
const scheduleIdleFlush = () => {
if (idleMs <= 0) return;
if (idleMs <= 0) {
return;
}
clearIdleTimer();
idleTimer = setTimeout(() => {
void flush({ force: false });
@@ -50,7 +54,9 @@ export function createBlockReplyCoalescer(params: {
resetBuffer();
return;
}
if (!bufferText) return;
if (!bufferText) {
return;
}
if (!options?.force && bufferText.length < minChars) {
scheduleIdleFlush();
return;
@@ -65,7 +71,9 @@ export function createBlockReplyCoalescer(params: {
};
const enqueue = (payload: ReplyPayload) => {
if (shouldAbort()) return;
if (shouldAbort()) {
return;
}
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
const text = payload.text ?? "";
const hasText = text.trim().length > 0;
@@ -74,7 +82,9 @@ export function createBlockReplyCoalescer(params: {
void onFlush(payload);
return;
}
if (!hasText) return;
if (!hasText) {
return;
}
if (
bufferText &&