Skip to content

Commit

Permalink
Update setup for husky at version 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Rusch authored and YvesRijckaert committed Sep 27, 2021
1 parent 5f7c9bb commit 6df8671
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 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"

./node_modules/.bin/lint-staged --config ./.lintstagedrc
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
5 changes: 5 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.js": [
"eslint --fix"
]
}
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"node": ">=10"
},
"scripts": {
"prepare": "husky install",
"lint": "eslint . --ext .js",
"test": "jest --verbose",
"release": "np"
Expand All @@ -25,17 +26,6 @@
"author": "EdenSpiekermann",
"license": "MIT",
"homepage": "https://github.com/edenspiekermann/espi-eslint-config",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm run test"
}
},
"lint-staged": {
"*.js,!__fixtures/**/*.js": [
"eslint --fix"
]
},
"np": {
"tests": "npm run lint"
},
Expand Down

0 comments on commit 6df8671

Please sign in to comment.