eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

sort-class-members

ESLint plugin / sort-class-members

Sorts class members by type and alphabetically inside each type group.

Type groups:

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/sort-class-members": [
      "error",
      {
        sortingOrder: string[]
      }
    ]
  }
};

| Option | Description | Default | | :—– | :———- | :—— |

sortingOrder Sorting order []

Examples of incorrect code

class SampleClass {
  z;
  y;
  x;
}

Examples of correct code

class SampleClass {
  x;
  y;
  z;
}