Shopify / prettier-plugin-liquid

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

prettier-ignore-start and prettier-ignore-end not working. #107

Closed andershagbard closed 1 year ago

andershagbard commented 1 year ago

Describe the bug prettier-ignore-start and prettier-ignore-end not working.

Unformatted source

{% # prettier-ignore-start %}
My unformatted code
{% # prettier-ignore-end %}

Expected output

{% # prettier-ignore-start %}
My unformatted code
{% # prettier-ignore-end %}

Actual output

{% # prettier-ignore-start %}
My formatted code
{% # prettier-ignore-end %}

Debugging information

charlespwd commented 1 year ago

We do support {% # prettier-ignore %} (https://github.com/Shopify/prettier-plugin-liquid/pull/85/files#diff-69ea62ee3501b3b2b0862c6a264b7150ebad65db4c33d049510bcff099ba3fef) and it will target the next "node."

Is <!-- prettier-ignore-start --> something we can do in prettier-html? Something we'd have to look into.

charlespwd commented 1 year ago

From their docs it looks like the syntax only supports targeting the next node: https://prettier.io/docs/en/ignore.html#html

andershagbard commented 1 year ago

I may have overlooked that start/end is only for markdown. I don't think it should be implemented then.

https://github.com/prettier/prettier/issues/5287