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

# consistent-tuple-labels

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

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


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

export default defineConfig([
  unicornPlugin.configs.recommended,
  {
    rules: {
      'unicorn/consistent-tuple-labels': 'error',
    },
  },
]);
```

## Rule Details

Require every element of a tuple type to have a label when any element is
labeled. Tuples whose elements are all labeled or all unlabeled are left
unchanged.

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

```typescript
type Point = [x: number, number];
type Route = [name: string, ...string[]];
```

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

```typescript
type Point = [x: number, y: number];
type Coordinates = [number, number];
type Route = [name: string, ...segments: string[]];
```

The rule does not provide an autofix because it cannot infer meaningful labels.

## Original Documentation

- [eslint-plugin-unicorn: consistent-tuple-labels](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v74.0.0/docs/rules/consistent-tuple-labels.md)
- [Source code](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v74.0.0/rules/consistent-tuple-labels.js)
