gajus / eslint-plugin-flowtype

Flow type linting rules for ESLint.
Other
1.08k stars 153 forks source link

`sort-keys` doesn't work with exact types #493

Closed geraintwhite closed 3 years ago

geraintwhite commented 3 years ago

When using the sort-keys rule, it breaks the syntax when sorting keys of exact types.

Input:

export type GroupOrdersResponseType = {|
  isSuccess: boolean,
  code: number,
  message?: string,
  errorMessage: string,
  result: {|
    OrderNumber: string,
    Orders: GroupOrderSummaryType[],
    PlacedOn: string,
    Status: string,
    ReturnText: string,
    IncludesLegacyOrder: boolean
  |}
|};

Output:

export type GroupOrdersResponseType = {|
  code: number,
  errorMessage: string,
  isSuccess: boolean,
  message?: string,
  result: {|
    IncludesLegacyOrder: boolean
  |}
|},
    OrderNumber: string,
    Orders: GroupOrderSummaryType[],
    PlacedOn: string,
    ReturnText: string,
    IncludesLegacyOrder: boolean
  |};
gajus commented 3 years ago

:tada: This issue has been resolved in version 5.9.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: