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-canvas

From the root of your theme directory, run:

canvas lint

Validation 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/index
  • templates/blog_overview/index
  • templates/blog_post/index
  • partials/footer/index
  • partials/menu/index
  • assets/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.

Validates the schema defined in:

partials/menu/index.html

Validates the schema defined in:

partials/footer/index.html

Custom 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 lint before 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.

On this page