From 2d979d3977bc7de6f11481a79ffa22c99c078bec Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sun, 4 Apr 2021 15:15:24 +0800 Subject: [PATCH] docs(cli): update commit-lint config --- packages/vant-cli/README.md | 8 +------- packages/vant-cli/docs/commands.md | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/vant-cli/README.md b/packages/vant-cli/README.md index 5f16e2bd5..3b5f25d88 100644 --- a/packages/vant-cli/README.md +++ b/packages/vant-cli/README.md @@ -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) - diff --git a/packages/vant-cli/docs/commands.md b/packages/vant-cli/docs/commands.md index d5e0bdfb3..d676ef746 100644 --- a/packages/vant-cli/docs/commands.md +++ b/packages/vant-cli/docs/commands.md @@ -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' +```