Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

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

Closed
imandydoan opened this issue Apr 20, 2024 · 1 comment
Closed

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

imandydoan opened this issue Apr 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@imandydoan
Copy link

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

  • OS: Linux
  • Version: 1.4.4
@imandydoan imandydoan added the bug Something isn't working label Apr 20, 2024
@charlespwd
Copy link
Collaborator

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 %}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants