ValidRenderSnippetArgumentTypes
All arguments provided when rendering a snippet must match the respective parameter's type defined in that snippet's LiquidDoc. If the argument is a variable this check will always pass.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check. All examples refer to the following snippet with optional parameters.
snippets/example-snippet.liquid
Anchor to ✗ Fail✗ Fail
In the following example, the snippet is being rendered with an incorrect type:
sections/section.liquid
Anchor to ✓ Pass✓ Pass
In the following example, all arguments passed into the snippet match the expected type:
sections/section.liquid
NOTE: shop
and product
are global liquid variables
Anchor to ✓ Pass✓ Pass
In the following example, an object is passed as a boolean argument since all Liquid objects can be truthy/falsey:
sections/section.liquid
Anchor to ✓ Pass✓ Pass
In the following example, a variable is passed as an argument, which will always pass this check:
sections/section.liquid
Anchor to OptionsOptions
The following example contains the default configuration for this check:
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.