Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy