> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# member-ordering

[Added in v0.4.2](https://github.com/web-infra-dev/rslint/releases/tag/v0.4.2)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, ts } from '@rslint/core';

export default defineConfig([
  ts.configs.recommended,
  {
    rules: {
      '@typescript-eslint/member-ordering': 'error',
    },
  },
]);
```

## Rule Details

Require a consistent member declaration order.

A consistent ordering of fields, methods and constructors can make interfaces, type literals, classes and class expressions easier to read, navigate and edit.

This rule accepts an order configuration for each of the following AST node types:

- `default` — default ordering for all node types
- `classes` — ordering for class declarations
- `classExpressions` — ordering for class expressions
- `interfaces` — ordering for interface declarations
- `typeLiterals` — ordering for type literal declarations

Examples of **incorrect** code for this rule with the default configuration:

```typescript
interface Foo {
  B(): void;
  new (): Foo;
  A: string;
  [Z: string]: any;
}
```

Examples of **correct** code for this rule with the default configuration:

```typescript
interface Foo {
  [Z: string]: any;
  A: string;
  new (): Foo;
  B(): void;
}
```

## Original Documentation

- [typescript-eslint: member-ordering](https://typescript-eslint.io/rules/member-ordering)
- [Source code](https://github.com/typescript-eslint/typescript-eslint/blob/v8.67.0/packages/eslint-plugin/src/rules/member-ordering.ts)
