Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ConduciveMammal opened this issue Dec 13, 2023 · 0 comments
Open

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

ConduciveMammal opened this issue Dec 13, 2023 · 0 comments
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant