Repository navigation
chore: resolve oxlint warnings and fail lint on warnings - #275
Merged
Merged
Conversation
…ng outer variables Resolves oxlint react(globals) warnings in router tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvUTkjchXRXRCCYxwb2jqv
… NavLink Replaces setState in an effect (react(set-state-in-effect) warning) while keeping the hydration render identical to the server render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvUTkjchXRXRCCYxwb2jqv
Closes #274 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvUTkjchXRXRCCYxwb2jqv
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.
Closes #274.
pnpm lintprinted 12 warnings onmaster. It now prints none, and the lint script runsoxlint --deny-warningsso new warnings fail CI.Changes
Router tests:
react(globals)(11 warnings)Test components in
routeProp,hooks,loaderandRouteDisplaytests assigned render-time values to variables declared outside the component. They now pass those values tovi.fn()spies, so the rule stays on for test files.toBeonspy.mock.lastCall?.[0].toHaveBeenLastCalledWith(...).RouteDisplaysetter tests readsetSearchParamsfrom the spy just before calling it, so they still call the latest setter.example-pathless-ssrNavLink:react(set-state-in-effect)(1 warning)The
useState+useEffect(() => setIsClient(true), [])client check is nowuseSyncExternalStorewith a server snapshot offalseand a client snapshot oftrue. React uses the server snapshot during hydration, so the first client render still matches the server HTML. It then re-renders withtrue.Lint script
"lint": "oxlint"is now"lint": "oxlint --deny-warnings". CI already runspnpm run lint.Testing
pnpm lint: 0 warnings, exit 0pnpm typecheckandpnpm format:checkpass/,/recipesand/favoritesin Chromium withvite preview. After hydration each page marks the correct nav link active, with no hydration errors.Generated by Claude Code