# no-extra-label

Rule `eslint/no-extra-label`. Disallow unnecessary labels

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 45M weekly downloads of presets that enable it
- Trend: +57.0% last quarter
- Rank: #308 by reach, #727 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-extra-label` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-extra-label) |
| Oxlint | `no-extra-label` | no | safe | plugin `eslint`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-extra-label.html) |
| Biome | `complexity/noUselessLabel` | yes | safe | group complexity, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-useless-label/) |

## Code examples

### Incorrect: the rule reports this

```js
A: while (a) {
    break A;
}

B: for (let i = 0; i < 10; ++i) {
    break B;
}

C: switch (a) {
    case 0:
        break C;
}
```

### Correct: the rule accepts this

```js
while (a) {
    break;
}

for (let i = 0; i < 10; ++i) {
    break;
}

switch (a) {
    case 0:
        break;
}

A: {
    break A;
}

B: while (a) {
    while (b) {
        break B;
    }
}

C: switch (a) {
    case 0:
        while (b) {
            break C;
        }
        break;
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-extra-label": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-extra-label": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noUselessLabel": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [eslint/no-unneeded-ternary](https://lintradar.dev/rules/eslint/no-unneeded-ternary.md): Disallow ternary operators when simpler alternatives exist
- [eslint/prefer-regex-literals](https://lintradar.dev/rules/eslint/prefer-regex-literals.md): Disallow use of the `RegExp` constructor in favor of regular expression literals
- [eslint/no-use-before-define](https://lintradar.dev/rules/eslint/no-use-before-define.md): Disallow the use of variables before they are defined
- [eslint/default-case-last](https://lintradar.dev/rules/eslint/default-case-last.md): Enforce `default` clauses in `switch` statements to be last
- [eslint/no-useless-constructor](https://lintradar.dev/rules/eslint/no-useless-constructor.md): Disallow unnecessary constructors
- [eslint/no-array-constructor](https://lintradar.dev/rules/eslint/no-array-constructor.md): Disallow `Array` constructors

---

Web page: https://lintradar.dev/rules/eslint/no-extra-label. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
