feat(lint): add no-unused-vars ratchet scoped to src+open-sse+tests - #11247
Merged
diegosouzapw merged 1 commit intoAug 23, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Bar NEW unused vars/args/catches outside the `_` escape hatch via
@typescript-eslint/no-unused-vars (args:"all", caughtErrors:"all",
ignoreRestSiblings), scoped to src/**/*.{ts,tsx,js,jsx} + open-sse/**/*.ts
+ tests/**/*.{ts,tsx,mjs} — scripts/, bin/ and docs/ stay out of scope.
Pre-existing violations (1393 across 1251 files) are frozen in
config/quality/eslint-suppressions.json via --suppress-rule, same
pattern as diegosouzapw#7879 (toNumber tier-by-tier). Only genuinely NEW unused
bindings fail lint from now on.
Also untracks two docs/superpowers/* planning files that slipped into
the tree via diegosouzapw#11213 while being gitignored; their presence makes the
tracked-artifacts pre-commit hook reject every new commit.
Refs diegosouzapw#9985
maxmad64bis
force-pushed
the
feat/ratchet-no-unused-vars
branch
from
August 23, 2026 13:34
673b4f4 to
8866ffb
Compare
maxmad64bis
marked this pull request as ready for review
August 23, 2026 13:39
diegosouzapw
merged commit Aug 23, 2026
5b92dbd
into
diegosouzapw:release/v3.8.50
23 of 37 checks passed
diegosouzapw
pushed a commit
that referenced
this pull request
Aug 23, 2026
#11249/#11251/#11252/#10952 follow-ups) The gate (eslint full-tree, baseline 0) failed on the merged head with 26 unsuppressed errors, all introduced by same-day base merges — none by this PR. Each fixed at the cause (no new suppressions): 1. tests/integration/qdrant-routes.test.ts (#11249/#11213): 20x no-explicit-any on route-invocation casts. Fix: typed asNextRequest() adapter (Request -> NextRequest) replacing every "as any". 2. tests/unit/effort-tiers-loop-catalog-e2e.test.ts (#11252): unused after/beforeEach imports — newly error-level under the no-unused-vars ratchet #11247 shipped the same day. Fix: trim the import (the file uses test.after/test.beforeEach method forms). 3. EditConnectionModal.tsx (#11251): react-hooks/set-state-in-effect on the modal-open setFormData init. The pattern (sync form state with the loaded connection when isOpen flips) is the codebase's sanctioned exception — same justified eslint-disable-next-line already used in FreePoolTab.tsx and BatchConceptCard.tsx; a key-remount of the 30+ field form would be a behavior-risking restructure for a basereds PR. 4. tests/unit/usage-service-hardening.test.ts (shard 2/4): last stale Copilot wire-identity pin — #10952 re-based it on the live-captured CLI 1.0.81-6 (copilot-developer-cli integration id, API version 2026-08-01). Assertions aligned (UA, Editor-Version, Editor-Plugin-Version, X-GitHub-Api-Version). Validation: all four files eslint-clean with the frozen suppressions; usage-service-hardening 23/23 and effort-tiers 2/2 RED->GREEN (node --import tsx/esm --test). Refs #9985
fouadSalkini
added a commit
to fouadSalkini/OmniRoute
that referenced
this pull request
Sep 26, 2026
…ed files Slice 1/3 carried a locally pruned copy of eslint-suppressions.json that dropped entries for files this PR never touches. The CI lint job runs with --pass-on-unpruned-suppressions and prunes stale entries at release reconciliation, so dropping them here is not required. Restore the base file and keep only the removal for src/lib/usage/apiKeySelfService.ts: this PR rewrites that file, the no-restricted-syntax violation is gone, and lint-staged (no pass flag) fails any commit staging a file with an unused suppression. Restored entries: - vertex registry index.ts, executors/vertex.ts, both vscode [token]/combos routes, use-stream-metrics and use-tools-builder tests (diegosouzapw#11247) - executors/vertex.ts, ProxyLogDetail.tsx, analytics/charts.tsx (diegosouzapw#6202) - executor-nlpcloud and qoder-unwrap-error-envelope tests (diegosouzapw#9126) - use-improve-prompt, use-presets, use-stream-metrics, use-structured-output and use-tools-builder tests (diegosouzapw#12144) - gemini-business-provider test (diegosouzapw#11247; base drops it separately)
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…iegosouzapw#11247) Validated on the combined 12-PR batch board: typecheck:core clean, file-size/changelog/complexity/cognitive gates within baseline, eslint config smoke-tested. Freeze-then-ratchet for @typescript-eslint/no-unused-vars scoped to src/open-sse/tests (1393 pre-existing frozen, _ escape hatch, args:all), following the diegosouzapw#7879 pattern — plus it untracks the two docs/superpowers planning files that leaked in via diegosouzapw#11213 and were tripping check:tracked-artifacts for everyone. Thank you @maxmad64bis!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unused variables are currently invisible in this repo. No rule watches them, so they don't show up in the ratchet drift either — every release cycle quietly accumulates a few more: parameters left behind by refactors, catch clauses that drop the error, destructuring that grabs more than it uses. Nobody writes them on purpose, and individually they're harmless. The problem is cumulative: after a while readers can't tell which parameters are actually part of a function's contract, and an unused parameter is often the fingerprint of a call path that no longer works the way its signature suggests.
This PR doesn't fix any of them and doesn't ask anyone to. It just extends the mechanism the repo already trusts — bulk suppressions with a hard wall for new code — to the last big category of lint debt that has no gate. Everything frozen today stays frozen; from the next commit on, a new unused binding fails lint inside the PR that introduced it, where fixing it costs seconds and the author still remembers why it was there. The escape hatch is deliberately generous: prefix it with
_and the linter stays out of your way.Concretely:
@typescript-eslint/no-unused-varsscoped tosrc/,open-sse/andtests/— the same directories the existing scoped rules target;scripts/,bin/anddocs/stay out of scope.config/quality/eslint-suppressions.json, same pattern as thetoNumberrestriction from refactor(quality): 51 definições divergentes de toNumber espalhadas por src/ e open-sse/ — consolidar em helpers canônicos com testes #7879.docs/superpowers/*planning files that entered the tree with feat: guide Qdrant memory configuration #11213 while being gitignored; their presence currently makes thetracked-artifactspre-commit hook reject every new commit on this branch, for every contributor.changelog.d/maintenance/(renamed to the real PR number once known).Related Issues
Validation
Choose the change type and focused loop from the
Contribution Golden Path. The full unit suite,
Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):
npm run lintTests Added Or Updated
eslint.config.mjs) and suppressions data only, so no new test file is added. The ratchet behavior was verified with throwaway probe files (removed): a new unused variable insrc/fails lint, a leading unused parameter is still flagged (args: "all"), andscripts/*.mjsremains ignored.Coverage Notes
src/,open-sse/,electron/orbin/runtime code is touched by the rule itself; the only tracked-file deletions are the two leaked planning docs. Coverage is unaffected.Reviewer Notes
The bulk-suppressions JSON was produced by ESLint's native
--suppress-rule+--suppressions-locationmechanism (the same one wired intonpm run lintandlint-staged— seepackage.json:109and:411). The exact command to reproduce / refresh the file from the current base is:Output is keyed by file path; each entry holds
{ "@typescript-eslint/no-unused-vars": { "count": N } }. The-455lines in this diff are the--prune-suppressionshalf of the same run — entries that no longer occur on the current tip. The freeze count (1393) covers args, vars and catch clauses together across all three scopes, which is why it's higher than a spot-check would suggest. One ESLint pass over the three scoped globs takes ~3 min on a warm cache.docs/superpowers/is gitignored onrelease/v3.8.50(/.gitignore:169), so the two files leaked via feat: guide Qdrant memory configuration #11213 are an isolated slip, not an ongoing drift. This PRgit rms them so thetracked-artifactspre-commit hook stops rejecting every new commit on the branch. The untrack is kept in this PR rather than split out because (a) it is the symptom of the same merge (feat: guide Qdrant memory configuration #11213) that also brings the ~20 unsuppressedno-explicit-anymentioned below, and (b) splitting would force PR-A to merge before PR-B or risk the hook rejecting PR-A's own commits. Happy to split on maintainer request.On top of the inherited base-red (🔴 Release branch not green: release/v3.8.50 #9985), the current tip also carries ~20 unsuppressed
no-explicit-anyintests/integration/qdrant-routes.test.ts(arrived with feat: guide Qdrant memory configuration #11213). Pre-existing and untouched here.