Skip to content

Commit

Permalink
chore: use husky with lint staged (#21)
Browse files Browse the repository at this point in the history
* chore(hook): use lint-staged for fixing format

* chore(husky): use scripts to make pre-commit explicit
  • Loading branch information
crondinini authored Nov 28, 2021
1 parent 56f1cad commit ccc9128
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn format
yarn pre-commit-hook
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"test:coverage": "jest --coverage --colors --maxWorkers=2",
"hygen": "hygen",
"component:new": "hygen component with-prompt",
"prepare": "husky install"
"prepare": "husky install",
"pre-commit-hook": "yarn lint-staged"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand Down Expand Up @@ -62,6 +63,7 @@
"hygen": "^6.0.4",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"lint-staged": "^12.1.2",
"prettier": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand All @@ -75,5 +77,8 @@
"ts-loader": "^8.0.11",
"typescript": "^4.1.0",
"webpack": "^4.42.1"
},
"lint-staged": {
"*.{ts,tsx,json,js,jsx}": "yarn format"
}
}
Loading

0 comments on commit ccc9128

Please sign in to comment.