-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature Request: Discourage users passing global variables into snippets. #423
Comments
Severity either a suggestion , or possibly as a matter of style in names & values, definitely not as an error for parameter usage of globals as values. There's a meta issue this helps avoid too, from the shopify docs: "Predefined Liquid objects can be overridden by variables with the same name" So excluding names in iteration tags for iterable objects[1]:
Can swap "keywords for" with "names of" or other wording 👨🎓 📜 👨🏫. For # 1 at least for objects like "customer" those might be set to error severity:
Valid reasons for this pattern
|
In 2 years we haven't found a good solution to this problem. I'm willing to let it go. |
probably reopen if there's ever actual TYPEs , or object creation, we can evaluate in liquid |
So I've recently become aware that passing global variables into snippet
render
s isn't needed.So while I've been doing something like
{% render 'my-snippet', customer: customer %}
, it wasn't necessary.I wonder if it's possible to create a warning message stating this?
The text was updated successfully, but these errors were encountered: