Repository navigation
Suppress react-hooks/refs in LiveAircraftMap so main's deploy chain runs again - #685
Merged
Merged
Conversation
…uns again eslint-plugin-react-hooks 7.1.1 (npm group bump, #670) tightened the `refs` rule: it now reports every read of `ref.current` during render and every value derived from one. LiveAircraftMap keeps the live feed in refs by design (fixes, smoothed positions, trails, playback history, the marker registry, all mutated at 60 fps by the animation loop and on each ingest, with React re-rendering on explicit ticks), so the rule reported 49 errors there and nowhere else. The web-build gate has been red since, and ci.yml's Staging job needs that gate, so #670, #661 and #684 all skipped the staging and production deploys; #684 was deployed by hand. The rule is turned off for this one file, with the reasoning in the header. Per-line suppressions would not hold, because the rule follows derived values (selectedTrail, history) into every later use. Moving the stores into state or useSyncExternalStore is a redesign of the map's hot path and out of scope for unblocking deploys. The rule stays on for every other file, where it already passes. The five remaining set-state-in-effect warnings are untouched; the config scores them as warnings and they do not fail the job. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Claude finished @jehanazad's task in 1m 48s —— View job Claude's review
SummaryThe diff is exactly what the PR description says: 11 added lines, all a single Verification
AssessmentThis is a minimal, well-justified, low-risk lint suppression:
No issues found. This looks safe to merge as-is. |
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.
Why
Since #670 bumped
eslint-plugin-react-hooks7.0.1 → 7.1.1, every push to main has failed the Web (dashboard checks) job atnpm run lint -w dashboard(example: run 39088109488).ci.yml'sStagingjobneedsthat gate, so the Staging and Production deploy chain was skipped for #670, #661 and #684. #684 was deployed to staging by hand on 2026-10-18; production has had none of the three.What
All 49 errors are the stricter
react-hooks/refsrule firing in one file,dashboard/src/pages/map/LiveAircraftMap.tsx. That component deliberately keeps the live feed in refs (fixes, smoothed positions, trails, playback history, marker registry), mutated at 60 fps by the animation loop and on every ingest, and re-renders on explicit ticks that read the stores as they stand. The rule assumes the React Compiler, which this app does not use, and it follows derived values:selectedTrail,historyand friends get flagged at every later use, so per-line suppressions would reopen with each new use.LiveAircraftMap.tsx:/* eslint-disable react-hooks/refs -- … */at the top of the file, with the reasoning in the comment. No code change.eslint.config.jsfor every other file, where it already passes. (The config already switches off the sibling compiler rulespurity,immutabilityandrules-of-hooks-unsafe-accessglobally; this stays narrower than that.)react-hooks/set-state-in-effectwarnings inDashboardLayout.tsx,LiveAircraftMap.tsx,PhysicsSettings.tsx,map/hooks.tsandResultsTree.tsx. The config scores that rule as a warning and they do not fail the job.Moving the stores into state or
useSyncExternalStorewould be a redesign of the map's hot path and belongs in its own change.Verified locally (node:24-alpine, as CI)
npm run lint -w dashboard: 0 errors, 5 warnings (was 49 / 5)npm run typecheck -w dashboard: passnpm test -w dashboard: passnpm run build -w dashboard: pass🤖 Generated with Claude Code