Theme check is incorrectly identifying variables assigned or captured within a {% liquid %} tag as assigned but not used. This occurs even though the variables are then used with echo withinstyle .
Steps to Reproduce:
Create a Liquid template file.
Inside a style {% liquid %} tag:
Assign a variable using {% assign shopName = shop.name %}.
Capture content using {% capture example %} and echo 'Shopify' {% endcapture %}.
Use echo to output the captured content (echo example) and the assigned variable (echo shopName).
Run the linter or theme check.
Expected Behavior:
The linter should not report any errors for the assigned or captured variables since they are used within the style tag.
Actual Behavior:
The linter flags an error message stating "The variable is assigned but not used."
Source Code:
{%- liquid
assign shopName = shop.name
capture example
echo 'Shopify'
endcapture
style
echo example
echo shopName
endstyle
-%}
👋 thanks for reporting, im able to repro and it seems related to style/endstyle being used around the variable example. when i remove that liquid, the linter stops returning that error
Description:
Theme check is incorrectly identifying variables assigned or captured within a
{% liquid %}
tag asassigned but not used.
This occurs even though the variables are then used withecho
withinstyle
.Steps to Reproduce:
style {% liquid %}
tag:{% assign shopName = shop.name %}
.{% capture example %}
andecho 'Shopify' {% endcapture %}
.echo
to output the captured content (echo example
) and the assigned variable (echo shopName
).Expected Behavior:
The linter should not report any errors for the assigned or captured variables since they are used within the
style
tag.Actual Behavior:
The linter flags an error message stating "The variable is assigned but not used."
Source Code:
Additional Information:
Additional context