Skip to content

fix(lint): drop four unused eslint-disable directives - #11129

Closed
helenastafford wants to merge 1 commit into
mainfrom
fix/unused-eslint-disable-directives
Closed

helenastafford wants to merge 1 commit into
mainfrom
fix/unused-eslint-disable-directives

Conversation

@helenastafford

Copy link
Copy Markdown
Contributor

Summary

Main is red on "CI / Frontend Lint & Type Check": eslint . --max-warnings 0 reports four Unused eslint-disable directive warnings (electron/permission-handler.js:194, electron/window-lifecycle.js:1535, scripts/i18n-plural-codemod.mjs:97, scripts/precompress.mjs:148) — reproduced on pristine origin/main. Recent changes removed the code those directives guarded without removing the directives, and the zero-warning gate turns that into a red main for every open PR.

Fix

Mechanical: eslint . --fix (via reportUnusedDisableDirectives), removing exactly the four stale directives. Verified eslint . --max-warnings 0 passes after; no behavior change possible (comments only).

Pattern harvest

Rule candidate: none needed at the code level — reportUnusedDisableDirectives already catches the class; what failed is the process gap (third individually-green-merges-collide breakage on this repo in four days: #10248's fence entry, #10301's test contract, now this). A merge queue retesting each PR against post-merge main catches all three.

First observed on PR #9969's CI; reproduced on pristine main.

Frontend Lint & Type Check fails on main: `eslint . --max-warnings 0`
reports four "Unused eslint-disable directive" warnings (two no-console
in electron/, one no-useless-escape and one no-console in scripts/),
reproduced on pristine origin/main. Recent changes removed the code the
directives guarded without removing the directives; the zero-warning
gate turns that into a red main for every PR.

Mechanical fix: `eslint . --fix` (reportUnusedDisableDirectives),
nothing else touched. Verified `eslint . --max-warnings 0` passes after.
@helenastafford
helenastafford requested review from a team and krishdhasmana September 15, 2026 23:02
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 0dac457e1098280a44fa41238b6018178b980c33 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0dac457

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0dac457e1098280a44fa41238b6018178b980c33: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 0dac457e1098280a44fa41238b6018178b980c33 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0dac457

Verdict parsed from the review's SHA-scoped output markers for commit 0dac457e1098280a44fa41238b6018178b980c33.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0dac457e1098280a44fa41238b6018178b980c33: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 0dac457e1098280a44fa41238b6018178b980c33 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] 0dac457

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 0dac457e1098280a44fa41238b6018178b980c33 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Diagnosis is wrong: the guarded console calls still exist; the directives are "unused" only because electron/ and scripts/ lint with zero rules.

Watch

The description claims "recent changes removed the code those directives guarded," but each removed directive sits directly above a still-present console.warn/console.log. The real cause is config coverage: no block in website/eslint.config.js matches electron/** or scripts/**, so those files lint against an empty rule set and every directive there reports unused. The config's own precedent (website/eslint.config.js:124) treats exactly this state as "an accident of config coverage" and resolves it by enabling the rule the directive names, keeping the directive live. Deleting the four instead means the moment coverage widens to these trees, all four sites go red again — now stripped of their reviewed rationale (the permission-handler one is left as a severed fragment, "// cost two debugging sessions.").
Clears when: the PR either adds electron/**/*.js + scripts/**/*.mjs config blocks enabling no-console/no-useless-escape (directives stay, warnings stay suppressed), or the description is corrected to name empty-rule-set coverage as the cause and the orphaned rationale comments are repaired.

Suggestions

  • Follow the src/**/*.mjs block's pattern: one narrow block per tree enabling only the rules existing directives name — same green CI, no future re-red, rationale intact.

[DESIGN-REVIEWED] 0dac457

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🔴 BLOCK

Premise-level review of 0dac457e1098280a44fa41238b6018178b980c33 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: BLOCK

No gate lints these files: CI runs eslint src/ only, so the "red main" premise fails and this diff changes nothing CI reads.

Not justified as shipped

  • Item 1 — inherited: the defect's provenance fails — "Main is red on 'CI / Frontend Lint & Type Check': eslint . --max-warnings 0 reports four…" quotes a gate command that exists nowhere; the job's command is npx eslint src/ --max-warnings 0 (.github/workflows/ci.yml:1890) and all four edited files sit outside src/.
    Subtraction: drop all four hunks — every gate's input is byte-identical without them.
    Clears when: a linked red "Frontend Lint & Type Check" run on pristine main traced to these four files, i.e. an actual gate invocation that lints electron/ and scripts/.

What this change ships

Inventory (3 items) — 0 justified

Intent: get main's frontend lint gate green again by deleting four unused eslint-disable comments — a FIX.

  1. Four unused eslint-disable comments removed in electron/ and scripts/ — inherited (the gate named never lints these paths)
  2. Each removal leaves a whitespace-only line in place — undeclared, rides along
  3. permission-handler.js's justification comment beheaded; orphan // cost two debugging sessions. remains — undeclared (description says "removing exactly the four stale directives")

Blockers

  • The fix targets a warning no gate reports. Grepped eslint across .github/workflows/: 2 lint invocations, both src/-scoped (ci.yml:1890, main-ratchet-audit.yml:222); eslint . appears in none, and website/package.json lint is eslint src. The description's causal story is also contradicted by its own hunks: "Recent changes removed the code those directives guarded" — yet console.warn/console.log and the escaped regex still sit directly under each removed directive; the directives are unused only because eslint.config.js scopes every rules block to src/**. The zero option costs nobody anything: no CI job, script, or documented command reads these warnings.
    Subtraction: withdraw the change — all four hunks.
    Clears when: a red run of "Frontend Lint & Type Check" on pristine main is linked and its failing step demonstrably lints electron/ and scripts/.

[FIRST-PRINCIPLES-REVIEWED] 0dac457

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 15, 2026
@helenastafford

Copy link
Copy Markdown
Contributor Author

Closing as unnecessary — the First Principles finding is correct.

The premise was a misdiagnosis on my side: I reproduced the "red main" with eslint . --max-warnings 0, but the CI gate actually runs npx eslint src/ --max-warnings 0 (.github/workflows/ci.yml:1890). All four edited files live in electron/ and scripts/, outside every lint invocation CI runs — running eslint . lints those trees against an empty rule set, which is what produced the four "unused directive" warnings locally. Pristine main's CI is green (runs 35013836890, 35005179685 both success), so this diff changes nothing any gate reads.

Withdrawing rather than reworking: the directives are live documentation for a future coverage widening, and deleting them (plus the beheaded rationale comment this diff left behind) makes things worse, not better.

@helenastafford
helenastafford deleted the fix/unused-eslint-disable-directives branch September 15, 2026 23:15
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant