Skip to content

chore(studio): add valtio and react-hook-form ESLint ratchet rules - #48037

Merged
ivasilov merged 4 commits into
masterfrom
ivasilov/eslint-react-hook-form-fix
Jul 21, 2026
Merged

ivasilov merged 4 commits into
masterfrom
ivasilov/eslint-react-hook-form-fix

Conversation

@ivasilov

@ivasilov ivasilov commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Chore / tooling — adds new ESLint rules for valtio and react-hook-form.

What is the current behavior?

Studio uses valtio and react-hook-form heavily, but neither library's dedicated ESLint plugin was installed, so their common API pitfalls were only caught at runtime.

What is the new behavior?

Adds eslint-plugin-valtio and eslint-plugin-react-hook-form (6 rules total) as warn, wired into the existing lint ratchet (scripts/ratchet-rules.json + baselines) so current violations are grandfathered and only new ones fail CI — no existing code is changed. Since [email protected] still calls the removed ESLint 8 context.getScope(), it is wrapped with fixupPluginRules from @eslint/compat so its rules run under flat config / ESLint 9.

Additional context

Baselines captured: valtio/state-snapshot-rule (1), valtio/avoid-this-in-proxy (1), react-hook-form/no-use-watch (77), and the three recommended react-hook-form rules (0 each).

Summary by CodeRabbit

  • Code Quality

    • Expanded linting for Valtio state usage, including safer proxy usage and snapshot-related patterns.
    • Added React Hook Form lint rules to encourage safer form state handling and discourage problematic watch usage.
    • Updated accessibility lint configuration and improved ESLint reliability by enabling an ESLint 8→9 compatibility shim for affected rules.
  • Maintenance

    • Updated ESLint rule baselines and ratcheting settings to match newly enabled rules.
    • Added required ESLint plugins to the Studio linting setup.

@ivasilov
ivasilov requested a review from a team as a code owner July 17, 2026 11:32
@vercel

vercel Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jul 21, 2026 12:24pm
studio-staging Ready Ready Preview, Comment Jul 21, 2026 12:24pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 12:24pm
design-system Skipped Skipped Jul 21, 2026 12:24pm
docs Skipped Skipped Jul 21, 2026 12:24pm
ui-library Skipped Skipped Jul 21, 2026 12:24pm
zone-www-dot-com Skipped Skipped Jul 21, 2026 12:24pm

Request Review

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev 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 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Studio’s ESLint configuration adds Valtio and React Hook Form plugins, wraps React Hook Form rules for ESLint 9 compatibility, enables related rules, and updates ratchet and baseline configurations.

Changes

Studio ESLint rule expansion

Layer / File(s) Summary
Plugin dependencies and compatibility wiring
apps/studio/package.json, apps/studio/eslint.config.cjs
Adds the ESLint compatibility package and plugins, registers Valtio, and wraps React Hook Form rules with fixupPluginRules.
Rule enforcement and ratchet baselines
apps/studio/eslint.config.cjs, apps/studio/scripts/ratchet-rules.json, apps/studio/.github/eslint-rule-baselines.json
Enables Valtio and React Hook Form rules and adds their ratchet identifiers, numeric baselines, and file-specific allowances.

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 clearly summarizes the main change: adding ESLint ratchet rules for valtio and react-hook-form.
Description check ✅ Passed The description matches the template and includes the required sections with clear details on behavior and context.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ivasilov/eslint-react-hook-form-fix

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

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

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  238 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  244 tests across 29 suites
duration  3 minutes, 55 seconds
commit  ba99565

Flaky tests

Features › table-editor.spec.ts › table editor › shortcut saves fk before column update

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@ivasilov
ivasilov force-pushed the ivasilov/eslint-react-hook-form-fix branch from a28e6bf to 22bdfd9 Compare July 20, 2026 11:08
ivasilov and others added 4 commits July 21, 2026 14:15
Add eslint-plugin-valtio and eslint-plugin-react-hook-form rules as warnings,
wired into the existing lint ratchet so current violations are grandfathered
and only new ones fail CI. [email protected] uses the removed ESLint 8
context.getScope(), so it is wrapped with fixupPluginRules from @eslint/compat
to run under flat config / ESLint 9.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
destructuring-formstate, no-access-control, and no-nested-object-setvalue
have no existing violations, so enforce them as errors. Rules with existing
violations (no-use-watch, both valtio rules) stay as warnings under the ratchet.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@ivasilov
ivasilov force-pushed the ivasilov/eslint-react-hook-form-fix branch from 24b5781 to ba99565 Compare July 21, 2026 12:18
@ivasilov
ivasilov merged commit 3d1d34b into master Jul 21, 2026
36 checks passed
@ivasilov
ivasilov deleted the ivasilov/eslint-react-hook-form-fix branch July 21, 2026 12:29
@github-actions

Copy link
Copy Markdown
Contributor

Braintrust eval report

Evals in progress... ⌛

hunleyd added a commit that referenced this pull request Aug 8, 2026
…fomap-entry-for-pitr-archiving-stale' into hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale

* origin/hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale: (35 commits)
  chore: simplify CPU messaging for compute sizes (#48109)
  chore(studio): add valtio and react-hook-form ESLint ratchet rules (#48037)
  feat: Add ai/python federated content and data (#48043)
  feat: Add ai-skills federated content and data (#48045)
  feat: Add deployment/ci federated content and data (#48041)
  fix(studio): wire up siwc-enabled query param opt-in on sign-in/sign-up (#48126)
  fix(studio): stop stacking overlaid area series in report charts (#48034)
  Update Dev toolbar to support filtering feature flags (#48137)
  Update dev toolbar to support mocking org restrictions (#48136)
  feat: Add terraform federated content and data (#48010)
  Chore/add sessions database connections (#48094)
  fix(studio): guard panel collapse/resize on narrow viewports (#48098)
  Landing page agent focus (#47989)
  fix(studio): chip away explicit-tabindex ratchet debt (#48040)
  fix(studio): untangle nested buttons in editor tabs (#48101)
  fix(docs): broken link (#48117)
  docs: add VS Code to the AI coding agent plugin install picker (#48108)
  docs: add Kimi Code to MCP and AI coding agent plugin setup (#48099)
  fix: preserve function responses (#47920)
  fix(assistant): SQL approval buttons do nothing (#48102)
  ...
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.

2 participants