twigcs icon indicating copy to clipboard operation
twigcs copied to clipboard

Indentation checking

Open OwlyCode opened this issue 5 years ago • 1 comments

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.

OwlyCode avatar Oct 19 '19 09:10 OwlyCode

Good thing, it's really nice idea 👍

oallain avatar Oct 19 '19 10:10 oallain