Skip to content

chore(dashboard): enable noNestedComponentDefinitions and noReactPropAssignments - #5445

Merged
robertkasza merged 1 commit into
mainfrom
chore/dashboard-react-lint-rules
Nov 25, 2026
Merged

robertkasza merged 1 commit into
mainfrom
chore/dashboard-react-lint-rules

Conversation

@robertkasza

@robertkasza robertkasza commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • No breaking changes
  • Tests pass (biome check, tsc --noEmit, Vitest on the DatePicker, DateTimePicker and TemporalPicker tests; full suite left to CI)
  • New features have new tests (n/a)
  • Documentation is updated (n/a)
  • Title of the PR is in the correct format

Goal

The dashboard's Biome config did not flag two classes of React bugs: components declared inside another component's render (recreated on every render, so React remounts them and discards their state and DOM) and direct assignments to props (mutating data React treats as immutable). This branch turns both rules on as errors so new dashboard code cannot introduce either pattern, and fixes the one existing violation so biome check stays green.

Type: Configuration

Changes

  • Lint policy — Adds noNestedComponentDefinitions and noReactPropAssignments at error level under linter.rules.correctness in dashboard/biome.json, next to the existing noInnerDeclarations. Violations now fail biome check locally and in CI.
  • Calendar chevron — The Calendar wrapper around react-day-picker's DayPicker previously passed components={{ Chevron: ({ orientation }) => … }}, an inline component with a new identity on every Calendar render. It is now a module-level CalendarChevron typed with the library's ChevronProps, rendering ChevronLeft for orientation === 'left' and ChevronRight otherwise at h-4 w-4. Rendered output is unchanged; only the component identity becomes stable, so DayPicker no longer remounts the navigation icons on each parent render.

Key files

  • dashboard/biome.json (+2/-0) — enables the two React correctness rules
  • dashboard/src/components/ui/v3/calendar.tsx (+11/-7) — hoists the inline Chevron into top-level CalendarChevron

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Deployment Info - dashboard

@robertkasza robertkasza self-assigned this Nov 24, 2026
…Assignments

Both Biome rules catch real React bugs: a component defined inside
another is recreated on every render and loses its state, and assigning
to props mutates data React treats as immutable. The dashboard had one
nested definition, the Chevron component passed to DayPicker in the
calendar, which is now a top-level CalendarChevron. There were no prop
assignments.

Checks: biome check, tsc --noEmit, and Vitest on the DatePicker,
DateTimePicker and TemporalPicker tests.
@robertkasza
robertkasza force-pushed the chore/dashboard-react-lint-rules branch from 9801f33 to 43b5eab Compare November 25, 2026 10:10
@robertkasza
robertkasza enabled auto-merge (squash) November 25, 2026 10:10
@robertkasza
robertkasza merged commit e8fe0c6 into main Nov 25, 2026
10 checks passed
@robertkasza
robertkasza deleted the chore/dashboard-react-lint-rules branch November 25, 2026 10:47
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