> 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-unused-labels

[Added in v0.6.5](https://github.com/web-infra-dev/rslint/releases/tag/v0.6.5)
## 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-unused-labels': 'error',
    },
  },
]);
```

## Rule Details

This rule disallows labels that are declared but never used by a labeled
`break` or `continue` statement.

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

```javascript
A: var foo = 0;

B: {
    foo();
}

C: for (let i = 0; i < 10; ++i) {
    foo();
}
```

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

```javascript
A: {
    if (foo()) {
        break A;
    }
    bar();
}

B: for (let i = 0; i < 10; ++i) {
    if (foo()) {
        continue B;
    }
    bar();
}
```

## Options

This rule has no options.

## Original Documentation

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