Shopify / prettier-plugin-liquid

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

Add support for `case` and `when` tags #78

Closed charlespwd closed 2 years ago

charlespwd commented 2 years ago

In this PR

Decisions

Examples

It should break and indent when statements, and not break the when
printWidth: 1
{% case candy.type %}
  {% when 'gummy bears' %}
    yum!
  {% else %}
    ok!
{% endcase %}

It should break on when comma syntax
printWidth: 1
{% case candy.type %}
  {% when 'gummy bears',
    'chocolate'
  %}
    yum!
  {% else %}
    ok!
{% endcase %}

It should break on when or syntax (and prefer commas)
printWidth: 1
{% case candy.type %}
  {% when 'gummy bears',
    'chocolate',
    'chips'
  %}
    yum!
  {% else %}
    ok!
{% endcase %}