docs(cli): update commit-lint config

This commit is contained in:
chenjiahan 2021-04-04 15:15:24 +08:00
parent 4604f4c647
commit 2d979d3977
2 changed files with 5 additions and 7 deletions

View File

@ -36,15 +36,10 @@ yarn add @vant/cli --dev
"test": "vant-cli test",
"lint": "vant-cli lint",
"build": "vant-cli build",
"prepare": "husky install",
"release": "vant-cli release",
"build-site": "vant-cli build-site"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "vant commit-lint"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx,vue}": "eslint --fix",
"*.{vue,css,less,scss}": "stylelint --fix"
@ -70,4 +65,3 @@ yarn add @vant/cli --dev
- [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
- [桌面端组件](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/desktop.md)
- [更新日志](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md)

View File

@ -59,3 +59,7 @@ npx vant-cli dev
## commit-lint
校验 commit message 的格式是否符合规范,需要配合 `husky` 在提交 commit 时触发。
```bash
npx husky add .husky/commit-msg 'npx --no-install vant-cli commit-lint $1'
```