Skip to main content
Theme Check is a linter and validator for Shopify themes that helps you write better Liquid code by catching errors and enforcing best practices.

Overview

Theme Check analyzes your theme files and reports:
  • Syntax errors: Invalid Liquid syntax
  • Performance issues: Code that may slow down your theme
  • Accessibility problems: Missing or incorrect accessibility attributes
  • Best practice violations: Code that doesn’t follow Shopify’s recommendations
  • Translation issues: Missing or incorrect translation keys

Installation Methods

Horizon includes Theme Check in its list of recommended VS Code extensions.
1

Open Horizon in VS Code

When you open the Horizon theme in VS Code for the first time, you’ll see a prompt to install recommended extensions.
2

Install Theme Check VS Code

Click “Install” to add the Theme Check VS Code extension.Or install manually from the Extensions marketplace:
  1. Press Cmd/Ctrl + Shift + X
  2. Search for “Shopify Theme Check”
  3. Click “Install”
3

Enable real-time validation

Once installed, Theme Check automatically validates your Liquid files as you type, showing errors and warnings inline.

Command Line

Theme Check is included with Shopify CLI:
No additional installation required if you have Shopify CLI installed.

Running Theme Check

Basic Usage

Run Theme Check on your entire theme:
Output with no issues:
Output with issues:

Check Specific Files

Validate specific files or directories:

Auto-Correct Issues

Automatically fix issues that can be corrected:
Output:
Not all issues can be auto-corrected. Complex problems require manual fixes.

Output Formats

Generate output in different formats:

List Available Checks

View all available Theme Check rules:
Output:

Common Issues and Fixes

LiquidTag Errors

Problem:
Error:
Fix: Use valid Liquid tags. Check the Liquid reference for available tags.

ParserBlockingJavaScript

Problem:
Error:
Fix: Use async or defer attributes:

MissingTemplate

Problem:
Error:
Fix: Use the current API:

UnusedAssign

Problem:
Error:
Fix: Remove unused assignments:

SpaceInsideBraces

Problem:
Error:
Fix:

Configuration

Theme Check Configuration File

Create a .theme-check.yml file in your theme root to customize rules:

Severity Levels

Theme Check uses three severity levels:
  • error: Critical issues that should be fixed
  • warning: Issues that should be addressed but aren’t critical
  • info: Suggestions for improvement

VS Code Integration

Real-Time Validation

With the VS Code extension installed:
  1. Open any .liquid file
  2. Errors appear as squiggly underlines
  3. Hover over errors for details
  4. Click “Quick Fix” for auto-correct suggestions

Extension Features

  • Syntax highlighting: Enhanced Liquid syntax highlighting
  • Auto-completion: IntelliSense for Liquid tags and filters
  • Hover documentation: Inline documentation for Liquid elements
  • Go to definition: Jump to snippet and section definitions
  • Format on save: Auto-format Liquid files

Extension Settings

Configure the extension in VS Code settings:

CI/CD Integration

Horizon runs Theme Check on every commit via Shopify/theme-check-action.

GitHub Actions Example

Add Theme Check to your GitHub Actions workflow:

Command Line for CI

Run Theme Check in CI pipelines:

Best Practices

Run Before Commits

Validate your code before committing to catch issues early.

Enable VS Code Extension

Get real-time feedback while coding for faster development.

Configure for Your Needs

Customize rules in .theme-check.yml to match your workflow.

Fix Critical Issues First

Focus on errors before warnings for maximum impact.
1

Enable real-time checking

Install the VS Code extension for instant feedback while coding.
2

Run full checks regularly

Run this before committing code.
3

Auto-fix when possible

Let Theme Check fix simple issues automatically.
4

Address critical issues

Fix all errors before deploying to production.

Troubleshooting

False Positives

If Theme Check reports incorrect issues:
  1. Update Shopify CLI to the latest version
  2. Check if the issue is a known limitation
  3. Add exceptions in .theme-check.yml if necessary

Performance Issues

If Theme Check is slow:
  1. Add large directories to ignore list:
  2. Run checks on specific files during development
  3. Run full checks only before commits

Extension Not Working

  1. Ensure you’re in a valid Shopify theme directory
  2. Reload VS Code window
  3. Check the Output panel for error messages
  4. Reinstall the extension if needed

Additional Resources

Theme Check Documentation

Official Theme Check documentation

Theme Check GitHub

Theme Check source code and issues

Shopify CLI

Learn more about Shopify CLI

Development Workflow

Best practices for theme development

Next Steps

Now that you understand Theme Check, explore:
  • Run shopify theme check on your theme
  • Install the VS Code extension for real-time validation
  • Configure .theme-check.yml for your project
  • Integrate Theme Check into your CI/CD pipeline