mskelton / eslint-plugin-sort

Auto-fixable sort rules for ESLint.
https://www.npmjs.com/package/eslint-plugin-sort
ISC License
24 stars 1 forks source link

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

Open jaketodaro opened 2 months ago

jaketodaro commented 2 months ago

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'
}
mskelton commented 2 months ago

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

jaketodaro commented 2 months ago

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