Skip to content

Commit

Permalink
feat: add pre commit hook & update husky
Browse files Browse the repository at this point in the history
  • Loading branch information
Yedidyar committed Sep 1, 2023
1 parent d74cc74 commit cab297e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
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"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint && yarn typeCheck
16 changes: 2 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,19 @@
"prebuild": "cd ui-react && yarn && yarn build",
"postinstall": "electron-builder install-app-deps && cd ui-react && yarn && cd ..",
"postuninstall": "electron-builder install-app-deps",
"prepare": "node scripts/copyCategoryCalculationScript.js",
"prepare": "node scripts/copyCategoryCalculationScript.js && husky install",
"lint:backend": "eslint -f ./node_modules/eslint-friendly-formatter src test",
"lint:react": "cd ui-react && yarn lint",
"lint": "yarn lint:backend && yarn lint:react",
"lint:fix": "yarn lint --fix && yarn lint:react --fix",
"format": "prettier . --write",
"typeCheck": "tsc --noEmit",
"unit": "vue-cli-service test:unit",
"e2e": "vue-cli-service test:unit --config='test/e2e/jest.e2e.config.js'",
"test": "yarn unit && yarn e2e"
},
"husky": {
"hooks": {
"pre-push": "yarn lint && yarn typeCheck"
}
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
},






"dependencies": {
"@electron/remote": "^2.0.8",
"@sentry/electron": "^2.5.0",
Expand Down Expand Up @@ -120,7 +108,7 @@
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.8.0",
"husky": "^4.2.5",
"husky": "^8.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.4.2",
"jest-circus": "^26.4.2",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9081,6 +9081,11 @@ husky@^4.2.5:
slash "^3.0.0"
which-pm-runs "^1.0.0"

husky@^8.0.0:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

iconv-corefoundation@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz#31065e6ab2c9272154c8b0821151e2c88f1b002a"
Expand Down

0 comments on commit cab297e

Please sign in to comment.