Skip to content

Commit fb45409

Browse files
committed
Installation and configuration of husky
1 parent 22e700b commit fb45409

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.husky/pre-push

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
#npm run test

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pages
99
styles
1010
.next
1111
.rollup.cache
12+
.husky
1213
## Files
1314
babel.config.json
1415
tsconfig.json

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"code-style:fix": "npm run pret:fix && npm run pret:fix",
1919
"build": "npm run code-style && npm run clean && rollup -c",
2020
"pub": "npm run build && npm publish",
21-
"dev": "next dev -p 8888"
21+
"dev": "next dev -p 8888",
22+
"prepare": "husky install"
2223
},
2324
"repository": {
2425
"type": "git",
@@ -58,7 +59,8 @@
5859
"eslint-plugin-prettier": "^4.2.1",
5960
"eslint-plugin-react": "^7.31.11",
6061
"eslint-plugin-react-hooks": "^4.6.0",
61-
"husky": "^8.0.3",
62+
"husky": "^8.0.0",
63+
"lint-staged": "^13.2.3",
6264
"next": "^13.1.1",
6365
"postcss": "^8.4.19",
6466
"prettier": "^2.8.0",
@@ -68,5 +70,9 @@
6870
"tailwindcss": "^3.2.4",
6971
"tslib": "^2.4.0",
7072
"typescript": "^4.8.4"
73+
},
74+
"lint-staged": {
75+
"*.{ts,tsx}": ["npm run lint"],
76+
"*.{ts,tsx,css,scss,md}": ["npm run pret:fix"]
7177
}
7278
}

0 commit comments

Comments
 (0)