olivertappin / sort-attributes

Atom package to sort HTML attributes alphabetically
MIT License
2 stars 0 forks source link

Custom Sort Order #1

Open kevindb opened 7 years ago

kevindb commented 7 years ago

Would it be possible to add an option for a custom sort order? Purely alphabetical isn't always preferred. For example: If a tag has an id, I like it to be first, followed by class, then role, etc.

The configuration could be just a text field with allowing an array of strings of attribute names to be sorted first. Then, any additional attributes could be sorted alphabetically after that.

olivertappin commented 6 years ago

Hey, sorry for the late reply. I never saw the notification for your suggestion, and only came across it after looking at the repository in GitHub and seeing I had an open issue.

That's a great idea, not everyone wants their attributes in alphabetical order. I'll work on this in the beginning of next year. If it's more urgent for you, feel free to make a PR and I'll review it right away. Also, feel free to give me a nudge if I don't reply within a few days as I'm a daily active user of GitHub.

regulyarniy commented 6 years ago

It would be great if attributes could also be sorted in pre-defined way from @mdo codeguide: http://codeguide.co/#html-attribute-order