Open illepic opened 4 years ago
This is becoming a blocker for my team because we need dynamic elements and want to run prettier as a pre-commit hook. Is there any more info I can provide to help?
We use a custom Twig tag as a workaround for anyone interested:
{# Twig template #}
{% set tag = 'p' %}
{% html_element is tag with { id: 'lorem-ipsum' } %}
Lorem ipsum
{% end_html_element %}
{# HTML output #}
<p id="lorem-ipsum">
Lorem ipsum
</p>
Thanks for the workaround @titouanmathis - we need to use vanilla Twig in our codebase and ended up implementing this from scratch, and ignoring only this file from Prettier
html_element.twig
<{{ tag }} {{ attributes }}>
{{content}}
</{{ tag }}>
.prettierignore
path/to/twig/html_element.twig
I know this isn't necessarily related to this project, but attempting something like this
throws the following error: