@typescript-eslint/member-ordering not working


I’m trying to have a strict ordering in typescript classes, forcing a precise order for groups and especially I’d like to force alphabetic order.

I’m following this doc to achieve what I need: https://typescript-eslint-armano.netlify.app/rules/member-ordering/#sorting-alphabetically-within-member-groups

This is the member-ordering config extracted by my .eslintrc config

"@typescript-eslint/member-ordering": [
          "default": {
            "memberTypes": [
            "order": "alphabetically"

This doesn’t produce any errors in my class, whereas I would expect 2 errors: wrong member ordering (private should go after public) and wrong alphabetic order.

no errors

Eslint is running fine, since I’m getting other errors, such as naming-convention and others


It appears that separating memberTypes and ordering in two categories, works.
It appeared to me that the docs put the two props together, but maybe it’s a bug.

new config

And in my editor:

working as expected now

Answered By – Sampgun

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published