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

@@ -49,7 +49,9 @@ export async function resolveSlackMedia(params: {
const files = params.files ?? [];
for (const file of files) {
const url = file.url_private_download ?? file.url_private;
if (!url) continue;
if (!url) {
continue;
}
try {
// Note: We ignore init options because fetchWithSlackAuth handles
// redirect behavior specially. fetchRemoteMedia only passes the URL.
@@ -63,7 +65,9 @@ export async function resolveSlackMedia(params: {
fetchImpl,
filePathHint: file.name,
});
if (fetched.buffer.byteLength > params.maxBytes) continue;
if (fetched.buffer.byteLength > params.maxBytes) {
continue;
}
const saved = await saveMediaBuffer(
fetched.buffer,
fetched.contentType ?? file.mimetype,
@@ -99,7 +103,9 @@ export async function resolveSlackThreadStarter(params: {
}): Promise<SlackThreadStarter | null> {
const cacheKey = `${params.channelId}:${params.threadTs}`;
const cached = THREAD_STARTER_CACHE.get(cacheKey);
if (cached) return cached;
if (cached) {
return cached;
}
try {
const response = (await params.client.conversations.replies({
channel: params.channelId,
@@ -109,7 +115,9 @@ export async function resolveSlackThreadStarter(params: {
})) as { messages?: Array<{ text?: string; user?: string; ts?: string; files?: SlackFile[] }> };
const message = response?.messages?.[0];
const text = (message?.text ?? "").trim();
if (!message || !text) return null;
if (!message || !text) {
return null;
}
const starter: SlackThreadStarter = {
text,
userId: message.user,