From 7f89bebe1a9ca5b4014c5222d0031e5a09d2848a Mon Sep 17 00:00:00 2001 From: senke Date: Wed, 15 Apr 2026 12:47:21 +0200 Subject: [PATCH] fix(ci): lint-staged eslint rule was linting the whole project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The apps/web/**/*.{ts,tsx} rule's bash -c wrapper did not forward "$@", so lint-staged's file arguments were dropped and eslint fell back to its default target (the entire workspace). Combined with --max-warnings=0, that meant any commit touching a single TS file failed on the ~1 170 pre-existing warnings in files unrelated to the change. This is the root cause of the --no-verify workarounds in commits 0e7097ed1 (J1) and 0589ec9fc (J5). Change: add "$@" forwarding and the -- sentinel, matching the pattern already used by the veza-backend-api Go rule a few lines below: "bash -c 'cd veza-backend-api && gofmt -l -w \"$@\"' --" Now eslint receives the absolute paths lint-staged passes (lint-staged 15 defaults to absolute paths — see --relative, default false), and only the staged TS files are checked. Verification: ran the exact wrapper manually with the two paths staged in J5 (domain.ts + index.ts) — exit 0, 0 warnings, whereas the unfixed wrapper reported 1 170 warnings on the same invocation. Not fixed here: - The apps/web tsc command still runs project-wide (which is the intended behavior for --noEmit typecheck — it ignores file args anyway because of -p tsconfig.json) - The underlying 1 170-warning ESLint backlog; that backlog is legitimate tech debt to pay down separately, not something the pre-commit hook should force on each touching commit --- .lintstagedrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 8ff13f577..f8051dff8 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,6 +1,6 @@ { "apps/web/**/*.{ts,tsx}": [ - "bash -c 'cd apps/web && npx eslint --max-warnings=0 --fix'", + "bash -c 'cd apps/web && npx eslint --max-warnings=0 --fix \"$@\"' --", "bash -c 'cd apps/web && npx tsc --noEmit -p tsconfig.json'" ], "apps/web/**/*.{js,jsx,json,css,md}": ["prettier --write"],