# consistent-tuple-labels πŸ“ Enforce consistent labels on tuple type elements. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). [Labeled tuple elements](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements) document what each position in a tuple means. Labeling only some of the elements is inconsistent: the unlabeled positions read as an oversight, and the tuple is harder to scan than one that is either fully labeled or fully unlabeled. This rule requires that, when at least one element of a tuple type is labeled, every element is labeled. A tuple with no labels at all is left alone. A rest element counts as labeled when its label is present (`...rest: number[]`), so a fully labeled tuple that ends with a labeled rest element is not reported. There is no autofix, since a meaningful label cannot be inferred. ## Examples ```ts // ❌ type Point = [x: number, number]; // βœ… type Point = [x: number, y: number]; ``` ```ts // βœ… type Point = [number, number]; ``` ```ts // ❌ type Route = [name: string, ...string[]]; // βœ… type Route = [name: string, ...segments: string[]]; ```