eslint-plugin-sort icon indicating copy to clipboard operation
eslint-plugin-sort copied to clipboard

Support computed properties for sort/object-properties and sort/type-properties

Open jaketodaro opened this issue 10 months ago • 2 comments

Would it be possible to support sorting computed properties in objects and types? I would expect computed properties to be sorted not by their computed value, but just alphabetically by the code in the computed expression.

enum SomeEnum {
    foo = 'foo',
    bar = 'bar'
}

const myMap: Record<SomeEnum, string> = {
    // sort these keys?
    [SomeEnum.foo]: 'foo thing',
    [SomeEnum.bar]: 'bar thing'
}

jaketodaro avatar Apr 23 '24 15:04 jaketodaro

I'm waffling on this TBH. I can see the value, just not sure if I like it or not.

mskelton avatar Apr 26 '24 01:04 mskelton

Your call. I switched to eslint-plugin-perfectionist for this feature

jaketodaro avatar Apr 26 '24 15:04 jaketodaro

Going to close this as a won't do

mskelton avatar Jul 02 '24 19:07 mskelton