Rule: align

Enforces vertical alignment.

Rationale

Helps maintain a readable, consistent style in your codebase.

Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.

Notes:
Has Fixer

Config

Five arguments may be optionally provided:

  • "parameters" checks alignment of function parameters.
  • "arguments" checks alignment of function call arguments.
  • "statements" checks alignment of statements.
  • "members" checks alignment of members of classes, interfaces, type literal, object literals and object destructuring.
  • "elements" checks alignment of elements of array literals, array destructuring and tuple types.
Config examples
"align": [true, "parameters", "statements"]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "arguments",
      "elements",
      "members",
      "parameters",
      "statements"
    ]
  },
  "minLength": 1,
  "maxLength": 5
}