> 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.

# no-dupe-class-members

[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/no-dupe-class-members': 'error',
    },
  },
]);
```

## Rule Details

Disallow duplicate class members.

If there are declarations of the same name in class members, the last declaration overwrites other declarations silently. It can cause unexpected behaviors.

This rule extends the base ESLint `no-dupe-class-members` rule to support TypeScript method overload signatures, which should not be flagged as duplicates.

Examples of **incorrect** code for this rule:

```typescript
class A {
  foo() {}
  foo() {}
}

class B {
  foo;
  foo() {}
}

class C {
  static bar() {}
  static bar() {}
}
```

Examples of **correct** code for this rule:

```typescript
class A {
  foo() {}
  bar() {}
}

class B {
  get foo() {}
  set foo(value) {}
}

class C {
  static foo() {}
  foo() {}
}

// TypeScript method overloads are allowed
class D {
  foo(a: string): string;
  foo(a: number): number;
  foo(a: any): any {}
}
```

## Original Documentation

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