监视变化
你可以使用 onchange 让 Prettier 从命令行监视更改。例如:
¥You can have Prettier watch for changes from the command line by using onchange. For example:
npx onchange "**/*" -- npx prettier --write --ignore-unknown {{changed}}
或将以下内容添加到你的 package.json
:
¥Or add the following to your package.json
:
{
"scripts": {
"prettier-watch": "onchange \"**/*\" -- prettier --write --ignore-unknown {{changed}}"
}
}