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.
- Forces block begin and block end statements to be at the same indentation level, when not on one line.
- Forces children of all blocks to start at a single indentation level deeper.
Configuration
| Name | Type |
|---|---|
ignoreComments | Boolean |
indentation | Integer |
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, default2): Number of spaces to indent.ignoreComments(boolean, defaultfalse): 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.