当前位置: 首页 > 文档资料 > Prettier 帮助文档 >

Watching For Changes

优质
小牛编辑
129浏览
2023-12-01

If you prefer to have prettier watch for changes from the command line you can use a package like 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}}"
  },