Skip to content

chore(tooling): editorconfig, CODEOWNERS, jsdom component tests, knip#636

Merged
BigSimmo merged 1 commit into
mainfrom
claude/repo-tooling-4pack
Jul 14, 2026
Merged

chore(tooling): editorconfig, CODEOWNERS, jsdom component tests, knip#636
BigSimmo merged 1 commit into
mainfrom
claude/repo-tooling-4pack

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds four developer-productivity tools that do not overlap with tooling main
already ships. While this work was in progress, main independently landed a
git-hooks system (install-git-hooks.mjs), a bundle budget (check-bundle-budget.mjs),
axe a11y scanning, and server-side Sentry (@sentry/node + error-capture.ts) — so
those four are intentionally dropped in favour of main's versions, leaving only
the non-conflicting additions here:

  • .editorconfig — editor consistency aligned to .prettierrc and .gitattributes (lf, utf-8, 2-space, final newline; markdown + generated database.types.ts exempt from trailing-whitespace trimming).
  • .github/CODEOWNERS — review routing on the high-risk paths flagged in AGENTS.md (supabase, env, RAG/retrieval/search, source governance, workflows). Solo-owner today; sections are ready for collaborators.
  • jsdom + @testing-library/react — an interactive component-test tier as a separate vitest project (tests/**/*.dom.test.tsx, jsdom env, tests/setup/jsdom.setup.ts). The existing node project (tests/**/*.test.ts) is byte-for-byte unchanged. Seeds two example specs (an AccessibleTable expand/dialog interaction and a useEventCallback renderHook test).
  • knip — advisory dead-code / unused-dependency detection (npm run check:knip, knip.json). Not wired into any gate; false positives (tailwindcss, server-only, taskkill, Deno edge fns) suppressed.

Supersedes PR #623, which a Copilot bot mechanically merged into a competing-systems state (two hook systems, two bundle budgets, @sentry/nextjs alongside main's @sentry/node). This branch is the clean reconciliation: current main + only the 4 net-new tools. #623 can be closed.

Verification

Run against current main:

  • test235 test files / 2209 tests pass, 0 failures (node project unchanged + new jsdom project 4/4)
  • typecheck, lint, format:check — clean (exit 0)
  • check:knip — runs (advisory)

No source-logic, build, bundle, retrieval, answer-generation, privacy, or clinical behavior changed — these are config + test-tooling additions only.

Clinical Governance Preflight

N/A — does not touch ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.

Notes

  • The jsdom project runs under the normal npm run test, so it's covered by the existing required static-pr gate with no CI changes.
  • knip is deliberately advisory: a fresh run on a mature repo surfaces a large triage list; gating on it would be a regression. Baseline (~164 unused exports / 66 types) is future cleanup.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Added browser-like tests for accessible tables and event callbacks.
    • Added shared test setup with DOM cleanup, accessibility matchers, and responsive behavior support.
    • Improved test configuration to run both Node and browser-environment suites.
  • Chores

    • Added standardized editor formatting rules.
    • Added automated unused-code checking configuration and command.
    • Added repository code ownership rules.

…knip

Adds four developer-productivity tools that do not overlap with tooling main
already ships. (git-hooks, a bundle budget, axe a11y scanning, and Sentry all
landed on main independently while this work was in progress, so those are
dropped in favour of main's versions.)

- .editorconfig — editor consistency aligned to .prettierrc / .gitattributes.
- .github/CODEOWNERS — review routing on the high-risk paths flagged in AGENTS.md.
- jsdom + @testing-library/react — interactive component tier as a SEPARATE vitest
  project (tests/**/*.dom.test.tsx); the existing node suite is untouched.
- knip — advisory dead-code / unused-dependency detection (npm run check:knip; not
  wired into any gate).

Verified against current main: 235 test files / 2209 tests pass (0 failures),
typecheck / lint / format:check clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabase Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds jsdom-based Vitest projects, React Testing Library setup, DOM tests for AccessibleTable and useEventCallback, repository editor and ownership rules, and Knip configuration with an npm check script.

Changes

Testing and Repository Tooling

Layer / File(s) Summary
Vitest and jsdom test environment
vitest.config.mts, tests/setup/jsdom.setup.ts, package.json
Vitest is split into Node and jsdom projects, with DOM setup hooks, browser API stubs, and testing dependencies.
DOM behavior test coverage
tests/accessible-table.dom.test.tsx, tests/use-event-callback.dom.test.tsx
Tests cover table rendering, mobile expansion, callback identity stability, and latest-handler behavior.
Repository quality and ownership configuration
.editorconfig, .github/CODEOWNERS, knip.json, package.json
Editor defaults, path-based ownership, Knip analysis settings, and the check:knip script are added.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main tooling-focused changes.
Description check ✅ Passed The description includes the required sections and provides clear summary, verification, and notes for this tooling-only PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/repo-tooling-4pack

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo merged commit fa850f3 into main Jul 14, 2026
18 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/setup/jsdom.setup.ts`:
- Around line 29-35: Update the scrollIntoView setup in beforeEach so its mock
is recreated or reset for every test, rather than only initialized when absent.
Ensure vi.restoreAllMocks() or an equivalent per-test cleanup clears call counts
and arguments while preserving the jsdom fallback behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bf5ba3a-8634-4eb9-867d-e2ef594db76f

📥 Commits

Reviewing files that changed from the base of the PR and between 77cb0d0 and 222ea73.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .editorconfig
  • .github/CODEOWNERS
  • knip.json
  • package.json
  • tests/accessible-table.dom.test.tsx
  • tests/setup/jsdom.setup.ts
  • tests/use-event-callback.dom.test.tsx
  • vitest.config.mts

Comment on lines +29 to +35
beforeEach(() => {
installMatchMediaStub(false);
// jsdom does not implement scrollIntoView; components call it on focus/expand.
if (!Element.prototype.scrollIntoView) {
Element.prototype.scrollIntoView = vi.fn();
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

scrollIntoView mock never resets between tests.

The if (!Element.prototype.scrollIntoView) guard means the mock is created once per test file and never cleared afterward; vi.restoreAllMocks() in afterEach doesn't touch it since it wasn't created via vi.spyOn. Any future assertion on scrollIntoView call count/args will see accumulated state from earlier tests in the same file.

As per coding guidelines, "reliability concerns that degrade user experience or resilience" and reliability findings should be prioritized in this glob.

🔧 Proposed fix
 beforeEach(() => {
   installMatchMediaStub(false);
   // jsdom does not implement scrollIntoView; components call it on focus/expand.
-  if (!Element.prototype.scrollIntoView) {
-    Element.prototype.scrollIntoView = vi.fn();
-  }
+  Element.prototype.scrollIntoView = vi.fn();
 });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
beforeEach(() => {
installMatchMediaStub(false);
// jsdom does not implement scrollIntoView; components call it on focus/expand.
if (!Element.prototype.scrollIntoView) {
Element.prototype.scrollIntoView = vi.fn();
}
});
beforeEach(() => {
installMatchMediaStub(false);
// jsdom does not implement scrollIntoView; components call it on focus/expand.
Element.prototype.scrollIntoView = vi.fn();
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/setup/jsdom.setup.ts` around lines 29 - 35, Update the scrollIntoView
setup in beforeEach so its mock is recreated or reset for every test, rather
than only initialized when absent. Ensure vi.restoreAllMocks() or an equivalent
per-test cleanup clears call counts and arguments while preserving the jsdom
fallback behavior.

Source: Coding guidelines

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.

1 participant