From 83da522dd73cd571fc6f1af16ee27eb1dbe24766 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Wed, 12 Aug 2026 19:23:44 +0200 Subject: [PATCH] ci: freeze the web lint warning cap at zero (batch 5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 99-warning legacy backlog from the React 19 / eslint-plugin-react-hooks v6 upgrade is fully burned down — CI now fails on any new warning. The compiler rules stay demoted to "warn" so local dev output remains readable; the eslint config comments now point to the established fix patterns instead of the retired ratchet. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci.yml | 9 ++++----- src/Web/autopilot-monitor-web/eslint.config.mjs | 17 +++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7eac066..3c5f16f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,12 +77,11 @@ jobs: - name: Typecheck run: npx tsc --noEmit - # Errors fail outright. Warnings are ratcheted: the cap is the current - # count of accepted warnings (React-Compiler hooks-rule findings demoted - # in eslint.config.mjs + exhaustive-deps) — when you fix warnings, lower - # the cap to match; never raise it. + # Errors fail outright, and so does ANY warning: the codebase is + # warning-clean and must stay that way — fix new findings, never + # raise the cap. - name: Lint - run: npm run lint -- --max-warnings 99 + run: npm run lint -- --max-warnings 0 - name: Tests run: npm test diff --git a/src/Web/autopilot-monitor-web/eslint.config.mjs b/src/Web/autopilot-monitor-web/eslint.config.mjs index aa3cbced..1466a53b 100644 --- a/src/Web/autopilot-monitor-web/eslint.config.mjs +++ b/src/Web/autopilot-monitor-web/eslint.config.mjs @@ -1,7 +1,7 @@ // Flat ESLint config (Next 16 removed `next lint`; run via `npm run lint`). -// CI gates on this: errors fail the web job, warnings are ratcheted via -// --max-warnings (see .github/workflows/ci.yml) — lower the cap when you fix -// warnings, never raise it. +// CI gates on this: errors fail the web job, and the codebase is warning-clean — +// CI runs with --max-warnings 0 (see .github/workflows/ci.yml), so any new +// warning fails the build. Fix findings; never raise the cap. import nextVitals from "eslint-config-next/core-web-vitals"; import nextTs from "eslint-config-next/typescript"; @@ -20,11 +20,12 @@ const config = [ ...nextTs, { // The React-Compiler-powered hooks rules (new in eslint-plugin-react-hooks - // v6 via eslint-config-next 16) flag long-standing patterns whose cleanup - // is a behavioral refactor per site (auth/SignalR/MSAL-adjacent code), not - // a mechanical fix. Kept visible as warnings and burned down incrementally - // under the CI warning ratchet; do NOT silence individual sites with - // eslint-disable instead of fixing them. + // v6 via eslint-config-next 16) are kept at "warn" so local dev output stays + // readable, but the legacy backlog is fully burned down and CI's + // --max-warnings 0 fails the build on any new finding. Fix new sites with + // the established patterns (inner-async wrapper for fetch effects, + // derive/adjust-during-render for state sync, useSyncExternalStore for + // browser APIs); do NOT silence sites with eslint-disable. rules: { "react-hooks/set-state-in-effect": "warn", "react-hooks/refs": "warn",