Skip to content

Commit

Permalink
chore: improved husky setup
Browse files Browse the repository at this point in the history
  • Loading branch information
marabesi committed Oct 16, 2021
1 parent 4be83bc commit 6ac63e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

npm run test:all
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.14",
"wait-on": "^6.0.0"
},
"postinstall": "electron-builder install-app-deps",
"postinstall": "electron-builder install-app-deps && husky install",
"scripts": {
"start": "BROWSER=none craco start",
"build": "craco build",
"test": "craco test src/",
"test:all": "CYPRESS_BASE_URL=http://localhost:3000 cypress run && craco test src/",
"test:all": "CYPRESS_BASE_URL=http://localhost:3000 cypress run && npm run test -- --watchAll=false",
"eject": "craco eject",
"dev": "concurrently -k \"BROWSER=none npm start\" \"npm:electron\"",
"setup": "npm run build && cp package.json ./build",
Expand All @@ -60,7 +60,10 @@
"plugin:react/jsx-runtime"
],
"rules": {
"semi": [2, "always"]
"semi": [
2,
"always"
]
}
},
"browserslist": {
Expand All @@ -82,10 +85,5 @@
"transformIgnorePatterns": [
"<rootDir>/node_modules/?!(.*)"
]
},
"husky": {
"hooks": {
"pre-push": "npm run lint && npm run test:all"
}
}
}

0 comments on commit 6ac63e9

Please sign in to comment.