Skip to content

chore(deps): eslint 10, and the leak it found - #25

Merged
NeoVand merged 1 commit into
mainfrom
chore/eslint-10
Jul 23, 2026
Merged

chore(deps): eslint 10, and the leak it found#25
NeoVand merged 1 commit into
mainfrom
chore/eslint-10

Conversation

@NeoVand

@NeoVand NeoVand commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Stacked on #23 β€” retargets to main once that merges.

The bump itself is clean: no config changes, no rule renames, no flat-config migration. What it costs is three findings from rules that are new in this major β€” and one of them is a real bug.

The leak

MermaidDiagram declared a themeObs in onMount and disconnected it in the teardown. The effect that actually creates the observer declared a second one inside its own scope, shadowing it. So the outer binding was never assigned, the cleanup disconnected nothing, and every diagram scrolled past left a MutationObserver watching document.documentElement for the life of the page. The media-query listener beside it was never removed either.

no-unassigned-vars is what surfaced it β€” "always undefined because it's never assigned". Both watchers now live at component scope where the teardown can reach them. Verified the diagram still re-themes on toggle, which is the behaviour the observer exists for.

The other two

Dead initialisers β€” a passed = false and a note = null that every path overwrites or returns before reading. Removing them isn't tidying: it means a branch added later that forgets to assign fails to compile, instead of silently taking the initial value.

492 unit, 62 e2e, lint, type-check and build clean.

πŸ€– Generated with Claude Code

The bump itself is clean β€” no config changes, no rule renames. What it costs
is three findings from rules that are new in this major, and one of them is a
real bug.

MermaidDiagram declared a `themeObs` in onMount and disconnected it in the
teardown, while the effect that actually creates the observer declared a
SECOND one inside its own scope. The outer binding was never assigned, so the
cleanup disconnected nothing: every diagram scrolled past left a
MutationObserver watching `document.documentElement` for the life of the page.
The media-query listener beside it was never removed either. Both now live at
component scope where the teardown can reach them, and `no-unassigned-vars` is
what surfaced it.

The other two are dead initialisers β€” a `passed = false` and a `note = null`
that every path overwrites or returns before reading. Removing them is not
tidying: it means a branch added later that forgets to assign fails to
compile, instead of silently taking the initial value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Base automatically changed from chore/deps-current to main July 23, 2026 01:21
@NeoVand
NeoVand merged commit c4aca78 into main Jul 23, 2026
1 check passed
@NeoVand
NeoVand deleted the chore/eslint-10 branch July 23, 2026 01:23
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