Bug: [member-ordering] Doesn't check anything if optionalityOrder is present but no optional member exists #6514
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=4.9.3&sourceType=module&code=JYOwLgpgTgZghgYwgAgEJQPYGsImQbwChlkAjALmRAFcBbU6AbmOTkpvqcIF9DDRIsRCgBioFERIUqdBlGYk2MzvJYYA-O1ldeQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SM3x8AZgEMyKKZq3aBNSgKaHGRAPIi+UmIgCOsStETDa+j7I+KrqFlBCotBudviw0Pa0ZIbIiLTMqUzIlPiUAG6IkGHyAL7FYGXyALpyZSVAA
Repro Code
ESLint Config
tsconfig
Expected Result
In interface "Broken", an error should be shown because the members are not sorted
Actual Result
No error is shown
Additional Info
I believe the problem is at packages/eslint-plugin/src/rules/member-ordering.ts:875
If no optional members are found, the rule does nothing. So the else case is missing:
The text was updated successfully, but these errors were encountered: