From 2e40d0f4b3d8d96b90c7f937e339c919673ff65a Mon Sep 17 00:00:00 2001 From: minutechreview <141821420+minutechreview@users.noreply.github.com> Date: Wed, 28 Oct 2026 09:27:15 +0300 Subject: [PATCH] chore(lint): fix the last warning and fail lint on any warning Signed-off-by: minutechreview <141821420+minutechreview@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- lib/color/matrix.test.ts | 3 ++- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02bd155b..dd3d9403 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ The app runs at [http://localhost:3000](http://localhost:3000). There is no back | `pnpm dev` | Start the dev server with hot reload | | `pnpm build` | Production build (must pass before merging) | | `pnpm start` | Serve the production build locally | -| `pnpm lint` | ESLint (Next.js + TypeScript rules) | +| `pnpm lint` | ESLint (Next.js + TypeScript rules); any warning fails it, like an error | | `pnpm typecheck` | `tsc --noEmit` in strict mode | | `pnpm test` | Unit tests with Vitest (`lib/**` and `packages/*/src/**`) | | `pnpm test:e2e` | Playwright tests against the production build: routes, flows, axe (see below) | diff --git a/lib/color/matrix.test.ts b/lib/color/matrix.test.ts index 325048e1..68c496bc 100644 --- a/lib/color/matrix.test.ts +++ b/lib/color/matrix.test.ts @@ -1,11 +1,12 @@ import { describe, expect, test, vi } from "vitest"; +import type * as ColorModule from "@/lib/color/color"; import { apcaContrast, fromHex } from "@/lib/color/color"; import { apcaLevel, matrixCell } from "@/lib/color/matrix"; // Pass through to the real implementation, but let a test pin an exact Lc for one call. vi.mock("@/lib/color/color", async (importOriginal) => { - const actual = await importOriginal(); + const actual = await importOriginal(); return { ...actual, apcaContrast: vi.fn(actual.apcaContrast) }; }); diff --git a/package.json b/package.json index 20fe1a39..ea96ce03 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "next build", "postbuild": "node scripts/generate-service-worker.mjs", "start": "next start", - "lint": "eslint .", + "lint": "eslint . --max-warnings 0", "typecheck": "tsc --noEmit", "test": "vitest run", "test:e2e": "playwright test",