Skip to main content

UnrecognizedRenderSnippetArguments

All arguments provided when rendering a snippet must match the arguments defined in that snippet's LiquidDoc.


The following examples contain code snippets that either fail or pass this check. All examples refer to the following snippet that defines two parameters (one optional, indentified by square brackets; one required).

snippets/example-snippet.liquid

{% doc %}
@param {string} some_str
@param {number} [some_num]
{% enddoc %}

In the following example, the snippet is being rendered with an unrecognized argument:

sections/section.liquid

{% render 'example-snippet', some_str: 'text', some_num: 1, some_bool: false %}

In the following example, the snippet is being rendered with recognized argument:

sections/section.liquid

{% render 'example-snippet', some_str: 'text', some_num: 1 %}

The following example contains the default configuration for this check:

UnrecognizedRenderSnippetArguments:
enabled: true
severity: warning
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

Disabling this check isn't recommended.


Was this page helpful?