Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fsmaia opened this issue Dec 6, 2018 · 2 comments
Open

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

fsmaia opened this issue Dec 6, 2018 · 2 comments

Comments

@fsmaia
Copy link

fsmaia commented Dec 6, 2018

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).

@ljharb
Copy link
Collaborator

ljharb commented Dec 6, 2018

Is there a reason the core rule for sorting object keys wouldn’t apply here?

@fsmaia
Copy link
Author

fsmaia commented Dec 7, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants