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
VS Code Extension (Recommended)
Horizon includes Theme Check in its list of recommended VS Code extensions.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.
Install Theme Check VS Code
Click “Install” to add the Theme Check VS Code extension.Or install manually from the Extensions marketplace:
- Press
Cmd/Ctrl + Shift + X - Search for “Shopify Theme Check”
- Click “Install”
Command Line
Theme Check is included with Shopify CLI:Running Theme Check
Basic Usage
Run Theme Check on your entire theme:Check Specific Files
Validate specific files or directories:Auto-Correct Issues
Automatically fix issues that can be corrected: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:Common Issues and Fixes
LiquidTag Errors
Problem:ParserBlockingJavaScript
Problem:MissingTemplate
Problem:UnusedAssign
Problem:SpaceInsideBraces
Problem: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:- Open any
.liquidfile - Errors appear as squiggly underlines
- Hover over errors for details
- 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.
Recommended Workflow
Troubleshooting
False Positives
If Theme Check reports incorrect issues:- Update Shopify CLI to the latest version
- Check if the issue is a known limitation
- Add exceptions in
.theme-check.ymlif necessary
Performance Issues
If Theme Check is slow:- Add large directories to ignore list:
- Run checks on specific files during development
- Run full checks only before commits
Extension Not Working
- Ensure you’re in a valid Shopify theme directory
- Reload VS Code window
- Check the Output panel for error messages
- 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 checkon your theme - Install the VS Code extension for real-time validation
- Configure
.theme-check.ymlfor your project - Integrate Theme Check into your CI/CD pipeline