FilterWithoutEffect
FilterWithoutEffect
Severity: warning | Type: LiquidHtml
This check reports a filter written somewhere the platform silently ignores it.
The deploy converter accepts the file and nothing raises. platformOS parses a tag's markup with its own scanner, which does not apply filters — so the value arrives unfiltered and the page renders with the wrong data. That silence is what makes it worth a check: there is no error to trace back.
Examples
✗ Incorrect Code Example (Avoid using this):
{% cache 'key' | upcase %}
body
{% endcache %}
The cache key is key, not KEY. The filter is parsed as part of the markup and discarded.
✓ Correct Code Example (Use this instead):
{% assign k = 'key' | upcase %}
{% cache k %}
body
{% endcache %}
Apply the filter in an {% assign %} and pass the assigned variable.
Where filters DO apply
A filter works where the whole value is a Liquid variable:
- output and assignment —
{{ … }},{% assign %},{% echo %},{% print %},{% return %},{% session %}; - an argument whose value is a JSON literal —
{% log 'm', data: {"a": 1} | json %}; - a trailing filter after
{% graphql res = 'file' %}, which filters the result.
A trailing filter on {% function %} or {% background %}, or on the inline {% graphql %} block, only looks like that last case and is discarded — filter the result in a following {% assign %} instead.
Configuration
The default configuration for this check:
FilterWithoutEffect:
enabled: true
severity: warning
Disabling This Check
Disabling this check is not recommended. Nothing else reports it: the file deploys, the page renders, and the only symptom is a value that was never filtered.