Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
334 stars 96 forks source link

Handle variable lookup as names in UnusedAssign #612

Closed charlespwd closed 2 years ago

charlespwd commented 2 years ago

The {{ [some_var] }} syntax is valid Liquid. When this happens, the tree gives us a Liquid::VariableLookup for the node.value.name (instead of a string).

To handle those cases, we simply return node.value.name.name.

It's not entirely future proof, but fixing this in Shopify/liquid seemed non-trivial.

Fixes #576