Theme Check configuration

You can configure Theme Check to override default check options, enable or disable specific checks, or point to your own custom checks. You can make these changes using a config file, disable checks using comments, or selectively run checks using command line flags. To learn more about theme check command line flags, refer to Theme Check commands.

Config file

Add a .theme-check.yml file to the root of your theme to override check defaults.

You can generate a new .theme-check.yml file using the command shopify theme check --init.

You can adjust the following settings:

Setting Description
root If your theme isn't using the standard theme directory structure, you can provide root path for finding the templates, sections, and snippets directories. For example, If you generate code from a src directory, then you should point your Theme Check configuration at your corresponding dist directory.
ignore Exclude directories in the theme from Theme Check.
require If you want to use a custom check, then add the path to each custom check RB file.
Check settings For each check, set enabled to true or false, set the check severity, set specific ignore files and paths for the check, and configure any other check options. If you created a custom check, then you need to enable it using this method.
You can view the default values of check options in the checks reference.

Check severity

version 1.1.0+

The check severity indicates the relative importance of a check to the functionality and optimization of your theme. Severity levels include error, suggestion, and style. You can change the severity of a check in your config file.

If you're running theme check as a part of your CI process, the severity levels of the failed checks can determine the exit code that you receive. By default, Theme Check fails, or returns an exit code of 1, when one or more issues with severity error are detected. You can configure the severity that causes a run of theme check to fail using the --fail-level flag.

Disable checks using Liquid comments

You can disable all checks or specific checks using comments. You can disable checks for a specific section of your theme code, or for an entire file.

Disable all checks for a section of your template:

Disable a specific check by including it in the comment:

Disable multiple checks by including them as a comma-separated list:

Disable checks for the entire document by placing the comment on the first line: