From d3bb62210dbd41f6ee232b4191a9c1283d347e4e Mon Sep 17 00:00:00 2001 From: Hikari Date: Sun, 25 Jan 2026 23:28:45 -0800 Subject: [PATCH] style: fix lint errors in test files - Remove unused imports in config.test.ts and conversations.test.ts - Remove unused handler variable in tauri.test.ts - Remove unused _args parameter in vitest.setup.ts mock - Add coverage/ to eslint ignore list --- eslint.config.js | 2 +- src/lib/stores/config.test.ts | 5 ----- src/lib/stores/conversations.test.ts | 9 +++------ src/lib/tauri.test.ts | 2 -- vitest.setup.ts | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 440d784..af21ae1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,6 +27,6 @@ export default tseslint.config( }, }, { - ignores: ["build/", ".svelte-kit/", "dist/", "src-tauri/target/", "node_modules/"], + ignores: ["build/", ".svelte-kit/", "dist/", "src-tauri/target/", "node_modules/", "coverage/"], } ); diff --git a/src/lib/stores/config.test.ts b/src/lib/stores/config.test.ts index 991ec0c..df31e15 100644 --- a/src/lib/stores/config.test.ts +++ b/src/lib/stores/config.test.ts @@ -1,11 +1,6 @@ import { describe, it, expect, beforeEach, vi } from "vitest"; -import { get } from "svelte/store"; import { configStore, - isDarkTheme, - isStreamerMode, - isCompactMode, - shouldHidePaths, maskPaths, clampFontSize, applyFontSize, diff --git a/src/lib/stores/conversations.test.ts b/src/lib/stores/conversations.test.ts index 24324c1..f5859b8 100644 --- a/src/lib/stores/conversations.test.ts +++ b/src/lib/stores/conversations.test.ts @@ -1,5 +1,4 @@ -import { describe, it, expect, beforeEach, vi } from "vitest"; -import { get } from "svelte/store"; +import { describe, it, expect } from "vitest"; // Test the Conversation interface and store behavior describe("Conversation interface", () => { @@ -252,7 +251,7 @@ describe("conversation management operations", () => { }); it("uses default name when not provided", () => { - let counter = 5; + const counter = 5; const createNewConversation = (name?: string) => ({ name: name || `Conversation ${counter}`, }); @@ -452,9 +451,7 @@ describe("attachment management", () => { }); it("clears all attachments", () => { - const attachments = [{ id: "att-1" }, { id: "att-2" }]; - - const cleared: typeof attachments = []; + const cleared: Array<{ id: string }> = []; expect(cleared).toHaveLength(0); }); }); diff --git a/src/lib/tauri.test.ts b/src/lib/tauri.test.ts index 6730f1e..bd187e3 100644 --- a/src/lib/tauri.test.ts +++ b/src/lib/tauri.test.ts @@ -319,8 +319,6 @@ describe("tauri event handling", () => { describe("mock event system", () => { it("can emit events through mock system", () => { - const handler = vi.fn(); - // The emitMockEvent function should work expect(typeof emitMockEvent).toBe("function"); }); diff --git a/vitest.setup.ts b/vitest.setup.ts index 630c0e1..79fdc85 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -13,7 +13,7 @@ export function clearMockInvokeResults() { } vi.mock("@tauri-apps/api/core", () => ({ - invoke: vi.fn((command: string, _args?: Record) => { + invoke: vi.fn((command: string) => { if (command in mockInvokeResults) { const result = mockInvokeResults[command]; if (result instanceof Error) {