Skip to content

Commit

Permalink
chore: use husky
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL committed May 8, 2023
1 parent 4069ce7 commit c2bb5e4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 54 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# folders
.devcontainer
.github
.husky
.idea
.vscode
Dockerfile*
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.env
.eslintcache
.idea
.log
.now
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format:staged
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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"
Expand Down
57 changes: 9 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2bb5e4

Please sign in to comment.