# attr-sorted

> Enforces a specific order for attributes in HTML elements to improve readability and consistency.

Attributes should be sorted in the following order:

* `class`
* `id`
* `name`
* `src`
* `for`
* `type`
* `href`
* `value`
* `title`
* `alt`
* `role`

Level: Error

## Config value

[Section titled “Config value”](#config-value)

* `true`: enable rule
* `false`: disable rule

### The following patterns are **not** considered rule violations

[Section titled “The following patterns are not considered rule violations”](#the-following-patterns-are-not-considered-rule-violations)

```html
<div img="image" meta="meta" font="font"></div>
```

### The following pattern is considered a rule violation:

[Section titled “The following pattern is considered a rule violation:”](#the-following-pattern-is-considered-a-rule-violation)

```html
<div type="type" img="image" id="id" font="font"></div>
```