Use it in your terminal - Shopify/prettier-plugin-liquid GitHub Wiki
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