watching-files.md

August 21, 2020 ยท View on GitHub

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

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

Or add the following to your package.json:

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