MalteJanz / ludtwig

Linter / Formatter for Twig template files which respects HTML and your time.
MIT License
28 stars 3 forks source link

Unquoted twig hash syntax causes parsing error #82

Closed MalteJanz closed 9 months ago

MalteJanz commented 9 months ago

Parsing error example:


{{ 'hello_world_and_its_changing'|replace({_: "-"}) }}

will print:

error[SyntaxError]: The parser encountered a syntax error
  ┌─ ./demo/text.html.twig:1:45
  │
1 │ {{ 'hello_world_and_its_changing'|replace({_: "-"}) }}
  │                                             ^ expected , but found :

This is problematic because the auto fix for the rule twig-hash-key-no-quotes will make parseable templates to be not parsable after fixing...