Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Use it in your terminal

CP Clermont edited this page Jul 12, 2023 · 5 revisions

You can use prettier in the terminal as you would normally with Node.js.

Add the plugin to your prettier configuration

{
  "plugins": ["@shopify/prettier-plugin-liquid"]
}

As a local dependency

You can add prettier as a script in your package.json,

{
  "scripts": {
    "format": "prettier --write '**/*.liquid'"
  }
}

And then format all your Liquid files like this:

# npm way
npm run format

# yarn way
yarn format

As a global dependency

If you installed the plugin globally, run

prettier --plugin=@shopify/prettier-plugin-liquid path/to/file.liquid --write