Skip to content

Commit 7a9cb71

Browse files
committed
feature. Apply Husky
1 parent 9a64d19 commit 7a9cb71

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint-staged

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"storybook": "storybook dev -p 6006",
2525
"build-storybook": "storybook build",
2626
"test": "jest --watch",
27-
"test-all": "jest --watchAll"
27+
"test-all": "jest --watchAll",
28+
"lint-staged": "lint-staged",
29+
"prepare": "husky"
2830
},
2931
"devDependencies": {
3032
"@babel/core": "^7.22.10",
@@ -68,8 +70,10 @@
6870
"fs-extra": "^11.1.1",
6971
"glob": "^11.0.0",
7072
"globals": "^16.0.0",
73+
"husky": "^9.1.7",
7174
"jest": "^29.7.0",
7275
"jest-environment-jsdom": "^29.7.0",
76+
"lint-staged": "^15.5.1",
7377
"prettier": "^3.5.3",
7478
"react": "^18.3.1",
7579
"react-dom": "^18.3.1",
@@ -95,6 +99,12 @@
9599
"react-toastify": "^11.0.3",
96100
"react-tooltip": "^5.21.1"
97101
},
102+
"lint-staged": {
103+
"*.{js,jsx,ts,tsx}": [
104+
"prettier --write",
105+
"eslint --fix"
106+
]
107+
},
98108
"repository": {
99109
"type": "git",
100110
"url": "git+https://github.com/openinfradev/tksui-components.git"

0 commit comments

Comments
 (0)