ValidRenderPartialArgumentTypes
Last edit: Apr 01, 2026
ValidRenderPartialArgumentTypes
Severity: warning | Type: LiquidHtml | Aliases: ValidRenderPartialParamTypes
This check ensures that arguments passed to a partial match the expected types declared in the partial's {% doc %} tag. When a type mismatch is detected, the check reports it with a suggestion to fix the value.
The check handles both named arguments ({% render 'card', title: "Hello" %}) and the alias syntax ({% render 'card' with 123 as count %}).
Type checking is only performed when:
- The target partial has a
{% doc %}tag. - The
@paramentry includes a type annotation (e.g.@param {string} title). - The argument value is a literal (string, number, boolean) — variable lookups are not type-checked statically.
Examples
✗ Incorrect Code Example (Avoid using this):
{% comment %}app/views/partials/count-badge.liquid{% endcomment %}
{% doc %}
@param {number} count - Number of items to display
{% enddoc %}
<span class="badge">{{ count }}</span>
{% comment %}Calling site — passing a string where a number is expected{% endcomment %}
{% render 'count-badge', count: "five" %}
✓ Correct Code Example (Use this instead):
{% render 'count-badge', count: 5 %}
{% render 'count-badge', count: item.count %}
Configuration
The default configuration for this check:
ValidRenderPartialArgumentTypes:
enabled: true
severity: warning
Disabling This Check
This check is safe to disable if your codebase passes values of different types intentionally and relies on Liquid's dynamic type coercion.