Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Variables used *before* assign should throw an error. #752

Closed
ConduciveMammal opened this issue Dec 13, 2023 · 1 comment
Closed

Variables used *before* assign should throw an error. #752

ConduciveMammal opened this issue Dec 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ConduciveMammal
Copy link

Describe the bug

There's a check for undefined variables which works well, but all it seems to be doing is checking for the existence of an assignment, not the validity of the assignment.

Currently, I can attempt to access a variable before it's been assigned and it's considered valid.

If you look in ESLint, this would throw an undefined error.

Expected

{{ cool }}
{% assign cool = true %}
// Variable "cool" used before being assigned.

Actual

{{ cool }}
{% assign cool = true %}
// Totally cool 👍🏻 

Debugging information

  • OS: macOS Sonoma
  • Version: 1.15.0

CleanShot 2023-12-13 at 4  50 33@2x
CleanShot 2023-12-13 at 4  51 31@2x

@ConduciveMammal ConduciveMammal added the bug Something isn't working label Dec 13, 2023
@lukeh-shopify
Copy link
Contributor

👋🏻 Hi @ConduciveMammal! Thanks for reporting this. Unfortunately the Ruby version of theme check has been deprecated for some time. Would you be able to confirm you are still having issues when using our maintained version of theme check? This is done using either the latest version of the Shopify CLI, or via the Shopify Liquid Visual Studio Code extension.

If you are still having issues, please raise an issue over in the CLI or theme tools repositories. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants