# noDuplicateVariableNames

Rule `biome/noDuplicateVariableNames`. Require all variable definitions to be unique.

- Source: biome
- Technologies: GraphQL
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #513 by reach, #148 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/noDuplicateVariableNames` | yes | no | group correctness, since 2.3.11 | [docs](https://biomejs.dev/linter/rules/no-duplicate-variable-names/) |

## Code examples

### Incorrect: the rule reports this

```graphql
query ($x: Int, $x: Int) {
  field
}
```

### Correct: the rule accepts this

```graphql
query ($x: Int, $y: Int) {
  field
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noDuplicateVariableNames": "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% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noDuplicateSelectorsKeyframeBlock](https://lintradar.dev/rules/biome/noDuplicateSelectorsKeyframeBlock.md): Disallow duplicate selectors within keyframe blocks.
- [biome/noDynamicNamespaceImportAccess](https://lintradar.dev/rules/biome/noDynamicNamespaceImportAccess.md): Disallow accessing namespace imports dynamically.
- [biome/noDuplicateProperties](https://lintradar.dev/rules/biome/noDuplicateProperties.md): Disallow duplicate properties within declaration blocks.
- [biome/noEmptyBlock](https://lintradar.dev/rules/biome/noEmptyBlock.md): Disallow empty CSS blocks.
- [biome/noDuplicateInputFieldNames](https://lintradar.dev/rules/biome/noDuplicateInputFieldNames.md): Require fields within an input object to be unique.
- [biome/noEmptyTypeParameters](https://lintradar.dev/rules/biome/noEmptyTypeParameters.md): Disallow empty type parameters in type aliases and interfaces.

---

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