Skip to content
Advertisement

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;

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement