Shopify / prettier-plugin-liquid

Prettier Liquid/HTML plugin
https://npm.im/@shopify/prettier-plugin-liquid
MIT License
93 stars 15 forks source link

Maintain at most 2 line breaks between tag attributes #158

Closed charlespwd closed 1 year ago

charlespwd commented 1 year ago

Describe the bug Some folks want to keep the spacing between if/unless here.

Unformatted source

<label class="block relative">
  <input
    class="absolute inset-0 opacity-0 pointer-events-none peer"
    type="radio"
    name="id"
    id="variant-{{ variant.id }}"
    value="{{ variant.id }}"
    required

    {% unless variant.available %}
      disabled
    {% endunless %}

    {% if product.selected_variant == variant %}
      checked
    {% endif %}
  >
</label>

Expected output

<label class="block relative">
  <input
    class="absolute inset-0 opacity-0 pointer-events-none peer"
    type="radio"
    name="id"
    id="variant-{{ variant.id }}"
    value="{{ variant.id }}"
    required
    {% unless variant.available %}
      disabled
    {% endunless %}
    {% if product.selected_variant == variant %}
      checked
    {% endif %}
  >
</label>

Debugging information

Additional context Add any other context about the problem here.