diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02bd155..dd3d940 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 325048e..68c496b 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 20fe1a3..ea96ce0 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",