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}}"
}
}
© James Long and contributors
https://prettier.io/docs/en/watching-files.html