DianaSuvorova / eslint-plugin-react-redux

Enforcing best practices for react-redux

Home Page:https://www.npmjs.com/package/eslint-plugin-react-redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rule proposal: sort-connect/sort-map-state-to-props

fsmaia opened this issue · comments

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.