From 2c1488e65afb8975b0555b22c9c859e4a420d834 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 15 Mar 2026 00:59:22 -0300 Subject: [PATCH] fix(ci): fix eslint OOM, failing tests, and strengthen pre-commit hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - eslint.config.mjs: add missing ignores for vscode-extension/, electron/, docs/, app/.next/, clipr/ — ESLint was OOMing because it scanned huge VS Code binary blobs and build artifacts - tests: remove stale ALTER TABLE 'group' statements — column is now part of the base schema in core.ts; tests were failing with SQLITE_ERROR: duplicate column name - .husky/pre-commit: add npm run test:unit to block broken tests from reaching CI --- .husky/pre-commit | 1 + eslint.config.mjs | 20 ++++++++++++++++++- tests/unit/auth-clear-account-error.test.mjs | 1 - .../unit/auth-clear-provider-routes.test.mjs | 1 - 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 4f3fd73344..376d9947c6 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,3 @@ npx lint-staged node scripts/check-docs-sync.mjs +npm run test:unit diff --git a/eslint.config.mjs b/eslint.config.mjs index 52e74dba08..0b02a757c2 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -24,16 +24,34 @@ const eslintConfig = [ "react-hooks/rules-of-hooks": "off", }, }, - // Global ignores (open-sse and tests REMOVED — now linted) + // Global ignores — keep ESLint scoped to source files only { ignores: [ + // Next.js build output ".next/**", "out/**", "build/**", "next-env.d.ts", + // Scripts and binaries "scripts/**", "bin/**", + // Dependencies "node_modules/**", + // VS Code extension and its large test fixtures + "vscode-extension/**", + // Electron app + "electron/**", + // Docs + "docs/**", + // Open-SSE compiled/bundled output + "open-sse/mcp-server/dist/**", + // Playwright test output + "playwright-report/**", + "test-results/**", + // Subdirectory .next build output (app/ subdir) + "app/.next/**", + // CLI package copy directory + "clipr/**", ], }, ]; diff --git a/tests/unit/auth-clear-account-error.test.mjs b/tests/unit/auth-clear-account-error.test.mjs index cb7f283f7f..7f957a1ccd 100644 --- a/tests/unit/auth-clear-account-error.test.mjs +++ b/tests/unit/auth-clear-account-error.test.mjs @@ -24,7 +24,6 @@ test.after(() => { test("clearAccountError clears stale provider error metadata after recovery", async () => { await resetStorage(); - core.getDbInstance().exec('ALTER TABLE provider_connections ADD COLUMN "group" TEXT'); const created = await providersDb.createProviderConnection({ provider: "codex", diff --git a/tests/unit/auth-clear-provider-routes.test.mjs b/tests/unit/auth-clear-provider-routes.test.mjs index 30c192ee2e..e67cb5245b 100644 --- a/tests/unit/auth-clear-provider-routes.test.mjs +++ b/tests/unit/auth-clear-provider-routes.test.mjs @@ -16,7 +16,6 @@ async function resetStorage() { core.resetDbInstance(); fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true }); fs.mkdirSync(TEST_DATA_DIR, { recursive: true }); - core.getDbInstance().exec('ALTER TABLE provider_connections ADD COLUMN "group" TEXT'); } async function seedOpenAIConnection(email) {