Skip to content
Snippets Groups Projects

feat(lint): Add ESLint rule to warn against spreading props

Merged Administrator requested to merge mihir/eslint-no-spreading into main

Created by: plibither8

This PR adds an ESLint rule to warn against spreading ambiguously-named props (props and rest) into components.

Relevant discussion on Slack.

Bad code:

<MyComponent {...rest} />
              ~~~~~~~

OK code:

<MyComponent {...ariaAttributes} />

Bonus amazing code:

const { prop_one, prop_two } = props
<MyComponent prop_one={prop_one} prop_two={prop_two} />

Test plan

Tested on VS Code by implementing the unsafe patterns and observing eslint warning showing up.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Approval is optional

Merged by avatar (Jul 6, 2025 9:28am UTC)

Merge details

  • Changes merged into main with 44dc676a.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading