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.
To learn more about the check and its options, click on the name of the check.
Anchor to Liquid file checksLiquid file checks
These checks analyze the style and validity of Liquid code. Some of these checks support auto-correction using the --auto-correct
flag.
Check | Severity | Purpose | Auto-correction |
---|---|---|---|
AppBlockValidTags | Error | Identifies forbidden Liquid tags in theme app extension app block and app embed block code. | |
AssetPreload | Warning | Encourages preloading of assets using Liquid filters, rather than HTML attributes. | |
AssetSizeAppBlockCSS | Error | Prevents theme app extensions from using CSS files larger than the configured threshold. | |
AssetSizeAppBlockJavascript | Error | Prevents theme app extensions from using JavaScript files and external scripts with a compressed size larger than the configured threshold. | |
AssetSizeCSS | Error | Prevents themes from using CSS files larger than the configured threshold. | |
AssetSizeJavaScript | Error | Prevents using theme JavaScript files and external scripts with a compressed size greater than the configured threshold. | |
BlockIdUsage | Warning | Warns against the use of block IDs in conditional statements and case statements. | |
CdnPreconnect | Warning | This check is aimed at signaling the redundant preconnect to Shopify's CDN. | |
ContentForHeaderModification | Error | Identifies code that tries to parse content_for_header . | |
DeprecateBgsizes | Warning | Discourages use of the bgset extension instead of the image-set attribute for loading background images. | |
DeprecateLazysizes | Warning | Discourages use of the lazysizes library for lazy loading images, iframes, and scripts. | |
DeprecatedFilter | Warning | Discourages using deprecated filters in themes. | Yes |
DeprecatedFontsOnSectionsAndBlocks | Warning | Discourages using deprecated fonts in section and block schemas. | |
DeprecatedFontsOnSettingsSchema | Warning | Discourages using deprecated fonts in the settings_schema.json file. | |
DeprecatedTag | Error | Discourages using deprecated tags in themes. | |
DuplicateContentForArguments | Warning | Identifies when argument names provided for the content_for tag are not unique. | |
DuplicateRenderSnippetArguments | Warning | Identifies when argument names provided for the render tag are not unique. | |
EmptyBlockContent | Warning | Detects instances where the Liquid tag {% content_for 'blocks' %} is used when the associated schema blocks array is empty or undefined. | |
HardcodedRoutes | Warning | Encourages use of the routes object instead of hardcoding URLs. | |
ImgWidthAndHeight | Error | Enforces setting the width and height attributes on img tags. | |
LiquidFreeSettings | Warning | Identifies when a theme is using the {% liquid %} tag within Settings values. | |
LiquidHTMLSyntaxError | Error | Identifies Liquid and HTML syntax errors. | |
MissingAsset | Error | Makes sure that all asset files referenced by the asset_url filter exist. | |
AppBlockMissingSchema | Error | Ensures schema is present in app blocks in theme app extensions. | |
MissingContentForArguments | Warning | Identifies when required arguments are not provided when using a content_for tag. | |
MissingRenderSnippetArguments | Warning | Identifies when required arguments are not provided when using a render tag. | |
MissingTemplate | Warning | Identifies when a resource is referenced using a render , section , or
include tag, but doesn't exist. | Yes |
PaginationSize | Warning | Ensures that objects are paginated with performant sizes so too many objects are not loaded at once. | |
ParserBlockingJavaScript | Error | Identifies script tags that don't have defer or async attributes, avoiding parser-blocking JavaScript. | |
RemoteAsset | Warning | Discourages use of third party domains for hosting assets. | |
RequiredLayoutThemeObject | Error | Makes sure that the theme.liquid layout file contains the required {{ content_for_header }} and {{ content_for_layout }} objects. | Yes |
SchemaPresetsBlockOrder | Warning | Makes sure that the section and block schema presets are correctly used in the block_order . | |
SchemaPresetsStaticBlocks | Error | Warns if a preset static block doesn't have a {% content_for "block" ... %} tag in the Liquid code. | |
StaticStylesheetAndJavascriptTags | Error | Warns if Liquid code is used inside a {% stylesheet %} or {% javascript %} tag. | |
TranslationKeyExists | Error | Identifies references to translations that don't exist. | |
UnclosedHTMLElement | Error | Identifies instances of unclosed HTML elements in branching code. | |
UndefinedObject | Error | Identifies references to undefined Liquid objects. | |
UniqueStaticBlockId | Error | Identifies when two static blocks are using the same ID. | |
UnknownFilter | Error | Identifies references to unknown Liquid filters. | |
UnusedAssign | Warning | Identifies variable definitions that aren't used. | |
UniqueDocParamNames | Error | Identifies when parameter names in LiquidDoc are not unique. | |
UnrecognizedContentForArguments | Warning | Identifies when unknown arguments for a static block are provided when using a content_for tag. | |
UnrecognizedRenderSnippetArguments | Warning | Identifies when unknown arguments for a snippet are provided when using a render tag. | |
UnsupportedDocTag | Error | Identifies when LiquidDoc tag is used outside of snippets. | |
UnusedDocParam | Warning | Identifies when parameters are defined within LiquidDoc, but are not used within the snippet. | |
ValidBlockTarget | Error | Identifies when a block is using an invalid target. | |
ValidContentForArguments | Error | Identifies invalid arguments passed to the {% content_for %} tag | |
ValidContentForArgumentTypes | Warning | Identifies when arguments are provided when using a content_for tag, but the types of the arguments don't match the type defined in the block's LiquidDoc. | |
ValidDocParamNames | Warning | Identifies when parameter names within LiquidDoc collide with reserved liquid keywords. | |
ValidDocParamTypes | Error | Identifies when invalid parameter types exist in LiquidDoc. | |
ValidLocalBlocks | Error | Identifies when a local block is used incorrectly. | |
ValidRenderSnippetArgumentTypes | Warning | Identifies when arguments are provided when using a render tag, but the types of the arguments don't match the type defined in the snippet's LiquidDoc. | |
ValidSchema | Warning | Identifies invalid JSON in {% schema %} tags. | |
ValidSchemaName | Error | Identifies invalid values for the schema name property. | |
ValidSettingsKey | Error | Identifies when preset settings key, default settings key, or referenced block setting key is defined in their respective schema. | |
ValidStaticBlockType | Error | Identifies when a static block is using an invalid type. | |
VariableName | Warning | Identifies variable names that don't adhere to a selected naming convention. |
Anchor to JSON file checksJSON file checks
These checks analyze the syntax, content and structure of JSON files.
Check | Severity | Purpose | Auto-correction |
---|---|---|---|
JSONMissingBlock | Error | Identifies when a JSON template file is referencing block types that don't exist. | |
JSONSyntaxError | Error | Identifies invalid JSON files in themes. | |
MatchingTranslations | Warning | Identifies missing or additional translations in locale files. | Yes |
ValidHTMLTranslation | Warning | Identifies invalid HTML inside translations. |
Was this page helpful?