Skip to content

chore: resolve oxlint warnings and fail lint on warnings - #275

Merged
uhyo merged 3 commits into
masterfrom
fix/lint-warnings-274
Oct 22, 2026
Merged

uhyo merged 3 commits into
masterfrom
fix/lint-warnings-274

Conversation

@uhyo

@uhyo uhyo commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Closes #274.

pnpm lint printed 12 warnings on master. It now prints none, and the lint script runs oxlint --deny-warnings so new warnings fail CI.

Changes

Router tests: react(globals) (11 warnings)

Test components in routeProp, hooks, loader and RouteDisplay tests assigned render-time values to variables declared outside the component. They now pass those values to vi.fn() spies, so the rule stays on for test files.

  • Tests that check the component received the exact same route object still use toBe on spy.mock.lastCall?.[0].
  • The other tests use toHaveBeenLastCalledWith(...).
  • The RouteDisplay setter tests read setSearchParams from the spy just before calling it, so they still call the latest setter.

example-pathless-ssr NavLink: react(set-state-in-effect) (1 warning)

The useState + useEffect(() => setIsClient(true), []) client check is now useSyncExternalStore with a server snapshot of false and a client snapshot of true. React uses the server snapshot during hydration, so the first client render still matches the server HTML. It then re-renders with true.

Lint script

"lint": "oxlint" is now "lint": "oxlint --deny-warnings". CI already runs pnpm run lint.

Testing

  • pnpm lint: 0 warnings, exit 0
  • pnpm typecheck and pnpm format:check pass
  • Router tests: 22 files and 371 tests pass
  • Built the pathless-SSR example and loaded /, /recipes and /favorites in Chromium with vite preview. After hydration each page marks the correct nav link active, with no hydration errors.

Generated by Claude Code

…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
@uhyo
uhyo merged commit 83ba1f9 into master Oct 22, 2026
1 check passed
@uhyo
uhyo deleted the fix/lint-warnings-274 branch October 22, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint: resolve oxlint warnings in router tests and example-pathless-ssr

2 participants