gajus / eslint-plugin-flowtype

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

fix: use name to sort method property #497

Closed imdreamrunner closed 3 years ago

imdreamrunner commented 3 years ago

what was the issue?

if there is a comment (block/line) in front of the function property, the comment will affect the sorted order of items.

for example, a should be placed in front of b, but b got in front because it's ranked with "/"

      + expected - actual

               type FooType = {
      +          /* preserves block comment before a */
      +          a: number | string | boolean,
                 /* preserves block comment before b */
                 b(param: string): number,
      -          /* preserves block comment before a */
      -          a: number | string | boolean,
                 /* preserves block comment before c */
                 c: number,
               }

this PR fix the issue.

gajus commented 3 years ago

:tada: This PR is included in version 5.9.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: