Watching For Changes
You can have Prettier watch for changes from the command line by using onchange. For example:
npx onchange '**/*.js' -- npx prettier --write {{changed}}
Or add the following to your package.json
:
{
"scripts": {
"prettier-watch": "onchange '**/*.js' -- prettier --write {{changed}}"
}
}