chore: add husky

This commit is contained in:
wwsun
2023-09-22 17:48:54 +08:00
parent 226d71c704
commit b6a47acdde
5 changed files with 31 additions and 9 deletions
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn commitlint --edit "$1"
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged --allow-empty
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-case': [0],
'subject-case': [0],
},
};
+10 -3
View File
@@ -21,7 +21,8 @@
"ver": "lerna version --no-private --conventional-commits",
"release": "yarn eslint && yarn build && yarn run ver && lerna publish from-git",
"release:beta": "yarn eslint && yarn build && yarn run ver && lerna publish from-package --dist-tag beta",
"up": "yarn upgrade-interactive --latest"
"up": "yarn upgrade-interactive --latest",
"postinstall": "husky install"
},
"devDependencies": {
"@babel/preset-env": "^7.19.3",
@@ -49,11 +50,11 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"http-server": "^14.1.0",
"husky": "^8.0.1",
"husky": "^8.0.3",
"jest": "^29.1.1",
"jest-environment-jsdom": "^29.1.1",
"lerna": "^6.6.1",
"lint-staged": "^13.1.0",
"lint-staged": "^14.0.1",
"prettier": "^2.8.7",
"react": "^17.0.0",
"react-dom": "^17.0.0",
@@ -63,5 +64,11 @@
},
"resolutions": {
"@yarnpkg/parsers": "3.0.0-rc.48.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
}
}
+6 -6
View File
@@ -11185,9 +11185,9 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"
husky@^8.0.1:
husky@^8.0.3:
version "8.0.3"
resolved "https://registry.npmmirror.com/husky/-/husky-8.0.3.tgz"
resolved "https://registry.npmmirror.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==
iconv-lite@0.4.24, iconv-lite@^0.4.24:
@@ -13043,10 +13043,10 @@ lines-and-columns@~2.0.3:
resolved "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-2.0.3.tgz"
integrity sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==
lint-staged@^13.1.0:
version "13.3.0"
resolved "https://registry.npmmirror.com/lint-staged/-/lint-staged-13.3.0.tgz"
integrity sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==
lint-staged@^14.0.1:
version "14.0.1"
resolved "https://registry.npmmirror.com/lint-staged/-/lint-staged-14.0.1.tgz#57dfa3013a3d60762d9af5d9c83bdb51291a6232"
integrity sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==
dependencies:
chalk "5.3.0"
commander "11.0.0"