Skip to content

chore: Enable and fix @eslint-react/no-unstable-default-props#1989

Open
pulpdrew wants to merge 1 commit intomainfrom
drew/no-unstable-default-props
Open

chore: Enable and fix @eslint-react/no-unstable-default-props#1989
pulpdrew wants to merge 1 commit intomainfrom
drew/no-unstable-default-props

Conversation

@pulpdrew
Copy link
Copy Markdown
Contributor

@pulpdrew pulpdrew commented Mar 25, 2026

Summary

This PR

  1. Replaces eslint-config-react with the modernized equivalent @eslint-react/eslint-plugin. Note that eslint-config-react was not actually enabled previously, as none of its rules were added to the eslint config.
  2. Enables the no-unstable-default-props rule and fixes existing violations. This rule catches components with optional props of unstable types (objects, arrays) which have a default value assigned. The default value changes on each render, which can cause unecessary re-renders and re-computations of useMemos and useEffects.

We can enable more rules from this plugin in future PRs.

Screenshots or video

There are no expected behavior changes

How to test locally or on Vercel

The app can be regression tested in the preview environment.

References

  • Linear Issue: Closes HDX-3809
  • Related PRs:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: ac166b5

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

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Apr 2, 2026 2:44pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

E2E Test Results

All tests passed • 126 passed • 3 skipped • 1077s

Status Count
✅ Passed 126
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew force-pushed the drew/no-unstable-default-props branch from 143773c to ac166b5 Compare April 2, 2026 14:40
@pulpdrew pulpdrew marked this pull request as ready for review April 2, 2026 14:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

PR Review

✅ No critical issues found.

The changes correctly fix @eslint-react/no-unstable-default-props violations using three appropriate patterns:

  • Optional chaining / nullish coalescing at usage site for simple array/object reads
  • useMemo for cases where a stable reference needs to be passed to child components (DBRowSidePanelHeader, DBSearchPageFilters, NestedFilterGroup)
  • The _selectedValues rename-and-memoize pattern is standard for this rule fix

One minor note (not blocking): The useMemo(() => _selectedValues ?? defaultValue, [_selectedValues]) pattern won't prevent re-computation when a caller passes a new object instance on every render — the lint rule is satisfied, but callers would need to memoize their own objects for full stability. This is inherent to the pattern and acceptable here.

The zod@4.3.6 entry added to yarn.lock is a transitive devDependency from @eslint-react/eslint-plugin and does not affect app runtime code.

@pulpdrew pulpdrew requested review from a team, bot-hyperdx and dhable and removed request for a team and bot-hyperdx April 2, 2026 15:00
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