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

@@ -56,8 +56,12 @@ function resolveTranscriptPath(params: {
sessionFile?: string;
}): string | null {
const { sessionId, storePath, sessionFile } = params;
if (sessionFile) return sessionFile;
if (!storePath) return null;
if (sessionFile) {
return sessionFile;
}
if (!storePath) {
return null;
}
return path.join(path.dirname(storePath), `${sessionId}.jsonl`);
}
@@ -65,7 +69,9 @@ function ensureTranscriptFile(params: { transcriptPath: string; sessionId: strin
ok: boolean;
error?: string;
} {
if (fs.existsSync(params.transcriptPath)) return { ok: true };
if (fs.existsSync(params.transcriptPath)) {
return { ok: true };
}
try {
fs.mkdirSync(path.dirname(params.transcriptPath), { recursive: true });
const header = {
@@ -476,9 +482,13 @@ export const chatHandlers: GatewayRequestHandlers = {
context.logGateway.warn(`webchat dispatch failed: ${formatForLog(err)}`);
},
deliver: async (payload, info) => {
if (info.kind !== "final") return;
if (info.kind !== "final") {
return;
}
const text = payload.text?.trim() ?? "";
if (!text) return;
if (!text) {
return;
}
finalReplyParts.push(text);
},
});