mocha-shopify-lint

raw JSON →
1.0.0 verified Fri May 01 auth: no javascript deprecated

mocha-shopify-lint (v1.0.0) integrates Shopify's theme-lint with Mocha test framework, allowing developers to validate Liquid template files as part of the test suite. It accepts glob patterns to select which .liquid files to lint. Released in 2016, no active development or recent updates observed. Differentiates by providing a bridge between theme-lint and Mocha, but limited features and potential compatibility issues with newer versions of theme-lint or Mocha.

error Cannot find module 'theme-lint'
cause theme-lint peer dependency not installed or missing.
fix
npm install theme-lint --save-dev
error Error: Cannot find module 'mocha'
cause Mocha is not installed or not in devDependencies.
fix
npm install mocha --save-dev
deprecated Package is unmaintained since 2017; may not work with modern theme-lint or Mocha versions.
fix Consider using Shopify CLI's built-in linting or directly using theme-lint/tag-lint.
gotcha Glob patterns are processed by glob-all; syntax may differ from standard globbing.
fix Refer to glob-all documentation for pattern syntax.
gotcha No options to configure lint rules or severity; uses default theme-lint configuration.
fix Create a .theme-lint.yml or theme-lint.json file in project root.
npm install mocha-shopify-lint
yarn add mocha-shopify-lint
pnpm add mocha-shopify-lint

Configures mocha-shopify-lint to lint Liquid files matching glob patterns.

const mochaShopifyLint = require('mocha-shopify-lint');
mochaShopifyLint(['./test/fixtures/**/*.liquid']);