bryanrsmith / eslint-plugin-sort-class-members

An ESLint rule for enforcing consistent ES6 class member order
119 stars 22 forks source link

Getter/Setters sorted into methods #54

Open Fuzzyma opened 4 years ago

Fuzzyma commented 4 years ago

It looks like accessors are not correctly put into the accesor group. My config looks like this:

      "order": [
        "[static-properties]",
        "[properties]",
        "[conventional-private-properties]",
        "constructor",
        "[static-methods]",
        "[methods]",
        "[conventional-private-methods]",
        "[accessor-pairs]",
        "[getters]",
        "[setters]",
        "[everything-else]"
      ],

It looks really great only that the accessors are just handled as a method. So a getter with name "baz" comes between method "bar" and "foo". That seems wrong since I explicitely want the getters behind the methods.

PS: I updated all standard groups with sort: alphabetical but removing this didnt lead to eslint complaining either. So it seems to have nothing to do with my customised groups

// EDIT: It sometimes works when I put the getter back in place after initial sorting but sometimes it complains about wrong ordering in accessors then without fixing it and sometimes it puts it back into the methods - really strange

dospunk commented 1 year ago

This might be because kind and type have the same value