Back to Prettier

Watching For Changes

website/versioned_docs/version-stable/watching-files.md

3.8.3394 B
Original Source

You can have Prettier watch for changes from the command line by using onchange. For example:

bash
npx onchange "**/*" -- npx prettier --write --ignore-unknown {{changed}}

Or add the following to your package.json:

json
{
  "scripts": {
    "prettier-watch": "onchange \"**/*\" -- prettier --write --ignore-unknown {{changed}}"
  }
}