Checks reference

You can run the following checks as part of Theme Check. Each check identifies a specific error or a place in your code where a best practice is not being followed.

Checks are grouped by category to help you to understand their purpose. Some checks are in multiple categories.

To learn more about the check and its options, click on the name of the check.

Including or excluding check categories

You can include or exclude certain categories of checks using the --category <CATEGORY> or --exclude-category <CATEGORY> flag.

For example, to run only Liquid checks, use the command shopify theme check --category liquid. To disable translation checks, use the command shopify theme check --exclude-category translation.

You can specify multiple categories using multiple instances of the flag:

HTML checks

These checks analyze the content of HTML files.

Check Purpose
HtmlParsingError Reports errors preventing the HTML from being parsed and analyzed by Theme Check.
ImgLazyLoading Suggests lazy loading for images to increase performance.
ImgWidthAndHeight Enforces setting the width and height attributes on img tags.
ParserBlockingJavaScript Identifies script tags that don't have defer or async attributes, avoiding parser-blocking JavaScript.
RemoteAsset Discourages the use of third party domains for hosting assets.

JSON checks

These checks analyze the content and structure of JSON files and syntax.

Check Purpose
ValidJson Identifies invalid JSON files in themes.
ValidSchema Identifies invalid JSON in {% schema %} tags.
ValidHTMLTranslation Identifies invalid HTML inside translations.

Liquid checks

These checks analyze the style and validity of Liquid code.

Check Purpose
AssetUrlFilters Encourages the use of asset_url or img_url filters to serve assets.
ContentForHeaderModification Identifies code that tries to parse content_for_header.
ConvertIncludeToRender Discourages using the deprecated include tag instead of the render tag.
DeprecatedFilter Discourages using deprecated filters in themes.
LiquidTag Recommends using {% liquid ... %} if four or more consecutive Liquid tags ({% ... %}) are found.
MissingEnableComment Makes sure that when theme-check-disable is used in the middle of a template, the corresponding theme-check-enable comment is also present.
MissingRequiredTemplateFiles Makes sure that all template files required for the Shopify Theme Store are present.
MissingTemplate Identifies when a resource is referenced using a render, section, or include tag, but doesn't exist.
NestedSnippet Reports deeply nested render tags or include tags.
ParserBlockingScriptTag Identifies the use of the script_tag filter.
RequiredDirectories Makes sure that all template files required for the Shopify Theme Store are present.
RequiredLayoutThemeObject Makes sure that the theme.liquid layout file contains the required {{ content_for_header }} and {{ content_for_layout }} objects.
SpaceInsideBraces Identifies inconsistent spacing inside Liquid tags and variables.
SyntaxError Identifies Liquid syntax errors.
TemplateLength Identifies large Liquid template files.
UndefinedObject Identifies references to undefined Liquid objects.
UnknownFilter Identifies references to unknown Liquid filters.
UnusedAssign Identifies variable definitions that aren't used.
UnusedSnippet Identifies snippets that aren't used.

Performance checks

These checks look for common performance issues in theme code.

Check Purpose
AssetSizeCSS Prevents themes from using CSS files larger than the configured threshold.
AssetSizeJavaScript Prevents using theme JavaScript files and external scripts with a compressed size greater than the configured threshold.
AssetUrlFilters Encourages the use of asset_url or img_url filters to serve assets.
ImgLazyLoading Suggests lazy loading for images to increase performance.
ImgWidthAndHeight Enforces setting the width and height attributes on img tags.
ParserBlockingJavaScript Identifies script tags that don't have defer or async attributes.
ParserBlockingScriptTag Identifies the use of the script_tag filter that isn't wrapped in a script tag with defer or async attributes.
RemoteAsset Discourages use of third party domains for hosting assets.

Translation checks

These checks ensure that translations are complete.

Check Purpose
DefaultLocale Makes sure that the theme has a default locale file.
MatchingSchemaTranslations Identifies missing or additional translations in {% schema %} tags.
MatchingTranslations Identifies missing or additional translations in locale files.
TranslationKeyExists Identifies references to translations that don't exist.