Code can be ignored by wrapping it in djlint tags:
For plain old html -
<!-- djlint:off -->
<bad html to ignore>
<!-- djlint:on -->
or as a comment -
{# djlint:off #}
<bad html to ignore>
{# djlint:on #}
or as a long comment -
{% comment %} djlint:off {% endcomment %}
<bad html to ignore>
{% comment %} djlint:on {% endcomment %}
or as a javascript style comment -
{{ /* djlint:off */ }}
<bad html to ignore>
{{ /* djlint:on */ }}
or as a golang style comment -
{{!-- djlint:off --}}
<bad html to ignore>
{{!-- djlint:on --}}
Specific linter rules can also be ignored by adding the rule name into the ignored block opening tag.
{# djlint:off H025,H026 #}
<p>
{# djlint:on #}
<!-- djlint:off H025-->
<p>
<!-- djlint:on -->
{% comment %} djlint:off H025 {% endcomment %}
<p>
{% comment %} djlint:on {% endcomment %}
{{!-- djlint:off H025 --}}
<p>
{{!-- djlint:on --}}
{{ /* djlint:off H025 */ }}
<p>
{{ /* djlint:on */ }}