ilyavolodin / eslint-plugin-backbone

Backbone specific linting rules for ESLint
MIT License
95 stars 11 forks source link

Add rule for enforcing alphabetic sorting of keys in a views event hash #67

Closed m90 closed 8 years ago

m90 commented 8 years ago

This adds a rule that enforces the keys of a view's event hash to be sorted alphabetically (which I like to do).

This is my first time ever creating an eslint rule so I might have missed major aspects of doing this. Feel free to point them out.

ilyavolodin commented 8 years ago

Thanks for PR. I don't mind merging it, but wouldn't sort-keys do the same thing?

m90 commented 8 years ago

Looks like you uncovered a major case of Not Invented Here with me, I simply wasn't aware that a global sort-keys existed. Probably because I have used sort-prop-types far too often.

I would be perfectly fine with using sort-keys from now on and not having this merged, but in case you think someone else might benefit from some finer grained control (which is probably the reason for all the sorting rules in eslint-plugin-react) we could still think about merging this. I'm fine with both options.

ilyavolodin commented 8 years ago

Ok, let's merge this in. I guess it couldn't hurt. Thanks for PR.