build: update husky config

This commit is contained in:
chenjiahan 2021-04-10 17:36:36 +08:00 committed by neverland
parent ce3193a245
commit 2417219266
4 changed files with 10 additions and 6 deletions

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

4
.husky/commit-msg Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install vant-cli commit-lint $1

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install lint-staged

View File

@ -11,6 +11,7 @@
"scripts": { "scripts": {
"dev": "node build/dev.js", "dev": "node build/dev.js",
"lint": "eslint ./packages --ext .js,.ts --fix && stylelint \"packages/**/*.less\" --fix", "lint": "eslint ./packages --ext .js,.ts --fix && stylelint \"packages/**/*.less\" --fix",
"prepare": "husky install",
"release": "sh build/release.sh", "release": "sh build/release.sh",
"release:site": "sh build/release-site.sh", "release:site": "sh build/release-site.sh",
"build:lib": "yarn && npx gulp -f build/compiler.js --series buildEs buildLib", "build:lib": "yarn && npx gulp -f build/compiler.js --series buildEs buildLib",
@ -25,12 +26,6 @@
"type": "git", "type": "git",
"url": "git+ssh://git@github.com/youzan/vant-weapp.git" "url": "git+ssh://git@github.com/youzan/vant-weapp.git"
}, },
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "vant-cli commit-lint"
}
},
"lint-staged": { "lint-staged": {
"*.{ts,js}": [ "*.{ts,js}": [
"eslint --fix", "eslint --fix",