Canvas lint
Validate Easol themes using the Canvas linter.
Easol maintains easol-canvas, a Ruby gem that validates Easol themes against the platform's requirements.
Canvas lint helps identify common issues before a theme is deployed by checking your theme's structure, syntax, and schema definitions.
You can find the project on:
Installing Canvas
Install the gem locally:
gem install easol-canvasFrom the root of your theme directory, run:
canvas lintValidation checks
canvas lint performs the following validation checks.
Required files
Verifies that required theme files exist and are not empty.
Required files include:
templates/product/indextemplates/blog_overview/indextemplates/blog_post/indexpartials/footer/indexpartials/menu/indexassets/index.css
HTML validation
Checks that all .html files contain valid HTML.
Liquid validation
Checks that all .html and .liquid files contain valid Liquid syntax.
JSON validation
Checks that all .json files contain valid JSON.
Sass validation
Checks that all .css, .scss, and .sass files contain valid Sass syntax.
Block schema validation
Validates the front matter schema for every block, including:
- Valid schema formatting.
- Required attributes.
- Valid property names.
- Supported field types.
Menu schema validation
Validates the schema defined in:
partials/menu/index.htmlFooter schema validation
Validates the schema defined in:
partials/footer/index.htmlCustom type validation
Validates all custom type definitions and their attributes.
GitHub Actions
We recommend running Canvas lint automatically on every push using the canvas-linter-action GitHub Action.
Setup instructions are available in the project's README:
Developer considerations
- Run
canvas lintbefore committing changes. - Configure the GitHub Action to validate every pull request and push.
- Treat lint errors as build failures to catch issues before deployment.
- Use Canvas lint alongside your normal HTML, CSS, and JavaScript tooling.