eslint-plugin-perfectionist icon indicating copy to clipboard operation
eslint-plugin-perfectionist copied to clipboard

Bug: `sort-object-types` Optionality ignores the notion of group

Open hugop95 opened this issue 6 months ago • 0 comments

Describe the bug

Optionality seems to be ignoring the notion of group:

Code example

Configuration:

"perfectionist/sort-object-types": ["error", {
          "groupKind": "optional-first",
          "groups": [
            "callback",
            "unknown"
          ],
          "customGroups": {
            "callback": "on*"
          }
        }],

The following code below is invalid (onClick belongs to a group before a):

type A =  {
  a

  onClick
}

while this one is valid

type A =  {
  a?

  onClick
}

Is optionality supposed to be ignoring groups?

ESLint version

8.57.0

ESLint Plugin Perfectionist version

3.2.0

Additional comments

No response

Validations

  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

hugop95 avatar Aug 15 '24 21:08 hugop95