Skip to content

[sort-type-union-intersection-members] Autofixed type not equivalent to original type #4581

Closed
@iliubinskii

Description

@iliubinskii

Repro

{
  "rules": {
    "@typescript-eslint/sort-type-union-intersection-members": "warn"
  }
}
type Expected = (new (x: string) => object) &
  ((x: number) => boolean) & {
    readonly x: number;
    readonly y: string;
  };

Expected Result

Should be fixed to:

type Expected = ((x: number) => boolean) &
  (new (x: string) => object) & {
    readonly x: number;
    readonly y: string;
  };

Actual Result

Got:

type Expected = ((x: number) => boolean) & new (x: string) => object & {
  readonly x: number;
  readonly y: string;
};

Additional Info

No

Versions

package version
@typescript-eslint/eslint-plugin 5.12.1
@typescript-eslint/parser 5.12.1
TypeScript 4.5.5
ESLint 8.9.0
node 14.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions