leo-buneev / eslint-plugin-sort-keys-fix

Fork of https://eslint.org/docs/rules/sort-keys that allows automatic fixing
97 stars 23 forks source link

key groups #4

Open dorseth opened 5 years ago

dorseth commented 5 years ago

It would be nice if one could specify order of some keys, and sort those, then sort others alpabetically.

dimitropoulos commented 4 years ago

I agree. The use case for this I have in mind is when you are doing css-in-js and you want to be able to keep related css properties together.

Some prior art here that's similar but different: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md

chancegraff commented 4 years ago

Old issue but I'd keep using this plugin if this were implemented.

entropitor commented 3 years ago

One way to do this would be to do it based on a newline, so if there is a newline, sort all the partitions but don't move stuff over newlines (this could be an option)