Ignorer le code

Le code peut être ignoré en l’entourant de balises djlint :

Pour le simple html -

<!-- djlint:off -->
<mauvais html à ignorer> <!-- djlint:on --></bad>

ou comme un long commentaire -

{# djlint:off #} <mauvais html à ignorer> {# djlint:on #}</bad>

ou comme un long commentaire -

{% comment %} djlint:off {% endcomment %}
<mauvais html à ignorer> {% comment %} djlint:on {% endcomment %}</bad>

ou comme un commentaire de style javascript -

{{ /* djlint:off */ }} <mauvais html à ignorer> {{ /* djlint:on */ }}</bad>

ou comme un commentaire de style golang -

{{!-- djlint:off --}} <mauvais html à ignorer> {{!-- djlint:on --}}</bad>

Ignorer les règles

Des règles spécifiques de linter peuvent également être ignorées en ajoutant le nom de la règle dans la balise d’ouverture du bloc ignoré.

{# djlint:off H025,H026 #}
<p>
  {# djlint:on #}

  <!-- djlint:off H025-->
</p>

<p>
  <!-- djlint:on -->

  {% comment %} djlint:off H025 {% endcomment %}
</p>

<p>{% comment %} djlint:on {% endcomment %} {{!-- djlint:off H025 --}}</p>

<p>{{!-- djlint:on --}} {{ /* djlint:off H025 */ }}</p>

<p>{{ /* djlint:on */ }}</p>
Modifier cette page Actualisé Dec 22, 2023