Shopify / prettier-plugin-liquid

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

Prettier replace settings to ['settings'] in the range loop, #221

Closed imandydoan closed 5 months ago

imandydoan commented 5 months ago

Describe the bug Prettier replace settings to ['settings'] in the range loop,

Unformatted source

{% for t in (1..settings.terms_conditions_no) %}
{% endfor %}

Expected output

{% for t in (1..settings.terms_conditions_no) %}
{% endfor %}

Actual output

{% for t in (1..['settings'].terms_conditions_no) %}
{% endfor %}

Debugging information

charlespwd commented 5 months ago

Weird I have a unit test that passes that doesn't reformat this.

$ cat test.liquid
{% for t in (1..settings.terms_conditions_no) %}
{% endfor %}

$ prettier --plugin . --parser=liquid-html test.liquid
{% for t in (1..settings.terms_conditions_no) %}
{% endfor %}