---
url: /docs/guide/usage/linter/rules/eslint/sort-vars.md
---

### What it does

Enforce sorting of variable declarations within the same block.

### Why is this bad?

When declaring multiple variables within the same block, sorting variable names can make it
easier to find necessary variables at a later time.

Unsorted variable declarations can make the code harder to read and maintain.

### Examples

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

```js
var b, a;
var a, B, c;
```

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

```js
var a, b, c, d;
var B, a, c;
```

## Configuration

This rule accepts a configuration object with the following properties:

### ignoreCase

type: `boolean`

default: `false`

When `true`, the rule ignores case-sensitivity when sorting variables.

## How to use

## Version

This rule was added in v0.9.3.

## References
