> 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-duplicate-enum-values

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

| Preset                              | Configured Value |
| ----------------------------------- | ---------------- |
| ✅ ts.configs.recommended            | `"error"`        |
| ✅ ts.configs.recommendedTypeChecked | `"error"`        |
| ✅ ts.configs.strict                 | `"error"`        |
| ✅ ts.configs.strictTypeChecked      | `"error"`        |


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

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

## Rule Details

Disallows duplicate enum member values. Enum members that share the same literal value (number, string, or template literal) are almost always a mistake. This rule checks for duplicate initializer values within a single enum declaration.

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

```typescript
enum Direction {
  Up = 0,
  Down = 0,
}

enum Color {
  Red = 'red',
  Blue = 'red',
}

enum Num {
  A = 1,
  B = -1,
  C = 1,
}
```

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

```typescript
enum Direction {
  Up = 0,
  Down = 1,
  Left = 2,
  Right = 3,
}

enum Color {
  Red = 'red',
  Blue = 'blue',
  Green = 'green',
}
```

## Original Documentation

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