Repository navigation
chore(deps): move off the end-of-life eslint 9 line - #251
Conversation
Every `eslint@9` release is deprecated on npm, and `9.39.5` is the last of the line, so no in-range update will ever move it again. The line gets no further fixes, security ones included. `[email protected]` is what pinned us there, and it does not run on `eslint@10` at all: ESLint 10 removed the rule-context API its React-version detection calls, so loading the plugin aborts the whole run with `contextOrFilename.getFilename is not a function`. Waiting for a `^10` peer range would not help — the fix is upstream code, not a range bump. Three maintained packages cover what it did: - `@eslint-react/eslint-plugin`'s `recommended-typescript` set, for the 17 live rules of the old recommended set - `@stylistic/jsx-self-closing-comp`, for `react/self-closing-comp` - `perfectionist/sort-jsx-props`, for `react/jsx-sort-props` — `@stylistic` 6 dropped its own sort rule `perfectionist` takes the old rule's `reservedFirst`, `shorthandFirst` and `callbacksLast` flags as group order, and its case-sensitive sort as an explicit `ignoreCase: false`. That lands at 838 warnings where the old rule reported 1004, with `prettier/prettier` unchanged at 1032. `react/prop-types`, `react/jsx-uses-react`, `react/no-unescaped-entities` and `react/react-in-jsx-scope` were set to `off`; none exists in the new set, so there is nothing left to turn off. `react/jsx-uses-vars` also disappears, and `@typescript-eslint/no-unused-vars` counts JSX references in its place — confirmed against an unused import beside a component used only in JSX. `@eslint/js` goes with it. It was declared but imported nowhere, and has no 10.x release to move to. The one `react/*` rule left at `error` everywhere is `rules-of-hooks`. It is off under `tests/guards/`, where the specs read the app's source with the TypeScript compiler API: a `useX` there is a token being matched, not a hook being called. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
`LayoutChrome` returned early when SahajCloud settings were missing, then called `useSiteNav` below that return. The hook count therefore differed between a render with settings and one without, and a client-side navigation that crosses that line keeps the same component instance — React renders fewer hooks than it expects and throws. `LayoutMap` already splits for exactly this reason. Split the same way: the export reads the data and guards, and `Chrome` holds every hook below it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
`getDefaultIcon` was declared inside the render and returned a component, so it read as a component built on every render — a component built that way loses its state each time. The icons are four fixed imports, so a table at module scope says the same thing without the call. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
React allows a `useEffectEvent` function to be called only from an Effect in the same component, and never to be assigned or passed down. `play`, `pause`, `togglePlayPause` and `seekTo` broke that: the first three went into the returned `controls`, and `seekTo` was called from a `useCallback`. `load` broke it too, by registering `handleOnPlay` and `handleOnPause` with howler. A caller only ever holds the newest `controls` — the object is rebuilt every render — so a plain function in the hook body reads the same latest props an Effect Event would, and the memoisation bought nothing either way. The three howler callbacks are the exception: howler keeps them past the render that registered them, so they read the caller's handlers from a ref an unconditional Effect keeps current. `updateTime` stays an Effect Event; it is called only from Effects. No behaviour changes. `exhaustive-deps` also drops a warning, with the `useCallback` that carried it gone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
Nothing checked which icon each input type gets, so the table the previous commit introduced could have swapped a pair and still rendered an icon. Comparing against the same input with the icon named explicitly is what notices. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
The `tests/guards/` carve-out is gone. Forcing `rules-of-hooks` back on produced exactly one error, from a helper named `useStateArgument` that calls no hooks — a real misnamed function, not a token being matched, and `no-unnecessary-use-prefix` was still reporting the cause beside it. Renaming it to `stateArgument` fixes both and leaves the rule on for the whole tree. The React preset now arrives through `extends` rather than an object spread. A spread works only while the preset stays a plain object: the day it ships an array, the spread drops every rule and `pnpm lint` passes having checked nothing. `usePlaylistAudioPlayer` had the same hazard this branch fixed one file over — `handleTrackEnd`, an Effect Event, handed to `load` for howler to store. Lint misses it because the hand-off crosses a module boundary. The play order moves to a ref and the next index comes from the state updater, so no read is stale. Smaller: `latestRef`'s effect takes a dependency list, matching `useCircularProgress`; the arrow wrappers around the howler callbacks go, since they existed only because an Effect Event could not be passed as a value; `Chrome` takes `settings` alone and reads its own route data, as `MapChrome` does, rather than taking one fact in two props; `DEFAULT_ICONS` is keyed on the input type instead of indexed through an empty-string sentinel. `Input.test.tsx` names the marker it asserts on. Both absence cases assert a negative, and a negative with nothing anchoring it passes whether or not the icon renders. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
Two findings from the review pass. `DEFAULT_ICONS[type]` indexed an object literal with a string the component does not validate — FormBuilder passes a SahajCloud block type straight through — so `type="toString"` found `Object.prototype.toString`, passed the truthiness check, and React wrote `[object Undefined]` into the icon slot. The `switch` this replaced returned `null` for every unknown type, so the refactor lost a total case. `Object.hasOwn` restores it. A `Map` would say it better, but `static-components` rejects a lookup call as a component built during render. Reading the old plugin's own `recommended` config: 21 rules on, four turned off here, so 17 live. `react/jsx-no-duplicate-props` and `react/no-unknown-property` have no counterpart in the new set, but `tsc --noEmit` reports both (TS17001, TS2322), and CI runs it. `react/jsx-no-target-blank` is covered by neither, so `dom-no-unsafe-target-blank` is enabled explicitly — the new set ships it but leaves it out of `recommended-typescript`. `jsx-no-comment-textnodes` and `jsx-no-children-prop` arrive as warnings where they were errors; both report zero, so parity costs nothing. All three verified against a probe file. `react/display-name` stays unenforced. Its replacement exists, but the only call site needed an inline disable, and the rule buys a devtools label rather than a correctness guarantee. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
The new rule set fails `pnpm lint` on a conditional hook and on a component built during render. Neither error names the shape that satisfies it, and the layout split is not guessable from the message. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXEEFcnjh2zN69zzt2
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 | 41be3be | Commit Preview URL Branch Preview URL |
Nov 17 2026, 11:49 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 | 41be3be | Commit Preview URL Branch Preview URL |
Nov 17 2026, 11:49 PM |
|
@sydevs-bot address |
…nt-10 # Conflicts: # pnpm-lock.yaml
Reviewer chose option B on the open question: restore severity parity for the `react/display-name` slot rather than leave it unenforced. `@eslint-react/no-missing-component-display-name` is narrower than the rule it stands in for. It reports only an anonymous component wrapped in `memo` or `forwardRef`, where `react/display-name` reported any function returning JSX without a name. So it costs nothing here: the five `forwardRef` components all assign to a named const, and `withDebugOverlay`'s returned converter is not a memo or a forwardRef, so the inline disable this branch deleted stays deleted. Confirmed by a probe `memo(() => <div />)`, which the rule errors on, and by a full `eslint .` reporting zero errors. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYCGD5HrUJ8Ghy4StG
|
Answered the Merged Lean gate on the merged tree: lint 0 errors / 2059 warnings (unchanged — the new rule reports nothing), 🤖 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 matches the ticket. Every file outside eslint.config.js and package.json traces to an error the new ruleset reports, and #243 named each one. One aggregate question stands: three plugins replace one, and the third serves a single warning.
The riskiest change carries no automated cover — both audio hooks lost every useCallback and useEffectEvent, and no test drives howler. I checked identity instead: nothing in MeditationPlayer or usePlaylistAudioPlayer depends on those functions' identity, and handleSeek's [controls] was already unstable on main. The manual steps are the real gate.
## Preview still reads "Preview pending" while both branch previews deployed hours ago, URLs in this thread. Put them in the body.
Findings
- should-fix —
eslint.config.js:163: a whole plugin for one rule that fires once. - should-fix —
AGENTS.md:128: path-scoped guidance in the file that forbids it. - consider —
layouts/LayoutChrome.tsx:49:Chromere-readsuseData;MapChromedoes not. - consider —
eslint.config.js:3:reactnow names a different package.
What was checked
Read whole on the branch: eslint.config.js, Input.tsx, Input.test.tsx, LayoutChrome.tsx, LayoutMap.tsx, both audio hooks, MeditationPlayer.tsx as consumer. git grep re-ran two criteria: no react/* rule, no inline react/* disable. Input.tsx:86 guards on truthiness, so IconComponent losing null for undefined is harmless.
Ladder walked on defineConfig, Object.hasOwn, DEFAULT_ICONS, Chrome, latestRef, playOrderRef. Both refs earn their place, playOrderRef more than its comment claims: toggling shuffle changes playOrder without re-running the load effect, so howler would fire a stale order.
No contract surface touched. Previews not opened, per this skill.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`react` named eslint-plugin-react before this branch and now names \@eslint-react/eslint-plugin. A reader checking that no `react/*` rule survives reads `react.configs[…]` as the plugin that went. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcpKcvEQhUgJURnSx
Chrome read useData three lines after LayoutChrome read it, so the two call sites each had to name RouteData. MapChrome, the sibling the split cites, takes only props. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcpKcvEQhUgJURnSx
AGENTS.md says sixty lines above that path-scoped guidance does not live in it, and it loads every session. The two component shapes belong to design-system (components, layouts, pages); the use-prefix rule to testing (tests). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcpKcvEQhUgJURnSx
|
Addressed the adversarial review's four findings — 41be3be. Adopted
Rebutted
Merged Body refreshed: preview URLs, the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
[email protected]replaces the deprecated 9 line;eslint-plugin-react, which pinned us there and does not run on 10 at all, is replaced by three maintained packages, and the unused@eslint/jsis dropped.LayoutChrome, sixuseEffectEventescapes across the two audio hooks, and a component built during render inInput.Change outline
Contract — what the lint gate enforces
The old
recommendedcarried 21 rules; four were off here, so 17 were live. Read off the plugin's own config object, not the diff:perfectionisthas noreservedFirst/shorthandFirst/callbacksLastflags, so those become group order plus twocustomGroups. The block is load-bearing: without it the rule reports ~110 more warnings, and the repo's prop order silently becomes plain alphabetical.Components — two shapes that broke a React rule
LayoutChromecalled a hook below an early return, so hook order differed between a render with settings and one without.LayoutMapalready split for this exact reason:LayoutChrome({ children }) layouts/LayoutChrome.tsx useData<RouteData>() if (!settings) → bare children # the error page, no chrome - useSiteNav(settings, …) # a hook below the return - usePageContext(), useT(), leadSplashFromRouteData(data) + <Chrome data={data} settings={settings}> + + Chrome({ data, settings, children }) # module scope, reconciled by type + usePageContext(), useT() # data arrives as a prop, so + useSiteNav(settings, …) # one useData read serves both + # now unconditionalInputpicked its icon through a call, which the rule reads as building a component during render wherever the function is declared — moving theswitchto module scope does not satisfy it (measured):Input({ icon, type, … }) components/atoms/form/Input/Input.tsx - getDefaultIcon() # inner function returning a component - switch (type) → MagnifyingGlassIcon | … | null + DEFAULT_ICONS # module-scope table, no call + icon === undefined && type && Object.hasOwn(DEFAULT_ICONS, type) + ? DEFAULT_ICONS[type] : icon # hasOwn: see NotesFlow — how the audio hooks reach the caller's callbacks
React allows a
useEffectEventfunction to be called only from an Effect, and never to be assigned or passed down. Both hooks did both. A caller only ever holds the newestcontrols— that object was already rebuilt every render — so a plain function reads the same latest props, and the memoisation bought nothing:useAudioPlayer(options) hooks/audio/useAudioPlayer.ts updateTime = useEffectEvent(…) # stays: called only from the # polling Effect, which must not # capture a stale `player` - handleOnPlay/Pause/End = useEffectEvent(…) # handed to howler, fired later + latestRef = useRef({ onPlay, onPause, onEnd }) + useEffect(… , [onPlay, onPause, onEnd]) # howler outlives the render + handleOnPlay/Pause/End = plain, read latestRef - seekTo = useEffectEvent(…); seek = useCallback(→ seekTo) + seek = plain # two indirections collapse to one - play/pause/togglePlayPause = useEffectEvent(…) # returned in `controls` - load = useCallback(…) # calls the Effect Events + all plain usePlaylistAudioPlayer(options) hooks/audio/usePlaylistAudioPlayer.ts - handleTrackEnd = useEffectEvent(…) # passed into load() for howler to store + playOrderRef = useRef(playOrder) # lint misses this one: the hand-off + handleTrackEnd = plain # crosses a module boundary + setCurrentTrackIndex(current => …) # updater, so no index read is stalePreview
Both are branch hosts, so each rebuilds on push. Pages worth opening, since no test here renders a browser:
/,/<slug>) — theLayoutChromesplit: header, nav and footer must be unchanged, and a lead-splash page must still overlay its headerInputandMeditationPlayerstories — the icon table, and the audio controls after losing their memoisationTest results
pnpm lint(0 errors, 2060 warnings),tsc --noEmitclean,vitest run982 passed across 100 filesInput.test.tsx;tests/guards/ssr-visibility13 passed after the renamesecurityReview.triggerPatternis touched, and CI runs the build and both preview deploysPer-rule counts against
main, which is what the ticket asks for rather than totals. Both columns re-measured after themainmerge, with one command per tree:main@ 3cbf796prettier/prettierreact/jsx-sort-props→perfectionist/sort-jsx-propsreact/self-closing-comp→@stylistic/jsx-self-closing-comp@typescript-eslint/no-unused-varspadding-line-between-statementsno-console@eslint-react/*warningsManual verification
useCallback/useEffectEventwrappers, and no test here can drive howler.Notes for reviewer
One acceptance-criteria item cannot be satisfied as written.
npx eslint --print-config … | grep -c '"react/'returns 16, not 0. All 16 come fromeslint-config-prettier, which shipsreact/*formatting rules asoffwhether or not the plugin is installed. Noreact/*rule is active — verified by parsing the printed config rather than grepping it.Two findings joined here rather than becoming tickets, both surfaced by the review pass:
Input's table is indexed by a string the component does not validate (FormBuilderpasses a SahajCloud block type straight through), sotype="toString"foundObject.prototype.toString, passed the truthiness check, and React wrote[object Undefined]into the icon slot. Theswitchit replaced returnednullfor any unknown type, so the refactor had lost a total case.Object.hasOwnrestores it; aMapreads better butstatic-componentsrejects.get()as a component built during render. Pinned by a test that fails without the guard.tests/guards/ssr-visibility.test.tshad a helper calleduseStateArgumentthat calls no hooks. My first attempt disabledrules-of-hooksfor all oftests/guards/**with a comment claiming the rule was matching string fixtures. That was wrong: it was reporting a real misnamed function, andno-unnecessary-use-prefixwas still pointing at the cause beside it. Renaming it fixed both and the carve-out is gone, so the rule covers that tree.display-nameis enforced again, at the reviewer's choice, and it cost no code.@eslint-react/no-missing-component-display-namereports only an anonymous component wrapped inmemoorforwardRef, wherereact/display-namereported any function returning JSX without a name. The fiveforwardRefatoms all assign to a named const, andwithDebugOverlay's returned converter is neither wrapper, so the inline disable this branch deleted stays deleted. Confirmed by a probememo(() => <div />), which the rule errors on. Severity parity, not detection parity: an anonymous component outside those two wrappers is still unreported.Judgement calls worth checking:
extends, not an object spread. A spread works only while the preset stays a plain object; the day it ships an array, it would drop every rule andpnpm lintwould pass having checked nothing.updateTimeis the one survivinguseEffectEvent. It is called only from the 100ms polling Effect, whose deps are[player.isPlaying]; as a plain function it would hold theplayerof the render that started the interval.@eslint-react/*warnings are triaged in refactor(components): clear the React 19 warnings the new lint set found #250 rather than fixed here, so this stays a dependency migration. The triage is in that body, site by site, including which are false positives.Deliberately not done:
useAudioPlayerstill re-derives "active sound id or the library fallback" in four places and duplicates itsplayer.loadoption literal. Both predate this branch; collapsing them would turn a lint migration into an audio refactor with no test behind it.Also filed: #249 — a filtered
Playlistplays and highlights the wrong track. Theno-array-index-keywarning on that line sat on a genuine index mismatch againstMusicLibrary, which passes indices into the unfiltered array.Detail
Why
eslint-plugin-reactcould not stay. ESLint 10 removed the rule-context API its React-version detection calls, so loading the plugin aborts the entire run withcontextOrFilename.getFilename is not a function— zero files linted, non-zero exit. Waiting for a^10peer range would not have helped; the fix is upstream code.7.37.5is stilllatest, and thenexttag points at an older7.8.0-rc.0.The install snag the ticket warned about did not reproduce.
@typescript-eslint/[email protected]installed cleanly, so nopnpm.overridespin was added.Three packages, because no one of them covers the ground.
@stylisticv6 dropped its ownjsx-sort-props(v5 had it;jsx-props-stylegoverns line breaks, not order), so the sort rule goes toperfectionistand the self-closing rule to@stylistic.@eslint-reactships neither.@stylisticearns its place for one rule firing once, and the rule stays: of the three plugins only@stylisticships it, checked against@eslint-react's 141 rules andperfectionist's. Its module load measures 69ms.@eslint/jswas declared but imported nowhere, and has no 10.x release; grepped to zero references outsidenode_modules.Checklist items confirmed by experiment, not inference:
no-restricted-syntaxtranslation guard still fires on a JSX string literal incomponents/react/jsx-uses-varsreplacement checkdom-no-unsafe-target-blankfires on a probe<a target="_blank">, so the restored line is not deadpnpm why eslintshows a single 10.x copy, andnpm view [email protected] deprecatedis emptyLint cost, measured: the three new plugin imports add ~540ms of module load per invocation, and the React rules ~740ms of the ~5.6s rule time (
prettier/prettieris 4.3s of it). Scoping the React config out oftests/,server/andscripts/would reclaim ~214ms; not done, because after the rename those trees report nothing, and theignoreswould add a carve-out and a blind spot for a future React file there.Closes #243
Generated by Claude Code