webui: add ESLint and eslint-typescript
I've historically found this stuff worthwhile, so let's swallow the pill.
Fortunately, sketch was happy to oblige.
- Install ESLint, @eslint/js, and typescript-eslint packages
- Configure eslint.config.mjs with recommended TypeScript ESLint rules
- Add browser globals support for DOM and web APIs
- Integrate ESLint into npm test workflow via package.json scripts
- Update Makefile to run lint checks as part of test suite
- Fix 249+ linting issues including:
* Remove unused imports and variables (with _ prefix convention)
* Fix case declaration issues with eslint-disable blocks
* Remove unnecessary escape characters
* Address prefer-const violations
* Handle unused function parameters appropriately
- Configure ignore patterns to exclude dist/ and node_modules/
- Set rules to allow explicit 'any' types temporarily
- Convert warnings for ts-ignore, async promise executors, and unsafe optional chaining
Results:
- ESLint now runs successfully with 0 errors and only 6 warnings
- TypeScript compilation continues to work correctly
- Linting integrated into test workflow for continuous quality enforcement
- Codebase follows consistent ESLint TypeScript recommended practices
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sd7b538be0a28d294k
diff --git a/webui/src/web-components/sketch-app-shell.test.ts b/webui/src/web-components/sketch-app-shell.test.ts
index 94e9a55..6c8d468 100644
--- a/webui/src/web-components/sketch-app-shell.test.ts
+++ b/webui/src/web-components/sketch-app-shell.test.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
import { test, expect } from "@sand4rt/experimental-ct-web";
import { SketchAppShell } from "./sketch-app-shell";
import { initialMessages, initialState } from "../fixtures/dummy";
@@ -327,37 +328,6 @@
page,
mount,
}) => {
- // Create test messages where the last agent message doesn't have end_of_turn
- const testMessages = [
- {
- idx: 0,
- type: "user" as const,
- content: "Please help me",
- timestamp: "2023-05-15T12:00:00Z",
- end_of_turn: true,
- conversation_id: "conv123",
- parent_conversation_id: null,
- },
- {
- idx: 1,
- type: "agent" as const,
- content: "Working on it...",
- timestamp: "2023-05-15T12:01:00Z",
- end_of_turn: false, // Agent is still working
- conversation_id: "conv123",
- parent_conversation_id: null,
- },
- {
- idx: 2,
- type: "commit" as const,
- content: "Commit detected: def456",
- timestamp: "2023-05-15T12:02:00Z",
- end_of_turn: false,
- conversation_id: "conv123",
- parent_conversation_id: null,
- },
- ];
-
// Skip SSE mocking for this test - we'll set data directly
await page.route("**/stream*", async (route) => {
await route.abort();