Skip to content

Add sort-styles rule #211

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

Merged
merged 2 commits into from
Jan 2, 2019
Merged

Conversation

draperunner
Copy link
Contributor

@draperunner draperunner commented Dec 11, 2018

It's like sort-keys, but just for React Native styles.

Keeping your style definitions sorted is a common convention that helps with readability. This rule lets you enforce an ascending (default) or descending alphabetical order for both "class names" and style properties.

In addition to the tests, I have started using this on my team's RN project. So far, everything looks good! There is a weakness though, this rule will not handle the spread operator in styles very well. I'll see if I find the time to improve this sometime.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.5%) to 74.753% when pulling 33eb97a on draperunner:sort-styles into 1d18f84 on Intellicode:master.

@coveralls
Copy link

coveralls commented Dec 11, 2018

Coverage Status

Coverage increased (+1.5%) to 74.753% when pulling 03a982d on draperunner:sort-styles into 1d18f84 on Intellicode:master.

@Intellicode Intellicode merged commit 56b8078 into Intellicode:master Jan 2, 2019
@draperunner draperunner deleted the sort-styles branch January 3, 2019 08:21
@draperunner draperunner restored the sort-styles branch January 7, 2019 11:59
@draperunner
Copy link
Contributor Author

Thanks for merging, @Intellicode! How about publishing a new release? 🚀🎉:D

@Intellicode
Copy link
Owner

@draperunner sorry, I'll do that now, I have been busy with things :)

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

Successfully merging this pull request may close these issues.

3 participants