Skip to content

Add eslint rule to make sure props are spread before other props #436

@siddharthkp

Description

@siddharthkp

This is a remediation issue from a weekly review session. Addressing this issue will help us avoid issues where we are overriding props unintentionally.

<Example
  className="..."
  {...rest}
/>
<Example
  {...rest}
  className="..."
/>

This is important to do because we've seen multiple instances of UI errors being caused by scenarios were custom props overriding the base props. Having this type of rule in place could help us avoid these types of regressions


Implementation plan:

  • Create a new file in src/rules in the same style as other files in that directory
  • Write a test file in src/rules/__tests__
  • Add a file for documentation in docs/rules

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions