chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -3,11 +3,7 @@ import { beforeEach, describe, expect, it } from "vitest";
import { prependSystemEvents } from "../auto-reply/reply/session-updates.js";
import type { ClawdbotConfig } from "../config/config.js";
import { resolveMainSessionKey } from "../config/sessions.js";
import {
enqueueSystemEvent,
peekSystemEvents,
resetSystemEventsForTest,
} from "./system-events.js";
import { enqueueSystemEvent, peekSystemEvents, resetSystemEventsForTest } from "./system-events.js";
const cfg = {} as unknown as ClawdbotConfig;
const mainKey = resolveMainSessionKey(cfg);
@@ -24,9 +20,7 @@ describe("system events (session routing)", () => {
});
expect(peekSystemEvents(mainKey)).toEqual([]);
expect(peekSystemEvents("discord:group:123")).toEqual([
"Discord reaction added: ✅",
]);
expect(peekSystemEvents("discord:group:123")).toEqual(["Discord reaction added: ✅"]);
const main = await prependSystemEvents({
cfg,
@@ -36,9 +30,7 @@ describe("system events (session routing)", () => {
prefixedBodyBase: "hello",
});
expect(main).toBe("hello");
expect(peekSystemEvents("discord:group:123")).toEqual([
"Discord reaction added: ✅",
]);
expect(peekSystemEvents("discord:group:123")).toEqual(["Discord reaction added: ✅"]);
const discord = await prependSystemEvents({
cfg,
@@ -47,15 +39,11 @@ describe("system events (session routing)", () => {
isNewSession: false,
prefixedBodyBase: "hi",
});
expect(discord).toMatch(
/^System: \[[^\]]+\] Discord reaction added: ✅\n\nhi$/,
);
expect(discord).toMatch(/^System: \[[^\]]+\] Discord reaction added: ✅\n\nhi$/);
expect(peekSystemEvents("discord:group:123")).toEqual([]);
});
it("requires an explicit session key", () => {
expect(() =>
enqueueSystemEvent("Node: Mac Studio", { sessionKey: " " }),
).toThrow("sessionKey");
expect(() => enqueueSystemEvent("Node: Mac Studio", { sessionKey: " " })).toThrow("sessionKey");
});
});