The recommended way to format Hubl code locally in an IDE is to use the Prettier plugin https://github.com/HubSpot/prettier-plugin-hubl.
Basically, the tool works quite well.
However, the plugin also makes critical changes to the code.
For example…
BEFORE:
{% set slug = row.values[6] %}
AFTER:
{% set slug = row.values. %}
The index and the brackets gets replaced by a dot!
Does anyone know this problem and possibly have a workaround?
I use the recommended plugin version 0.2.5 in combination with prettier 2.8.8.
This problem has been fixed in newer versions, but instead i encountered several other critical code-replacements.
There must be a way to format Hubl code cleanly and reliably.
Thanks in advance!