Lint: add braces for single-line ifs

This commit is contained in:
Benjamin Jesuiter
2026-02-02 22:56:20 +01:00
committed by Vignesh
parent 23cfcd60df
commit e332a717a8
7 changed files with 227 additions and 76 deletions

View File

@@ -48,7 +48,9 @@ describe("memory search citations", () => {
backend = "builtin";
const cfg = { memory: { citations: "on" }, agents: { list: [{ id: "main", default: true }] } };
const tool = createMemorySearchTool({ config: cfg });
if (!tool) throw new Error("tool missing");
if (!tool) {
throw new Error("tool missing");
}
const result = await tool.execute("call_citations_on", { query: "notes" });
const details = result.details as { results: Array<{ snippet: string; citation?: string }> };
expect(details.results[0]?.snippet).toMatch(/Source: MEMORY.md#L5-L7/);
@@ -59,7 +61,9 @@ describe("memory search citations", () => {
backend = "builtin";
const cfg = { memory: { citations: "off" }, agents: { list: [{ id: "main", default: true }] } };
const tool = createMemorySearchTool({ config: cfg });
if (!tool) throw new Error("tool missing");
if (!tool) {
throw new Error("tool missing");
}
const result = await tool.execute("call_citations_off", { query: "notes" });
const details = result.details as { results: Array<{ snippet: string; citation?: string }> };
expect(details.results[0]?.snippet).not.toMatch(/Source:/);
@@ -73,7 +77,9 @@ describe("memory search citations", () => {
agents: { list: [{ id: "main", default: true }] },
};
const tool = createMemorySearchTool({ config: cfg });
if (!tool) throw new Error("tool missing");
if (!tool) {
throw new Error("tool missing");
}
const result = await tool.execute("call_citations_qmd", { query: "notes" });
const details = result.details as { results: Array<{ snippet: string; citation?: string }> };
expect(details.results[0]?.snippet.length).toBeLessThanOrEqual(20);