Skip to content

Clear useExhaustiveDependencies lint debt and gate CI on full lint#69

Merged
paulwellnerbou merged 2 commits into
mainfrom
claude/thirsty-jang-849357
May 8, 2026
Merged

Clear useExhaustiveDependencies lint debt and gate CI on full lint#69
paulwellnerbou merged 2 commits into
mainfrom
claude/thirsty-jang-849357

Conversation

@paulwellnerbou
Copy link
Copy Markdown
Owner

@paulwellnerbou paulwellnerbou commented May 8, 2026

Summary

Closes #68. Resolves the 66 useExhaustiveDependencies error-class cases the issue called out (#67 already cleared the other rule classes), and adds typecheck + lint as CI gates so they can't pile up again.

DocumentLayout (the bulk)

  • resolveIdentity is now a useCallback([displayName, effectiveDisplayName]) so downstream callbacks list it as a single dep instead of mirroring the two display-name fields.
  • refreshDoc / refreshThreads hoisted above the effects/callbacks that need them as deps (the dep array is evaluated at render time — TDZ otherwise).
  • 12 callback dep arrays updated to reference resolveIdentity and refreshThreads / refreshDoc directly. The corresponding eslint-disable comments are removed.

Other files

Same pattern — callback deps updated where straightforward, biome-ignore for re-trigger / mount-once / static-fn cases. InlineCommentsLayer hoists resolveAnchorElement to module scope so it's stable as a dep.

Discipline for biome-ignore

Each ignore carries a reason explaining why the dep is there or omitted — so future readers can judge whether the rationale still holds. Reserved for: mount-time deep link, doc-swap resets, layout remeasure, headings scroll, content-swap re-attach, events subscription, mount-once editor setup, etc.

CI gate

build-and-push.yml now runs bun run typecheck and bun run lint before tests. Any future PR introducing a biome error fails the build. Lint warnings stay non-blocking.

Test plan

  • bun run typecheck clean
  • bun run lint exits 0 (0 errors; 512 warnings only)
  • bun run test:ci — 393 pass, 4 skip, 0 fail
  • CI run on this PR is green (verifies the new typecheck + lint steps actually fire)
  • Manual smoke: open a doc, scroll, toggle inline comments, edit a comment, search the doc — confirms the DocumentLayout dep-array refactor didn't break the effects that drive heading-scroll, comment refresh, or layout remeasure.

🤖 Generated with Claude Code

Closes #68. Resolves the 66 useExhaustiveDependencies error-class
cases the issue called out (#67 already cleared the other rule
classes), and adds typecheck + lint as CI gates so they can't pile
up again.

Approach in DocumentLayout (the bulk of the cases):

- `resolveIdentity` is now a `useCallback([displayName,
  effectiveDisplayName])` so downstream callbacks list it as a single
  dep instead of mirroring the two display-name fields.
- `refreshDoc` / `refreshThreads` hoisted above the useEffects /
  useCallbacks that need them as deps (the dep array is evaluated at
  render time — TDZ otherwise).
- 12 callback dep arrays updated to reference `resolveIdentity` and
  `refreshThreads`/`refreshDoc` directly. The corresponding
  eslint-disables are removed.

`biome-ignore` (with reason) is reserved for genuine intentional
re-trigger effects: mount-time deep link, doc-swap resets, layout
remeasure, headings scroll, content-swap re-attach, events
subscription. Each ignore explains *why* the dep is there or omitted.

Other files: same pattern — callback deps updated where straight-
forward, biome-ignore for re-trigger / mount-once / static-fn cases.
`InlineCommentsLayer` hoists `resolveAnchorElement` to module scope
so it's stable as a dep.

CI now runs `bun run typecheck` and `bun run lint` before tests, so
any future PR introducing a biome error fails the build. Lint
warnings stay non-blocking.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@paulwellnerbou paulwellnerbou force-pushed the claude/thirsty-jang-849357 branch from 753c99b to 3ee48cd Compare May 8, 2026 07:31
@paulwellnerbou paulwellnerbou changed the title Clear all biome error-level lint debt and gate CI on it Clear useExhaustiveDependencies lint debt and gate CI on full lint May 8, 2026
@paulwellnerbou paulwellnerbou requested a review from Copilot May 8, 2026 07:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clears the remaining Biome lint/correctness/useExhaustiveDependencies error-level violations in the web app by making hook dependencies explicit (or explicitly ignored with rationale), and prevents regressions by gating CI on typecheck and lint.

Changes:

  • Refactors several effects/callbacks (notably in DocumentLayout) to use stable useCallback helpers and updated dependency arrays, removing prior hook-deps suppressions.
  • Adds targeted biome-ignore lint/correctness/useExhaustiveDependencies annotations (with reasons) for intentional “re-trigger” deps and mount-once subscriptions.
  • Updates GitHub Actions workflow to run bun run typecheck and bun run lint as CI gates before tests.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/web/src/pages/ViewPage.tsx Adds a Biome ignore to keep intentional refetch-trigger deps on the document-load effect.
apps/web/src/pages/HomePage.tsx Adds a Biome ignore for an effect that intentionally omits a render-local reset function from deps.
apps/web/src/pages/EditPage.tsx Tweaks deps and adds a Biome ignore for scroll-sync reattachment triggers.
apps/web/src/components/Toc.tsx Adds Biome ignores for intentional re-trigger deps (expand/scroll behavior).
apps/web/src/components/ThreadComposer.tsx Adds Biome ignores for mount-once editor dependency loading and single-mount editor setup.
apps/web/src/components/RenderedDoc.tsx Adds Biome ignores to keep intentional re-attach / re-highlight triggers tied to rendered.html and related deps.
apps/web/src/components/PasswordPromptDialog.tsx Adds a Biome ignore for a stable event subscription effect that intentionally omits a render-local function dep.
apps/web/src/components/InvitesPanel.tsx Adds a Biome ignore to keep displayName as an explicit refetch trigger.
apps/web/src/components/inline-comments/InlineCommentsLayer.tsx Hoists resolveAnchorElement to module scope and updates deps/ignores for layout remeasure + reattach behavior.
apps/web/src/components/HistoryList.tsx Adds Biome ignores to preserve intentional refetch/reset triggers (version, uid).
apps/web/src/components/DocumentLayout.tsx Hoists refreshDoc/refreshThreads, memoizes resolveIdentity, and updates many callback deps to remove hook-deps suppressions.
apps/web/src/components/BlockActions.tsx Adds a Biome ignore to keep an intentional rebind trigger for a resize observer.
apps/web/src/components/ActivityList.tsx Adds Biome ignores to preserve intentional refetch/reset triggers (version, uid).
.github/workflows/build-and-push.yml Gates CI by adding bun run typecheck and bun run lint before tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/src/pages/ViewPage.tsx Outdated
Comment thread apps/web/src/components/ThreadComposer.tsx Outdated
- ViewPage: reloadNonce is bumped by the "Try again" button on the
  error screen, not after password unlock.
- ThreadComposer: the stronger invariant for omitting `format` from
  the deps is that ProposalSourceField is keyed on `${docFormat}-…`
  by its parent, so a format change remounts the component with a
  fresh closure rather than mutating the existing one.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

@paulwellnerbou paulwellnerbou merged commit e801be4 into main May 8, 2026
5 checks passed
@paulwellnerbou paulwellnerbou deleted the claude/thirsty-jang-849357 branch May 8, 2026 11:29
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.

Clear lint/correctness/useExhaustiveDependencies (~66 cases)

2 participants