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

@@ -62,11 +62,15 @@ vi.mock("@mariozechner/pi-ai", async () => {
return {
...actual,
complete: async (model: { api: string; provider: string; id: string }) => {
if (model.id === "mock-error") return buildAssistantErrorMessage(model);
if (model.id === "mock-error") {
return buildAssistantErrorMessage(model);
}
return buildAssistantMessage(model);
},
completeSimple: async (model: { api: string; provider: string; id: string }) => {
if (model.id === "mock-error") return buildAssistantErrorMessage(model);
if (model.id === "mock-error") {
return buildAssistantErrorMessage(model);
}
return buildAssistantMessage(model);
},
streamSimple: (model: { api: string; provider: string; id: string }) => {
@@ -104,7 +108,9 @@ beforeAll(async () => {
}, 20_000);
afterAll(async () => {
if (!tempRoot) return;
if (!tempRoot) {
return;
}
await fs.rm(tempRoot, { recursive: true, force: true });
tempRoot = undefined;
});
@@ -142,7 +148,9 @@ const testSessionKey = "agent:test:embedded";
const immediateEnqueue = async <T>(task: () => Promise<T>) => task();
const textFromContent = (content: unknown) => {
if (typeof content === "string") return content;
if (typeof content === "string") {
return content;
}
if (Array.isArray(content) && content[0]?.type === "text") {
return (content[0] as { text?: string }).text;
}