Skip to content

chore(oxlint.config): add 'eslint-plugin-jest-dom' with its recommended rules and assert DOM presence with 'toBeInTheDocument' - #603

Merged
sukvvon merged 1 commit into
mainfrom
chore/oxlint-jest-dom
Dec 4, 2026
Merged

sukvvon merged 1 commit into
mainfrom
chore/oxlint-jest-dom

Conversation

@sukvvon

@sukvvon sukvvon commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

  • Add eslint-plugin-jest-dom as a dev dependency.
  • Load it as a JS plugin in the test file override of oxlint.config.ts and enable its flat/recommended rules.
  • Turn off jest-dom/prefer-to-have-text-content, since toHaveTextContent matches substrings and exact textContent checks should stay as toBe.
  • In trigger.test.tsx and settings-tab.test.tsx:
    • replace toBeNull() / not.toBeNull() on queryBy* results with not.toBeInTheDocument() / toBeInTheDocument()
    • replace expect(undocked.style.left).toBe(...) with expect(undocked).toHaveStyle({ left: ... })

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores
    • Added DOM testing lint rules for test files, with one rule excluded.
    • Updated UI tests to use document-presence and style assertions. Tested interactions and expected results are unchanged.
    • No end-user-facing behavior changes are included in this update.

…ed rules and assert DOM presence with 'toBeInTheDocument'
@sukvvon sukvvon self-assigned this Dec 4, 2026
@changeset-bot

changeset-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 652e0ed

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedeslint-plugin-jest-dom@​5.12.010010010095100

View full report

@nx-cloud

nx-cloud Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 652e0ed

Command Status Duration Result
nx affected --targets=test:oxlint,test:sherif,t... ✅ Succeeded 3m 46s View ↗
nx run-many --target=test:e2e --parallel=1 --pr... ✅ Succeeded 1m 21s View ↗
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 49s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-12-04 07:47:30 UTC

@pkg-pr-new

pkg-pr-new Bot commented Dec 4, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-devtools

npm i https://pkg.pr.new/@tanstack/angular-devtools@603

@tanstack/devtools

npm i https://pkg.pr.new/@tanstack/devtools@603

@tanstack/devtools-a11y

npm i https://pkg.pr.new/@tanstack/devtools-a11y@603

@tanstack/devtools-bundler-core

npm i https://pkg.pr.new/@tanstack/devtools-bundler-core@603

@tanstack/devtools-client

npm i https://pkg.pr.new/@tanstack/devtools-client@603

@tanstack/devtools-rspack

npm i https://pkg.pr.new/@tanstack/devtools-rspack@603

@tanstack/devtools-ui

npm i https://pkg.pr.new/@tanstack/devtools-ui@603

@tanstack/devtools-utils

npm i https://pkg.pr.new/@tanstack/devtools-utils@603

@tanstack/devtools-vite

npm i https://pkg.pr.new/@tanstack/devtools-vite@603

@tanstack/devtools-webmcp

npm i https://pkg.pr.new/@tanstack/devtools-webmcp@603

@tanstack/devtools-event-bus

npm i https://pkg.pr.new/@tanstack/devtools-event-bus@603

@tanstack/devtools-event-client

npm i https://pkg.pr.new/@tanstack/devtools-event-client@603

@tanstack/preact-devtools

npm i https://pkg.pr.new/@tanstack/preact-devtools@603

@tanstack/react-devtools

npm i https://pkg.pr.new/@tanstack/react-devtools@603

@tanstack/solid-devtools

npm i https://pkg.pr.new/@tanstack/solid-devtools@603

@tanstack/svelte-devtools

npm i https://pkg.pr.new/@tanstack/svelte-devtools@603

@tanstack/vue-devtools

npm i https://pkg.pr.new/@tanstack/vue-devtools@603

commit: 652e0ed

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The root Oxlint configuration now applies Jest DOM recommended rules to test files, with one rule disabled. Devtools tests use Jest DOM presence and style assertions in place of direct null and style-value checks.

Changes: Jest DOM matcher adoption

Layer / File(s) Summary
Enable Jest DOM lint rules
package.json, oxlint.config.ts
The root development dependencies and test-file Oxlint override add and configure eslint-plugin-jest-dom.
Update devtools test assertions
packages/devtools/src/components/trigger.test.tsx, packages/devtools/src/tabs/settings-tab.test.tsx
Trigger and settings-tab tests use Jest DOM presence assertions. The undocking test checks the left style with toHaveStyle.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

  • TanStack/devtools#586: This PR establishes the Oxlint configuration structure that this change extends with Jest DOM rules.

Suggested reviewers: alemtuzlak, bart-krakowski

Merge Risk: Minimal · up to 652e0 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes: adding eslint-plugin-jest-dom with its recommended rules, and switching DOM presence assertions to toBeInTheDocument. It matches the changeset. The title is long …
Description check Passed The description follows the repository template. It has the Changes, Checklist, and Release Impact sections. The Changes section lists the plugin addition, the rule override, and the test assertion up…
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.
Full details: Title check

Explanation

The title names the two main changes: adding eslint-plugin-jest-dom with its recommended rules, and switching DOM presence assertions to toBeInTheDocument. It matches the changeset. The title is long (126 characters) and uses the chore(oxlint.config) scope, but it is still specific and accurate.

Full details: Description check

Explanation

The description follows the repository template. It has the Changes, Checklist, and Release Impact sections. The Changes section lists the plugin addition, the rule override, and the test assertion updates. All checklist items are marked, and the dev-only release option is selected. The description does not include a changeset, which is correct for a dev-only change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 254bbb3 and 652e0ed.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 4

  • oxlint.config.ts
  • package.json
  • packages/devtools/src/components/trigger.test.tsx
  • packages/devtools/src/tabs/settings-tab.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@sukvvon
sukvvon merged commit 7637c76 into main Dec 4, 2026
11 checks passed
@sukvvon
sukvvon deleted the chore/oxlint-jest-dom branch December 4, 2026 07:53
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