ember/template-block-indentation

March 14, 2026 ยท View on GitHub

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

Migrated from ember-template-lint/block-indentation.

Rule Details

Forces valid indentation for blocks and their children.

  1. Forces block begin and block end statements to be at the same indentation level, when not on one line.
  2. Forces children of all blocks to start at a single indentation level deeper.

Configuration

NameType
ignoreCommentsBoolean
indentationInteger

Examples

Examples of incorrect code for this rule:

{{#each foo as |bar|}}{{/each}}
<div>
  <p>{{t 'greeting'}}</p>
</div>
<div>
  <p>{{t 'Stuff here!'}}</p></div>

Examples of correct code for this rule:

{{#each foo as |bar|}}
  {{bar.name}}
{{/each}}
<div>
  <p>{{t 'greeting'}}</p>
</div>

Options

  • Integer (e.g., 2, 4): Number of spaces for indentation.
  • "tab": Use tab-style indentation (1 character).
  • Object:
    • indentation (integer, default 2): Number of spaces to indent.
    • ignoreComments (boolean, default false): Skip indentation checking for comments.

When no option is specified, the rule reads indent_size from .editorconfig (if present). If no .editorconfig is found, the default is 2 spaces.