eslint-plugin-react-redux
eslint-plugin-react-redux copied to clipboard
Rule proposal: sort-connect/sort-map-state-to-props
Similar to eslint-plugin-react
's sort-prop-types
, it would be nice to have a rule to sort mapStateToProps
and mapDispatchToProps
object keys (when object is returned).
Is there a reason the core rule for sorting object keys wouldn’t apply here?
The core rule would have to be applied for entire codebase, or manually applied in mapStateToProps
special objects.
This rule proposal is about being consistent only with sort-prop-types
, which has an specific sorting constraint.
And I think here is the place 'cause is where we have connect
and mapStateToProps
awareness.