Shopify / theme-check

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

UnusedAssign flags variables used in assigns as unused #520

Closed charlespwd closed 2 years ago

charlespwd commented 2 years ago

This shouldn't trigger an UnusedAssign:

{% assign format = 'jpeg' %}
{% assign url = product.featured_image | image_url: width: 800, format: format %}
charlespwd commented 2 years ago

Unit test passes. Don't know what was up. Must have been something else.

eloyesp commented 9 months ago

This fails when the assigns is within a conditional:

    {% assign checked = false %}
    {% if option.selected_value == value %}
      {% assign checked = true %} <!--here it fails -->
    {% endif %}
    {% render 'swatch-input', checked: checked %}