コンテンツにスキップ

コードの無視

djlint:off と djlint:on のコメントで囲んだコードは、フォーマッターもリンターもそのままにします。コメントは HTML のものでも構いません:

<!-- djlint:off -->
<bad html to ignore>
<!-- djlint:on -->

Django や Jinja のコメントでも:

{# djlint:off #}
<bad html to ignore>
{# djlint:on #}

{% comment %} ブロックでも:

{% comment %} djlint:off {% endcomment %}
<bad html to ignore>
{% comment %} djlint:on {% endcomment %}

Go テンプレートのコメントでも:

{{/* djlint:off */}}
<bad html to ignore>
{{/* djlint:on */}}

Handlebars のコメントでも:

{{!-- djlint:off --}}
<bad html to ignore>
{{!-- djlint:on --}}

無視するブロックの開始タグにルール名を加えると、特定のリンタールールだけを無視することもできます。

{# 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 */}}