JSONMissingBlock
Ensures that a JSON template file includes block types that reference valid files and are declared at the root level of their associated schema.
Anchor to ExamplesExamples
The following example contains code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
In the following example, the JSON template file references a block type that doesn't exist. There's no corresponding invalid-block.liquid
file in the blocks
directory for the theme:
templates/index.json
Anchor to ✗ Fail✗ Fail
In the following example, the JSON template file references a block type that exists, but is not declared at the root level of the custom-section
liquid section schema:
templates/index.json
sections/custom-section.liquid
Anchor to ✗ Fail✗ Fail
In the following example, the JSON template file references a block type that exists, but isn't declared at the root level of the text
liquid block schema:
templates/index.json
blocks/text.liquid
Anchor to ✓ Pass✓ Pass
In the following example, the JSON template file references a block type that exists, and is declared at the root level of the custom-section
liquid section schema:
templates/index.json
sections/custom-section.liquid
Anchor to ✓ Pass✓ Pass
In the following example, the JSON template file references a block type that exists, and is declared at the root level of the text
liquid block schema:
templates/index.json
blocks/text.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.