Skip to main content

attr-order

Specify the order of attributes in HTML tag.

Options

There rule accept as configuration an array of strings (example: ["class", "of", "attributes"]).

Given:

  "attr-order": [
"error",
["class", "id"]
]

The following patterns are considered violations:

  <button id="foo" class="bar"></button>

The following patterns are not considered violations:

  <button class="foo" id="bar"></button>