SpaceInsideBraces
Deprecated
This check only exists in Theme Check v1.X.X. We consider this to be the formatter's job.
Deprecated:
This check only exists in Theme Check v1.X.X. We consider this to be the formatter's job.
Identifies inconsistent spacing inside Liquid tags and variables. Consistent spacing makes your code easier to search, read, and maintain.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
<!-- Around braces -->
{% assign x = 1%}
{{ x}}
{{x }}
<!-- After commas and semicolons -->
{% form 'type', object, :value %}
{% endform %}
<!-- Around filter pipelines -->
{{ url | asset_url | image_tag }}
{% assign my_upcase_string = "Hello world"| upcase %}
<!-- Around symbol operators -->
{%- if target == product and product.price_varies -%}
{%- if product.featured_media.width >=165 -%}
Anchor to ✓ Pass✓ Pass
{% assign x = 1 %}
{{ x }}
{% form 'type', object, : value, : value %}
{% endform %}
{{ "ignore:stuff, indeed" }}
{% render 'product-card',
: product_recommendation,
: section.settings.show_vendor,
: section.settings.product_recommendations_image_ratio,
: section.settings.center_align_text
%}
{{ url | asset_url | image_tag }}
{% assign my_upcase_string = "Hello world" | upcase %}
{%- if target == product and product.price_varies -%}
{%- if product.featured_media.width >= 165 -%}
Anchor to Auto-correctionAuto-correction
Theme Check can correct this error using the --auto-correct flag. When the flag is specified, Theme Check trims or add spaces around {{ ... }}.
Anchor to Before correctionBefore correction
{{ x}}
{{x}}
{{ x }}
Anchor to After correctionAfter correction
{{ x }}
Anchor to Disabling this checkDisabling this check
This check is safe to disable.
Was this page helpful?