Browse Source

chore: 使用 husky 代替 yorkie (#9718)

yorkie 在 pnpm 环境下并不能正确的安装 Git Hooks, 因此使用 husky 代替它.
pull/9728/head
Chuck 4 years ago
committed by GitHub
parent
commit
c0eb9d15a0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .husky/.gitignore
  2. 7
      .husky/commit-msg
  3. 4
      .husky/pre-commit
  4. 9
      package.json

1
.husky/.gitignore

@ -0,0 +1 @@
_

7
.husky/commit-msg

@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Export Git hook params
export GIT_PARAMS=$*
npx --no-install fabric verify-commit

4
.husky/pre-commit

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

9
package.json

@ -27,7 +27,6 @@
"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
"openapi": "umi openapi",
"playwright": "playwright install && playwright test",
"precommit": "lint-staged",
"prettier": "prettier -c --write \"src/**/*\"",
"serve": "umi-serve",
"start": "cross-env UMI_ENV=dev umi dev",
@ -39,7 +38,8 @@
"test": "umi test",
"test:component": "umi test ./src/components",
"test:e2e": "node ./tests/run-tests.js",
"tsc": "tsc --noEmit"
"tsc": "tsc --noEmit",
"prepare": "husky install"
},
"lint-staged": {
"**/*.less": "stylelint --syntax less",
@ -92,12 +92,12 @@
"@umijs/preset-ant-design-pro": "^1.3.0",
"@umijs/preset-dumi": "^1.1.0",
"@umijs/preset-react": "^1.8.17",
"@umijs/yorkie": "^2.0.5",
"cross-env": "^7.0.0",
"cross-port-killer": "^1.3.0",
"detect-installer": "^1.0.0",
"eslint": "^7.32.0",
"gh-pages": "^3.2.0",
"husky": "^7.0.4",
"jsdom-global": "^3.0.0",
"lint-staged": "^10.0.0",
"mockjs": "^1.1.0",
@ -138,8 +138,5 @@
"CNAME",
"create-umi"
]
},
"gitHooks": {
"commit-msg": "fabric verify-commit"
}
}

Loading…
Cancel
Save