Skip to main content

ReservedDocParamNames

Parameters defined in LiquidDoc within a block file can't reuse names that are reserved for the content_for tag. Because blocks can be rendered with content_for, a LiquidDoc parameter that reuses one of these reserved names would collide with the tag's arguments.

The reserved names are attributes, block, blocks, class, context, id, inherit, resource, resources, schema, section, sections, settings, snippet, snippets, src, style, styles, template, templates, and type.

This check only applies to files in the blocks directory.


The following examples contain code snippets that either fail or pass this check.

In the following example, a LiquidDoc parameter reuses the reserved settings name:

blocks/block.liquid

{% doc %}
@param {string} settings - The block's settings
{% enddoc %}

In the following example, the LiquidDoc parameters use names that aren't reserved:

blocks/block.liquid

{% doc %}
@param {string} heading - The block's heading
@param {number} columns - The number of columns to display
{% enddoc %}

The following example contains the default configuration for this check:

ReservedDocParamNames:
enabled: true
severity: error
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?