You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
{%- liquidassignshopName = shop.namecapture example
echo 'Shopify'
endcapture
style
echo example
echo shopName
endstyle
-%}
Additional Information:
OS: Mac
OS Version: Latest
Theme Check Version: Latest
Additional context
The text was updated successfully, but these errors were encountered:
👋 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
![Screenshot 2024-08-04 at 12 49 56](https://private-user-images.githubusercontent.com/7128602/354896687-f546fa7e-0dbf-4e2f-b063-1de2fa4744d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNDk0NTUsIm5iZiI6MTcyNjE0OTE1NSwicGF0aCI6Ii83MTI4NjAyLzM1NDg5NjY4Ny1mNTQ2ZmE3ZS0wZGJmLTRlMmYtYjA2My0xZGUyZmE0NzQ0ZDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTJUMTM1MjM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Yjc3Yjk3OTY1Y2EwODliN2FiNDAzOWRkYmY1MGRlOTE4MmRkNjkwYjU4MWVkZWRhMWQ2ZDFhOGFhYTk4MGViMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.hVWdiOUO_wEsXOJ1ubTzPCHP0IWiIlNi8rTViA9-k3E)
The text was updated successfully, but these errors were encountered: