azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

Feature: sort-intersection-types `objects-last` #143

Open christopher-buss opened 2 weeks ago

christopher-buss commented 2 weeks ago

What rule do you want to change?

Add option to sort objects after.

Describe the problem

I would like the option to sort "objects" last, rather than default them to the first part of the type.

Code example

// Current
interface X {
    SomeObject: {
        Test: number;
     } & OurOtherType
}

// Proposed
interface X {
    SomeObject: OurOtherType & {
        Test: number;
     } 
}

Additional comments

No response

Validations

azat-io commented 2 weeks ago

Thank you for your issue! We plan to add more flexible support for creating custom groups in the next major version.