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

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

| Preset                   | Configured Value |
| ------------------------ | ---------------- |
| ✅ js.configs.recommended | `"error"`        |


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

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-duplicate-case': 'error',
    },
  },
]);
```

## Rule Details

Disallow duplicate case labels in `switch` statements. Duplicate case labels indicate a probable mistake.

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

```javascript
switch (a) {
  case 1:
    break;
  case 1:
    break;
}

switch (a) {
  case 'a':
    break;
  case 'a':
    break;
}
```

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

```javascript
switch (a) {
  case 1:
    break;
  case 2:
    break;
}

switch (a) {
  case 'a':
    break;
  case 'b':
    break;
}
```

## Original Documentation

- [ESLint: no-duplicate-case](https://eslint.org/docs/latest/rules/no-duplicate-case)
- [Source code](https://github.com/eslint/eslint/blob/v10.8.1/lib/rules/no-duplicate-case.js)
