Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.61 KB

File metadata and controls

52 lines (40 loc) · 1.61 KB

attribute-group-order

Enforces certain order of inputs, outputs, directives and other attributes on html elements.

Rule Details

👎 Examples of incorrect code for this rule with default configuration.

<div
  [class.invalid]="true"
  title="Invalid order"
  *ngIf="isVisible"
></div>

👍 Examples of correct code for this rule with default configuration.

<div
  *ngIf="isVisible"
  title="Valid order"
  [class.valid]="true"
></div>

Options

Property Type Optional Default Value Description
order string[]
*structural
#variable
attribute
[input]
[(two-way)]
(output)
Specify order of attribute groups. Available tokens are:
*structural
#variable
attribute
[input]
[(two-way)]
(output)

Example config

"markuplint-angular-rules/attribute-group-order": {
  "option": {
    "order": [
      "*structural",
      "#variable",
      "attribute",
      "[input]",
      "[(two-way)]",
      "(output)"
    ]
  }
}

Default severity

error