Peter
Peter

Reputation: 1259

React functional component props sort alphabetically. (At the definition side)

I know an eslint rule, to sort the component props at the usage side.
Like <Cmp alpha={true} beta={true} /> (rule)

But is there a rule, what sorts the props from the definition side?
Like:
const Cmp = ({ beta, alpha = false }) => null; should be const Cmp = ({ alpha = false, beta }) => null;

Upvotes: 2

Views: 1582

Answers (1)

user3794166
user3794166

Reputation:

No such a rule exists, so I made one at PR. This remains to be accepted and pushed so will take some time.

Upvotes: 3

Related Questions