twigcs
twigcs copied to clipboard
Indentation checking
We should create a new rule about indentation checking. The official ruleset states:
Indent your code inside tags (use the same indentation as the one used for the target language of the rendered template)
But I also noticed a lot of people prefer to do:
<ul>
{% for a in 1..2 %}
<li>{{ a }}</li>
{% endfor %}
</ul>
So the final html is indented as if there were no twig.
My take on this would be to create a rule that defaults to the official coding standard but has an option to tolerate that twig tags directly inside html code can "skip" one indentation level.
Good thing, it's really nice idea 👍