azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

Bug: (sort-interfaces): Configuration for rule "perfectionist/sort-interfaces" is invalid when using `optionality-order` #122

Closed bab2683 closed 1 month ago

bab2683 commented 1 month ago

Describe the bug

The rule doesn't work when using optionality-order option.

Configuration for rule "perfectionist/sort-interfaces" is invalid:
        Value {"type":"alphabetical","order":"asc","optionality-order":"required-first","ignore-case":true,"groups":[],"partition-by-new-line":false} should NOT have additional properties.

Code example

interface something {
  a?: boolean;
  b: boolean;
}

ESLint version

8.36

ESLint Plugin Perfectionist version

2.7.0

Additional comments

I saw a commit was pushed to change this https://github.com/azat-io/eslint-plugin-perfectionist/commit/7726294bfe469fa0e25f04fe73facc4944572f54. I based my implementation on the README not knowing this change was yet to be released. However, even trying optionalityOrder didn't help. This particular option is not included in the dist/index.js

Validations

azat-io commented 1 month ago

Please update eslint-plugin-perfectionist to v2.8.0