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

@@ -21,8 +21,7 @@ vi.mock("../config/config.js", async (importOriginal) => {
});
vi.mock("../agents/auth-profiles.js", async (importOriginal) => {
const actual =
await importOriginal<typeof import("../agents/auth-profiles.js")>();
const actual = await importOriginal<typeof import("../agents/auth-profiles.js")>();
return {
...actual,
loadAuthProfileStore: authMocks.loadAuthProfileStore,
@@ -127,11 +126,9 @@ describe("channels command", () => {
},
});
await channelsRemoveCommand(
{ channel: "discord", account: "work", delete: true },
runtime,
{ hasFlags: true },
);
await channelsRemoveCommand({ channel: "discord", account: "work", delete: true }, runtime, {
hasFlags: true,
});
expect(configMocks.writeConfigFile).toHaveBeenCalledTimes(1);
const next = configMocks.writeConfigFile.mock.calls[0]?.[0] as {
@@ -156,9 +153,7 @@ describe("channels command", () => {
whatsapp?: { accounts?: Record<string, { name?: string }> };
};
};
expect(next.channels?.whatsapp?.accounts?.family?.name).toBe(
"Family Phone",
);
expect(next.channels?.whatsapp?.accounts?.family?.name).toBe("Family Phone");
});
it("adds a second signal account with a distinct name", async () => {
@@ -212,11 +207,9 @@ describe("channels command", () => {
.spyOn(prompterModule, "createClackPrompter")
.mockReturnValue(prompt as never);
await channelsRemoveCommand(
{ channel: "discord", account: "default" },
runtime,
{ hasFlags: true },
);
await channelsRemoveCommand({ channel: "discord", account: "default" }, runtime, {
hasFlags: true,
});
const next = configMocks.writeConfigFile.mock.calls[0]?.[0] as {
channels?: { discord?: { enabled?: boolean } };
@@ -253,9 +246,9 @@ describe("channels command", () => {
});
await channelsListCommand({ json: true, usage: false }, runtime);
const payload = JSON.parse(
String(runtime.log.mock.calls[0]?.[0] ?? "{}"),
) as { auth?: Array<{ id: string }> };
const payload = JSON.parse(String(runtime.log.mock.calls[0]?.[0] ?? "{}")) as {
auth?: Array<{ id: string }>;
};
const ids = payload.auth?.map((entry) => entry.id) ?? [];
expect(ids).toContain("anthropic:claude-cli");
expect(ids).toContain("openai-codex:codex-cli");
@@ -296,9 +289,7 @@ describe("channels command", () => {
};
};
expect(next.channels?.telegram?.name).toBeUndefined();
expect(next.channels?.telegram?.accounts?.default?.name).toBe(
"Primary Bot",
);
expect(next.channels?.telegram?.accounts?.default?.name).toBe("Primary Bot");
});
it("migrates base names when adding non-default accounts", async () => {
@@ -314,11 +305,9 @@ describe("channels command", () => {
},
});
await channelsAddCommand(
{ channel: "discord", account: "work", token: "d1" },
runtime,
{ hasFlags: true },
);
await channelsAddCommand({ channel: "discord", account: "work", token: "d1" }, runtime, {
hasFlags: true,
});
const next = configMocks.writeConfigFile.mock.calls[0]?.[0] as {
channels?: {
@@ -341,12 +330,8 @@ describe("channels command", () => {
},
});
const telegramIndex = lines.findIndex((line) =>
line.includes("Telegram default"),
);
const whatsappIndex = lines.findIndex((line) =>
line.includes("WhatsApp default"),
);
const telegramIndex = lines.findIndex((line) => line.includes("Telegram default"));
const whatsappIndex = lines.findIndex((line) => line.includes("WhatsApp default"));
expect(telegramIndex).toBeGreaterThan(-1);
expect(whatsappIndex).toBeGreaterThan(-1);
expect(telegramIndex).toBeLessThan(whatsappIndex);