# member-ordering

Rule `typescript/member-ordering`. Require a consistent member declaration order

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 31.4K weekly downloads of presets that enable it
- Trend: +32.4% last quarter
- Rank: #1644 by reach, #1084 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/member-ordering` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/member-ordering) |

## Code examples

### Incorrect: the rule reports this

```ts
interface Foo {
  B: string; // -> field

  new (); // -> constructor

  A(): void; // -> method

  [Z: string]: any; // -> signature
}
```

```ts
type Foo = {
  B: string; // -> field

  // no constructor

  A(): void; // -> method

  // no signature
};
```

```ts
class Foo {
  private C: string; // -> field
  public D: string; // -> field
  protected static E: string; // -> field

  constructor() {} // -> constructor

  public static A(): void {} // -> method
  public B(): void {} // -> method

  [Z: string]: any; // -> signature
}
```

### Correct: the rule accepts this

```ts
interface Foo {
  [Z: string]: any; // -> signature

  A(): void; // -> method

  new (); // -> constructor

  B: string; // -> field
}
```

```ts
type Foo = {
  // no signature

  A(): void; // -> method

  // no constructor

  B: string; // -> field
};
```

```ts
class Foo {
  [Z: string]: any; // -> signature

  public static A(): void {} // -> method
  public B(): void {} // -> method

  constructor() {} // -> constructor

  private C: string; // -> field
  public D: string; // -> field
  protected static E: string; // -> field
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/member-ordering": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [typescript/no-invalid-this](https://lintradar.dev/rules/typescript/no-invalid-this.md): Disallow `this` keywords outside of classes or class-like objects
- [typescript/init-declarations](https://lintradar.dev/rules/typescript/init-declarations.md): Require or disallow initialization in variable declarations
- [typescript/class-methods-use-this](https://lintradar.dev/rules/typescript/class-methods-use-this.md): Enforce that class methods utilize `this`
- [typescript/prefer-destructuring](https://lintradar.dev/rules/typescript/prefer-destructuring.md): Require destructuring from arrays and/or objects
- [typescript/no-magic-numbers](https://lintradar.dev/rules/typescript/no-magic-numbers.md): Disallow magic numbers
- [typescript/max-params](https://lintradar.dev/rules/typescript/max-params.md): Enforce a maximum number of parameters in function definitions

---

Web page: https://lintradar.dev/rules/typescript/member-ordering. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
