chore: use husky

This commit is contained in:
TonyRL
2023-05-08 01:38:56 +00:00
parent 4069ce7afb
commit c2bb5e4df5
5 changed files with 19 additions and 54 deletions
+1
View File
@@ -1,6 +1,7 @@
# folders
.devcontainer
.github
.husky
.idea
.vscode
Dockerfile*
+1
View File
@@ -1,5 +1,6 @@
.DS_Store
.env
.eslintcache
.idea
.log
.now
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run format:staged
+4 -6
View File
@@ -26,11 +26,12 @@
"dev": "cross-env NODE_ENV=dev nodemon --inspect lib/index.js",
"format": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:check": "eslint \"**/*.{js,yml}\" && prettier-check \"**/*.{js,json}\"",
"format:staged": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"format:staged": "eslint --cache \"**/*.{js,yml}\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"jest": "cross-env NODE_ENV=test jest --runInBand --forceExit --detectOpenHandles",
"jest:coverage": "cross-env NODE_ENV=test jest --coverage --reporters=default --reporters=jest-junit --runInBand --forceExit --detectOpenHandles",
"jest:watch": "cross-env NODE_ENV=test jest --watch",
"lint": "eslint .",
"prepare": "husky install",
"profiling": "NODE_ENV=production node --prof lib/index.js",
"start": "node lib/index.js",
"test": "npm run format:check && npm run jest:coverage"
@@ -146,6 +147,7 @@
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-yml": "1.5.0",
"fs-extra": "11.1.1",
"husky": "8.0.3",
"jest": "29.5.0",
"jest-junit": "16.0.0",
"mockdate": "3.0.5",
@@ -166,15 +168,11 @@
"string-width": "4.2.3",
"supertest": "6.3.3",
"tosource": "2.0.0-alpha.3",
"unified": "9.2.2",
"yorkie": "2.0.0"
"unified": "9.2.2"
},
"engines": {
"node": ">=16"
},
"gitHooks": {
"pre-commit": "npm run format:staged"
},
"reporters": [
"default",
"jest-junit"
+9 -48
View File
@@ -213,6 +213,9 @@ devDependencies:
fs-extra:
specifier: 11.1.1
version: 11.1.1
husky:
specifier: 8.0.3
version: 8.0.3
jest:
specifier: 29.5.0
version: 29.5.0
@@ -276,9 +279,6 @@ devDependencies:
unified:
specifier: 9.2.2
version: 9.2.2
yorkie:
specifier: 2.0.0
version: 2.0.0
packages:
@@ -2163,10 +2163,6 @@ packages:
dayjs: 1.11.7
dev: false
/ci-info@1.6.0:
resolution: {integrity: sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==}
dev: true
/ci-info@3.8.0:
resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==}
engines: {node: '>=8'}
@@ -3075,19 +3071,6 @@ packages:
strip-eof: 1.0.0
dev: true
/execa@0.8.0:
resolution: {integrity: sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==}
engines: {node: '>=4'}
dependencies:
cross-spawn: 5.1.0
get-stream: 3.0.0
is-stream: 1.1.0
npm-run-path: 2.0.2
p-finally: 1.0.0
signal-exit: 3.0.7
strip-eof: 1.0.0
dev: true
/execa@4.1.0:
resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==}
engines: {node: '>=10'}
@@ -3875,6 +3858,12 @@ packages:
ms: 2.1.3
dev: false
/husky@8.0.3:
resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==}
engines: {node: '>=14'}
hasBin: true
dev: true
/iconv-lite@0.5.0:
resolution: {integrity: sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==}
engines: {node: '>=0.10.0'}
@@ -4051,13 +4040,6 @@ packages:
engines: {node: '>=4'}
dev: true
/is-ci@1.2.1:
resolution: {integrity: sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==}
hasBin: true
dependencies:
ci-info: 1.6.0
dev: true
/is-core-module@2.12.0:
resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==}
dependencies:
@@ -5667,11 +5649,6 @@ packages:
abbrev: 1.1.1
dev: false
/normalize-path@1.0.0:
resolution: {integrity: sha512-7WyT0w8jhpDStXRq5836AMmihQwq2nrUVQrgjvUo/p/NZf9uy/MeJ246lBJVmWuYXMlJuG9BNZHF0hWjfTbQUA==}
engines: {node: '>=0.10.0'}
dev: true
/normalize-path@3.0.0:
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
engines: {node: '>=0.10.0'}
@@ -6987,11 +6964,6 @@ packages:
engines: {node: '>=6'}
dev: true
/strip-indent@2.0.0:
resolution: {integrity: sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==}
engines: {node: '>=4'}
dev: true
/strip-json-comments@3.1.1:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
@@ -7740,17 +7712,6 @@ packages:
engines: {node: '>=10'}
dev: true
/yorkie@2.0.0:
resolution: {integrity: sha512-jcKpkthap6x63MB4TxwCyuIGkV0oYP/YRyuQU5UO0Yz/E/ZAu+653/uov+phdmO54n6BcvFRyyt0RRrWdN2mpw==}
engines: {node: '>=4'}
requiresBuild: true
dependencies:
execa: 0.8.0
is-ci: 1.2.1
normalize-path: 1.0.0
strip-indent: 2.0.0
dev: true
/zwitch@1.0.5:
resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==}
dev: true