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

@@ -11,12 +11,20 @@ export function isEmptyAssistantMessageContent(
message: Extract<AgentMessage, { role: "assistant" }>,
): boolean {
const content = message.content;
if (content == null) return true;
if (!Array.isArray(content)) return false;
if (content == null) {
return true;
}
if (!Array.isArray(content)) {
return false;
}
return content.every((block) => {
if (!block || typeof block !== "object") return true;
if (!block || typeof block !== "object") {
return true;
}
const rec = block as { type?: unknown; text?: unknown };
if (rec.type !== "text") return false;
if (rec.type !== "text") {
return false;
}
return typeof rec.text !== "string" || rec.text.trim().length === 0;
});
}
@@ -110,9 +118,13 @@ export async function sanitizeSessionMessagesImages(
: stripThoughtSignatures(content, options?.sanitizeThoughtSignatures); // Strip for Gemini
const filteredContent = strippedContent.filter((block) => {
if (!block || typeof block !== "object") return true;
if (!block || typeof block !== "object") {
return true;
}
const rec = block as { type?: unknown; text?: unknown };
if (rec.type !== "text" || typeof rec.text !== "string") return true;
if (rec.type !== "text" || typeof rec.text !== "string") {
return true;
}
return rec.text.trim().length > 0;
});
const finalContent = (await sanitizeContentBlocksImages(