MissingRenderSnippetArguments
All required arguments defined in a snippet file's LiquidDoc must be provided when rendering that snippet.
Anchor to ExamplesExamples
The following examples contain code snippets that either pass or fail this check. Each example references this base snippet, which defines two parameters: one required and one optional (identified by square brackets).
snippets/example-snippet.liquid
{% doc %}
@param {string} some_str
@param {number} [some_num]
{% enddoc %}
Anchor to ✗ Fail✗ Fail
In the following example, the snippet is being rendered without the required argument:
sections/section.liquid
{% render 'example-snippet', : 1 %}
Anchor to ✓ Pass✓ Pass
In the following example, the required argument is being provided, but the optional argument is not:
sections/section.liquid
{% render 'example-snippet', : 'text' %}
Anchor to ✓ Pass✓ Pass
In the following example, the required argument and the optional argument is being provided:
sections/section.liquid
{% render 'example-snippet', : 'text', : 1 %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
MissingRenderSnippetArguments
enabledtrue
severity warning
Parameter | Description |
---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended.
Was this page helpful?