melody icon indicating copy to clipboard operation
melody copied to clipboard

Possible missing Operator "=>" in the filter filter

Open ppvolto opened this issue 4 years ago • 2 comments

Explain the problem

I started to use prettier-plugin-twig-melody to check my twig templates and found that melody do not recognize the => Operator like it's used in the filter filter.

Expected Behaviour

Usage of the => operator like described in the filter filter.

Actual Behaviour

Throws Error:

ERROR in ./src/home/index.twig
ERROR: Unexpected token "operator" of value ">"
  16 |     {% mount '../counter' with { count: 5 } %}
  17 |     {% set sizes = [34, 36, 38, 40, 42] %}
> 18 |     {{ sizes|filter(v => v > 38)|join(', ') }}
     |                        ^
  19 | </div>

ppvolto avatar Aug 12 '20 22:08 ppvolto

Having the same problem, any chance this can be added as a token?

gregkohn avatar Jun 04 '21 17:06 gregkohn

Has anyone found a way to solve this? i'm experiencing the same issue.

jeroenbraspenning avatar Jan 05 '22 13:01 jeroenbraspenning