From bc528e5ad2b0e0b8cb845e5b219cbce80ec3469f Mon Sep 17 00:00:00 2001 From: Scanner Agent Date: Tue, 21 Jul 2026 06:44:10 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[scanner]=20fix:=20document=20ca?= =?UTF-8?q?tch-binding=20convention=20to=20prevent=20lint=20regressions=20?= =?UTF-8?q?(#21352=20#21353)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of nightly failure (run 29805735617): unused `catch (error)` binding in EnterpriseLayout.tsx introduced by #21342 caused a new `@typescript-eslint/no-unused-vars` violation beyond the baseline. The code fix (drop the binding → `catch { }`) landed in #21345. This follow-up: - Adds an inline comment on the no-unused-vars rule in eslint.config.js explaining the correct pattern so future contributors avoid the trap. - Improves the lint-baseline-check.mjs error message with a targeted tip for the most common offender (unused catch bindings). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Scanner Agent --- web/eslint.config.js | 5 +++++ web/scripts/lint-baseline-check.mjs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/web/eslint.config.js b/web/eslint.config.js index ed204a1844..33ead1e965 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -28,6 +28,11 @@ export default tseslint.config( 'warn', { allowConstantExport: true }, ], + // When you don't need the error value, use `catch { }` (no binding). + // Using a named binding like `catch (err)` when err is never referenced + // is flagged as a new baseline violation and will block the nightly + // release (see issues #21352/#21353). Prefix with _ (e.g. `catch (_err)`) + // only when you need the type annotation but not the value. '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', diff --git a/web/scripts/lint-baseline-check.mjs b/web/scripts/lint-baseline-check.mjs index cfa1fef0c8..491a5f1a24 100755 --- a/web/scripts/lint-baseline-check.mjs +++ b/web/scripts/lint-baseline-check.mjs @@ -113,6 +113,8 @@ if (newEntries.length > 0) { } }); console.log('\nāŒ CI fails on new violations. Fix them or update baseline after review.'); + console.log(' Tip: For unused catch bindings (no-unused-vars), use `catch { }` instead'); + console.log(' of `catch (err)` when you don\'t need the error value. See eslint.config.js.'); process.exit(1); }