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

Use it as a pre commit hook

CP Clermont edited this page May 31, 2022 · 4 revisions

What's a pre-commit hook?

You might work in a big team and would like to make it super easy for everyone to maintain a code style.

Setting up a pre-commit hook will make it so prettier will run on files that were changed before a commit is even made.

Even if your coworkers haven't setup prettier in their editor.

How do I set them up?

  1. Add @shopify/prettier-plugin-liquid as a dependency of your project.

    # npm way
    npm install -D prettier @shopify/prettier-plugin-liquid
    
    # yarn way
    yarn add -D prettier @shopify/prettier-plugin-liquid
  2. Follow the official instructions from prettier on how to setup a pre-commit hook.

Clone this wiki locally