Skip to content

Commit 11ae2ad

Browse files
authored
chore: add husky and lint-staged (#1062)
1 parent 3927d01 commit 11ae2ad

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@
3232
"scripts": {
3333
"start": "dumi dev",
3434
"build": "dumi build",
35-
"prepare": "dumi setup",
35+
"prepare": "husky && dumi setup",
3636
"compile": "father build && lessc assets/index.less assets/index.css",
3737
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3838
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
3939
"test": "rc-test",
4040
"tsc": "tsc --noEmit",
4141
"now-build": "npm run build"
4242
},
43+
"lint-staged": {
44+
"*": "prettier --write --ignore-unknown"
45+
},
4346
"peerDependencies": {
4447
"react": "*",
4548
"react-dom": "*"
@@ -67,8 +70,10 @@
6770
"eslint-plugin-jest": "^27.6.0",
6871
"eslint-plugin-unicorn": "^50.0.1",
6972
"father": "^4.0.0",
73+
"husky": "^9.1.5",
7074
"jsonp": "^0.2.1",
7175
"less": "^4.2.0",
76+
"lint-staged": "^15.2.9",
7277
"np": "^9.2.0",
7378
"prettier": "^3.1.1",
7479
"querystring": "^0.2.1",

0 commit comments

Comments
 (0)