chore(deps): eslint 10, and the leak it found - #25
Merged
Conversation
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>
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.
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
MermaidDiagramdeclared athemeObsinonMountand 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 aMutationObserverwatchingdocument.documentElementfor the life of the page. The media-query listener beside it was never removed either.no-unassigned-varsis 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 = falseand anote = nullthat 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