MissingTemplate

Version 0.1.0+

Identifies when a resource is referenced using a render, section, or include tag, but doesn't exist.

Examples

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

✗ Fail

In the following example, there is no corresponding snippet-that-does-not-exist file in the theme:

✓ Pass

In the following example, article-card exists in the snippets folder of the theme:

Disabling this check

Disabling this check isn't recommended.

Options

Parameter Description
enabled Whether this check is enabled.
ignore A list of files to ignore instances of missing templates within.
ignore_missing A list of patterns of missing template files to ignore.

ignore and ignore_missing

The ignore option instructs Theme Check to ignore all occurrences of MissingTemplate according to the file in which they appear.

For example, using the following setting, Theme Check ignores all MissingTemplate errors in templates/index.liquid, no matter the file being rendered:

The ignore_missing option instructs Theme Check to ignore all occurrences of MissingTemplate based on the target template being rendered.

For example, using the following setting, Theme Check ignores offenses on {% render 'icon-missing' %} across all theme files: