Skip to main content

ValidSettingsKey

  • Identifies keys inside presets.[].settings and default.settings that do not exist in settings.[].id within the same file's schema
  • Identifies keys inside presets.[](recursive .blocks.[]).settings and default.blocks.[].settings that do not exist in settings.[].id within the referenced block's schema

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

sections/section.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "custom-setting",
"label": "Custom Setting",
},
"presets": [{
"name": "Preset",
"settings": {
"fake-setting": "not valid setting"
}
}]
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "custom-setting",
"label": "Custom Setting",
},
"presets": [{
"name": "Preset",
"settings": {
"custom-setting": "valid setting"
}
}]
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "custom-setting",
"label": "Custom Setting",
},
"default": {
"settings": {
"fake-setting": "not valid setting"
}
}
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "custom-setting",
"label": "Custom Setting",
},
"default": {
"settings": {
"custom-setting": "valid setting"
}
}
}
{% endschema %}

Anchor to Preset block settingsPreset block settings

The sample block code below is used in the following pass/fail examples.

blocks/example-block.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "block-setting",
"label": "Block Setting",
}
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"blocks": [{ "type": "example-block" }],
"presets": [{
"name": "Preset",
"blocks": [{
"type": "example-block",
"settings": {
"fake-setting": "not valid setting in example-block"
}
}]
}]
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"blocks": [{ "type": "example-block" }],
"presets": [{
"name": "Preset",
"blocks": [{
"type": "example-block",
"settings": {
"block-setting": "valid setting in example-block"
}
}]
}]
}
{% endschema %}

Anchor to Default block settingsDefault block settings

The sample block code below is used in the following pass/fail examples.

blocks/example-block.liquid

{% schema %}
{
"settings": {
"type": "text",
"id": "block-setting",
"label": "Block Setting",
}
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"blocks": [{ "type": "example-block" }],
"default": {
"name": "Preset",
"blocks": [{
"type": "example-block",
"settings": {
"fake-setting": "not valid setting in example-block"
}
}]
}
}
{% endschema %}

sections/section.liquid

{% schema %}
{
"blocks": [{ "type": "example-block" }],
"default": {
"name": "Preset",
"blocks": [{
"type": "example-block",
"settings": {
"block-setting": "valid setting in example-block"
}
}]
}
}
{% endschema %}

ValidSettingsKey:
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?