Skip to content

Commit a7731d8

Browse files
committed
Configure pre-commit hook with lint-staged
1 parent 42ecb44 commit a7731d8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.husky/pre-commit

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run precommit

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"build": "react-scripts build",
3434
"test": "react-scripts test",
3535
"eject": "react-scripts eject",
36-
"prepare": "husky install"
36+
"prepare": "husky install",
37+
"precommit": "lint-staged"
3738
},
3839
"eslintConfig": {
3940
"extends": [
@@ -63,5 +64,8 @@
6364
"prettier-plugin-tailwindcss": "^0.5.3",
6465
"source-map-loader": "^4.0.1",
6566
"tailwindcss": "^3.3.3"
67+
},
68+
"lint-staged": {
69+
"*.{md,yml,json,html,css,js,jsx,ts,tsx}": "prettier --write"
6670
}
6771
}

0 commit comments

Comments
 (0)