Repository navigation
refactor(components): clear the React 19 warnings the new lint set found - #265
Conversation
React 19 passes `ref` as an ordinary prop, so the five form atoms lose `forwardRef` and the `displayName` line each one needed to keep a name. `use(Context)` replaces `useContext`, and `<Context>` replaces `<Context.Provider>`. Countdown's `calculateTimeRemaining` becomes a `useCallback` on `targetDate`, which both lets the interval effect list it honestly and makes it usable as a lazy `useState` initializer. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
Every `exhaustive-deps` and `set-state-in-effect` site was read before it was judged. Each one that stays reacts to something that exists only after hydration — an embla API, a Howler event, a fetch, the Sentry client — or sets the value the state already holds, so no first paint changes. Each now carries that reason on a scoped disable instead of a warning nobody reads. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
Every site was read before it was judged. Each is a trail, a fixed slot, a paragraph of one body of copy, or a nav list built once per site configuration — nothing reorders or filters any of them, so the position is the identity. Three already lead with a stable id and append the index only to break a tie. The twenty-fifth site, in `Playlist`, is left alone: #249 reads the same warning as a real index-mapping bug, and #255 is open on it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
Each block names one rule, the files it covers and why the report is wrong there: two authored HTML strings, a fetch whose cleanup already flips a cancelled flag, a copyright year, the one `cloneElement` that has no alternative, and three files where a `javascript:` URL is the input under test rather than a link. The last of those is new since the triage: #257 landed the scheme gate and its proof, which the rule reads as four security risks. A guard replaces what `forwardRef` used to guarantee. Its absence was a type error; now a `ref` left out of the destructure still reaches the element through the props spread, so nothing reports the day one stops being wired. It reads the wiring from the source, because a ref never attaches under `renderToStaticMarkup` — so the TSX parse and the AST walk `ssr-visibility` already owned move to `_source-scan`, their documented home, rather than growing a second copy. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
…gation Vike swaps one player page for the next under the same `<main>`, so React reuses the loader and its loaded items outlive the anchor they belong to. Resetting them in the Effect paints the stale list first; a key on the request remounts instead, so the spinner returns in the same paint as the new page. Three cleanups the review found, all removing code the lint pass had added or preserved: - Countdown's time calculation closes over nothing but `targetDate`, so it belongs at module scope. The `useCallback` existed only to be named in a dep array that already named `targetDate`. - Both arms of the play-order Effect built the same array and set the same state, which took two reasons to explain. One build, one set. - The form atoms come back as function declarations, which is what the other seventy-nine components in the repo are. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
`eslint .` exits 0 on warnings, so a rule left at `warn` records a violation nobody is stopped by — among two thousand others. These five name idioms React 19 replaced outright: every site is gone, the replacement is mechanical, and a new one is a mistake rather than a judgement. The config already carries a block promoting five other rules for the same reason. A story's filler array moves to a `files` block beside the three that already scope a rule off for stories: it is never the product concern the rule is about, and the next story author would leave the warning rather than re-make the call. The config now states which suppressions belong there and which belong at the site. Two corrections from review: - The six nav and footer key reasons claimed those lists are never reordered. That is a claim about what an editor does, and SahajCloud promises no such thing. What actually holds is that none of those rows carries state, so reusing one costs a prop diff. - The ref guard now counts every element of the atom's tag, not just one. `Input` renders a second `<input>` for its icon branch, which no test renders, so a ref wired only to the plain branch read as correct. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
The design-system rule gains the shape every new component now takes, and which lint rules stop the old one. The testing rule gains the limit this branch ran into: a ref reaches neither a callback nor the HTML under `renderToStaticMarkup`, so a ref contract is read from the source. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYEYNt3qZjYqMmkP1c
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 6cb97de | Commit Preview URL Branch Preview URL |
Nov 18 2026, 09:50 PM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 5ae4623 | Commit Preview URL Branch Preview URL |
Nov 18 2026, 09:24 PM |
main reformatted the three files this branch rewrites (#199, #260): prettier collapsed each `stateStyles` map onto one line, added trailing commas, and perfectionist sorted the JSX props. This branch had replaced `forwardRef` with React 19's `ref` prop over the same lines, and added scoped eslint disables in `ColumnCarousel`. Every hunk keeps this branch's shape and main's formatting. No side was taken wholesale: `Input` and `Textarea` are plain functions taking `ref` as a prop, with main's one-line `stateStyles` and sorted props; `ColumnCarousel` keeps main's `scrollTo` wrapping and one-line signature, and the disable comments keep the two `key={index}` elements multi-line. Lean gate green on the merge: eslint 0 errors, tsc clean, 1124 tests passed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ3NhbnJ5kzajYDrq5
|
Merged
Lean gate on the merge commit: eslint 0 errors, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #250 and no larger. Every rule the ticket named is cleared or scoped, and the one joined change — keying Feed so it remounts on navigation instead of resetting in an Effect — is React's own idiom for that reset, not a new layer. Promoting five rules to error goes past the ticket, and the question thread already puts that decision where it belongs.
What I would push on is the shape of the ~37 inline disables rather than any one of them: eleven are verbatim copies of two sentences. Two smaller claims also do not hold.
Findings
consider—RelatedContentLoader.tsx:79:locale: stringwidens the repo'sLocale, andFeedis a word the repo uses nowhere else.consider—usePlaylistAudioPlayer.ts:72: the mergedsetPlayOrdercovers a deterministic branch its reason does not describe.consider—Header.tsx:199: eleven verbatim copies of two disable reasons.
What was checked
- #250 first, then the diff against it: 40 files, +532/−300. Nothing outside the ticket's site list except the two
docs/rules/updates and the guard its sixth criterion asks for. - Ladder, per new piece:
Feed(React's documented key-reset, nothing in repo or platform),timeRemainingUntil(a hoist),parse/walk(hoisted out ofssr-visibility.test.ts),form-atom-refs.test.tsx(the ticket asks for it). - Read whole on the branch: the five form atoms,
Countdown.tsx,RelatedContentLoader.tsx,useAudioPlayer.ts,usePlaylistAudioPlayer.ts,eslint.config.js, the guard. - Clean on re-check:
Countdown's dep array is byte-identical tomain, so the hoist alone clears that warning.useAudioPlayer's disable holds —handleOnEndreadslatestRef. The guard counts every element of the tag, coveringInput's icon branch.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVxFnWzabhTvMi4TyK
The merged Effect set the play order for the unshuffled branch too, where nothing is random, so its reason covered half of what it guarded. The first render also carried an empty order until the Effect caught up. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVxFnWzabhTvMi4TyK
|
Merged Adopted
Rebutted
The Lean gate on the push: eslint 0 errors, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Merged Took main's Lean gate green: eslint 0 errors, Two counts in the body are now wrong:
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Approved, but this thread still waits on you, and the ruleset will not merge until it is resolved: #265 (comment). Reply there, or resolve it. 🤖 sydevs dispatcher |
Answers the eslint.config.js question thread on #265: option B, in this PR rather than a follow-up. #255 merged, so Playlist.tsx:152 is gone and no-array-index-key reports zero — the last thing blocking the promotion. All three report zero on this branch, so the ratchet closes with no new suppression. A rule left at warn records a violation nobody is stopped by: `eslint .` exits 0 on warnings and 1974 others are already there. Watched failing: a probe component with `key={index}`, a `setState` in an Effect and a dep array missing its read now produce three errors, one per rule. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXgmgR87TRD9NczmHe
The last @eslint-react warning in the repo, and the one this PR's table missed: it counted no-clone-element as 1 on main when main has 2, so FormField was never triaged with the other 41 sites. The clone is right. `aria-describedby` has to sit on the control the label names, and that control is the caller's element, so no wrapper can carry it. Disabled at the site rather than by a `files` block, because the block would also cover whatever the next clone in this file is for. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXgmgR87TRD9NczmHe
|
Took the answer to the Built
Body refreshed. Counts are re-measured against Lean gate: eslint 0 errors, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#259 and this branch rewrote neighbouring halves of usePlaylistAudioPlayer, so the two hunks resolve in opposite directions and both behaviours survive. Play order: this branch's `shuffledOrder` state and `playOrder` useMemo win. `hasEnded` goes with main, which dropped it from PlaylistAudioPlayerState; nothing reads it now. The branch's set-state-in-effect disable on `setHasEnded` dies with the call it annotated. Auto-resume: main's side wholesale. It replaced `wasPlayingRef` with `wantsPlaybackRef` and deleted the effect this branch had only annotated, so keeping that annotation would have resurrected a ref no longer declared. ssr-visibility imports the union: main hoisted the three component globs into `componentGlobs`, this branch hoisted `parse` and `walk`, and _source-scan carries both. The local SOURCE_GLOBS goes — the call site already reads componentGlobs after the auto-merge. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVrp7hoPJLGB4XKncF
|
Merged
Lean gate green on the merge: eslint 0 errors, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
@eslint-react/*warning is gone: 64 onmain, 0 on this branch.pnpm lintstops a new violation of any of them.FormField'scloneElementwas the last warning standing. The first triage countedno-clone-elementas 1 onmainwhen it is 2, so this site was never read.RelatedContentLoaderpainted the previous page's cards for a frame after a client navigation. Found reading the Effect the ticket asked me to judge.Change outline
The ticket's triage is a verdict per site. Three verdicts, three mechanisms.
Behaviour — the sites that changed
components/atoms/form/{Checkbox,Input,Radio,Select,Textarea}.tsx - forwardRef<HTMLInputElement, Props>(({ … }, ref) => …) - Checkbox.displayName = 'Checkbox' # only forwardRef needed this + export function Checkbox({ …, ref }: Props) # React 19: ref is a prop components/molecules/Lightbox/LightboxProvider.tsx - useContext(LightboxContext) · <LightboxContext.Provider> + use(LightboxContext) · <LightboxContext> components/atoms/Countdown/Countdown.tsx - useState(calculateTimeRemaining()) # recomputed every render, kept once + timeRemainingUntil(targetDate) # module scope, lazy initialiser components/molecules/Accordion · components/organisms/ContentIndex - useState(new Set(…)) # a Set built and dropped per render + useState(() => new Set(…)) hooks/useFadeOnChange.ts · lib/live-preview/document.tsx - rendered · lastGood → renderedRef · lastGoodRef pages/+Head.tsx - <script … ></script> → <script … /> hooks/audio/usePlaylistAudioPlayer.ts - useState(playOrder = []) # an Effect filled it, shuffled or not - Effect [isShuffleOn, tracks.length] → setPlayOrder(order) + useMemo(in-order over tracks.length) # derived, so it cannot fall behind `tracks` + useState(shuffledOrder = null) # only the random half is stored + Effect [isShuffleOn, tracks.length] # returns early unless shuffle is onFlow — the stale frame, and why a key replaces the Effect
RelatedContentLoader({ kind, anchorId }) components/organisms/RelatedContent/RelatedContentLoader.tsx locale ← usePageContext() - useState(items = null) # React reuses this instance across a Vike page swap - Effect [kind, anchorId, locale] - setItems(null) # a render too late: the old cards paint first - fetch /api/<kind>/<anchorId>?locale=… + <RelatedContentFeed key={`${kind}-${anchorId}-${locale}`} … /> + RelatedContentFeed mounts fresh # items starts null, so the spinner is in the first paint + Effect [kind, anchorId, locale] → fetch onlyBehaviour — the ~37 sites that did not change, and what each now says
Every
set-state-in-effect,exhaustive-depsandno-array-index-keysite was read before itwas judged. The ones that stay carry the reason on a scoped disable, so a new violation stands
out instead of landing in a pile of known-good ones.
set-state-in-effect (13 → 0 warnings, 0 sites changed) reacting to something that exists only after hydration an embla API (ColumnCarousel, ContentCarousel) · a Howler event (usePlaylistAudioPlayer) a fetch (RelatedContentLoader → now a key, no disable) · the Sentry client (pages/sentry) a random pick the server must not make (MeditationPlayer, usePlaylistAudioPlayer) or setting the value the state already holds on mount (SplashLoader, VideoPlayer) exhaustive-deps (4 → 0, 1 site changed) + Countdown → the dep array now names what it reads VideoPlayer → keyed on `tracksKey`, which encodes every track's locale and url MeditationPlayer → keyed on the seek command's id, not the object the caller rebuilds useAudioPlayer → `player` is a fresh object per render; listing it reloads the track no-array-index-key (24 → 0, 0 sites changed) a trail · a fixed slot · a paragraph of one body of copy · a nav list with no row state 5 composite keys the rule flags anyway: `${anchor}-${index}`, `it.id ?? i`, … a story's filler array → a `files` block, not a commentContract — eslint.config.js
Five rules are off per file, eight are now errors, and the file states which suppression belongs where.
Preview
Web preview ·
Ladle preview
The diff changes no route's markup except
RelatedContentLoader's timing. What is worth openingthere: the Playlist, Column Carousel, Content Carousel and Lightbox
stories (state timing no test here can see), and any meditation or lecture page, navigating from
one to another to watch the related-content spinner.
Test results
.claude/skills/pr-prep/check.sh— eslint 0 errors,tsc --noEmitclean, 1142 teststests/guards/form-atom-refs.test.tsx6 passedsecurityReview.triggerPatternpath and no build config changedPer-rule counts,
npx eslint . -f json, re-measured after the merge:mainat e868c42 againstthis branch. The first measurement was taken against an older
main, so the absolute totals movedwith it —
no-array-index-keyis 24 because #255 tookPlaylist.tsx:152, andno-clone-elementis 2 because the first count missed
FormField.@eslint-react/no-array-index-key@eslint-react/set-state-in-effect@eslint-react/no-forward-ref@eslint-react/exhaustive-deps@eslint-react/dom-no-script-url@eslint-react/use-state@eslint-react/no-clone-element@eslint-react/purity@eslint-react/dom-no-dangerously-set-innerhtml@eslint-react/naming-convention-ref-name@eslint-react/no-use-context@eslint-react/no-context-provider@eslint-react/web-api-no-leaked-fetch@eslint-react/*total@stylistic/jsx-self-closing-compperfectionist/sort-jsx-propsprettier/prettierpadding-line-between-statementsprettier/prettiermoved, and the criterion asked it not to. Six warnings, all decreases, allon files this branch rewrites: unwrapping
forwardRefdedents the atom bodies, and the newdisable lines split runs prettier wanted joined. No file regressed, and no file this branch does
not otherwise change moved.
perfectionist/sort-jsx-propsis unchanged, as asked.Manual verification
Nothing here changes markup, but four of the changes move when state is set, which the node-only
suite cannot see.
pnpm ladle→ the five form atoms: each still focuses, types and validates.use(Context)and<Context>replace the provider.Notes for reviewer
Playlist.tsx:152, the index key this branch deliberately left alone, sono-array-index-keyis at zero without this PR touching that file. The merge had one conflict, inselectTrack's dependency array inhooks/audio/usePlaylistAudioPlayer.ts: main's[currentTrackIndex, playerControls]won, because fix(playlist): a filtered playlist plays and highlights the wrong track #255 rewrote that function's body and this branch's array named a value it no longer reads.dom-no-script-urlarrived with fix(link): the Link atom enforces neither the affordance nor the scheme gate it is credited with #257's scheme gate, which assertsLinkandSocialIconrefuse ajavascript:URL — the rule reads the proof as four security risks. Scoped off for those three files.no-unnecessary-use-prefixdoes not fire attests/guards/ssr-visibility.test.tsany more, and there is norules-of-hooksblock undertests/guards/to extend. I removed a dead@typescript-eslint/no-explicit-anydirective intests/guards/preview-discovery.test.tsthat eslint was reporting as unused.web-api-no-leaked-fetchverdict is built as written — scoped off, with the reason. TheAbortControllerit calls "worth doing on its own" is still worth doing: thecancelledflag discards the result but the request and its JSON parse still complete, so a fast navigation pays for two. Left out to keep this a lint pass.<Paragraphs>renderer would take five disables to one, butContentOverlayspaces paragraphs withmb-4on all but the last andAtlasContentwithmt-4on all, so unifying them is a design change no test here can see. HoldinguseAudioPlayer'splayerin a ref would let its dep array be honest, but it changes which player object a live effect holds, in audio code with no test coverage that fix(playlist): a filtered playlist plays and highlights the wrong track #255 is already reworking. AuseClientRandomhook for the two random-after-hydration sites is two sites — the threshold, not past it.TableOfContentskeys a heading on${slugify(text)}-${index}. If two headings slugify alike the index separates the keys, but thehref="#anchor"they both emit stays ambiguous, so the second link is already broken. The key is concealing it. Filed as fix(rich-text): two headings that slugify alike share one anchor id #266, which has to settle how the two sides agree on a numbering before it can be built.Detail
Why ~37 inline disables rather than a config block per rule. A
filesblock forno-array-index-keyovercomponents/**would silence a genuinely bad newkey={index}in thesame files. Every current site is now either changed or explained, so the rule fires on exactly
the new ones.
eslint.config.js's own comment at theno-restricted-syntaxblock already statesthis principle for the opposite case — that rule is scoped by
filesbecause it is one sharedrule id — and the new header above the scoped blocks says which belongs where. Narrowing the glob
to the eleven named files does not rescue it:
HeaderDropdown.tsxandAtlasContent.tsxeachhold a second index key whose reason is different, and a block would state the shared one over
those too.
Why all eight rules are promoted to
error.eslint .runs with no--max-warnings, and--max-warnings 0is unavailable here: a thousand other warnings remain. So a rule left atwarnrecords a violation nobody is stopped by, which would make this branch a snapshot rather than a
ratchet. Five of the eight name idioms React 19 replaced outright — the fix is mechanical and a new
one is always a mistake. The other three —
no-array-index-key,set-state-in-effectandexhaustive-deps— are judgements, so anerrordoes force a future author to change the code orwrite a disable with a reason. That was the question thread,
and the answer was to promote all eight here rather than in a follow-up. It costs no new
suppression: all three are already at zero on this branch.
The ref guard, and what it is worth.
forwardRef's absence was a type error. Now arefleftout of the destructure still reaches the element through
{...props}and keeps working, and adestructured-but-unwired one is a single
no-unused-varswarning among twenty-one, in a run thatexits 0. The guard counts every element of the atom's tag, because
Inputrenders a second<input>for its icon branch that no test renders — the first version of this guard passed withthat branch's ref deleted. Watched failing: deleting
<select ref>failsSelect, deleting theicon branch's
<input ref>failsInputwithexpected 1 to be 2. Its TSX parse and AST walkare
ssr-visibility.test.ts's, hoisted intotests/guards/_source-scan.tsrather than copied.Rejected: a regex for the ref guard. Three lines instead of twenty, but a
>inside anattribute expression ends the match early, and the test would then be about where
refsits inthe prop order rather than about whether the element has one.
Rejected:
key={link.href}on the six nav and footer lists. It is a real stable key and theagent that raised it was right that "never reordered" overclaims. The ticket settled these as
keep, and the reason that actually holds is narrower: none of those rows carries state, so reusing
one across a reorder costs React a prop diff. The comments now say that instead.
Measured, not acted on. The new guard costs about 460 ms of the suite, 165 ms of it loading
typescriptinto a second Vitest worker —ssr-visibility.test.tsalready loads it, and per-fileisolation means it is evaluated twice. Folding the five-file assertion into that guard would save
it. Not done: the two guards answer unrelated questions and the cost is half a second.
prettierper file, againstmainat e868c42. Checkbox 3→2, Radio 3→2, Select 7→5,Header 2→1, usePlaylistAudioPlayer 1→0.
padding-line-between-statements65→63, both in filesthis branch rewrites (Countdown 1→0, usePlaylistAudioPlayer 4→3).
Closes #250
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code