Skip to content

Commit 9927511

Browse files
authored
Merge pull request #757 from glints-dev/feature/pre-commit-hook
add pre-commit hook
2 parents 23fe2d6 + 14ba17c commit 9927511

3 files changed

Lines changed: 251 additions & 10 deletions

File tree

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint-staged

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"storybook": "start-storybook -p 6006",
2727
"storybook:build": "rm -rf .out && npm run storybook:build:assets && npm run build:icon && npm run build:next:icon && build-storybook -o .out -s dist/public",
2828
"storybook:build:test": "rm -rf storybook-static && npm run storybook:build:assets && npm run build:icon && npm run build:next:icon && build-storybook -o storybook-static -s dist/public",
29-
"storybook:build:assets": "webpack"
29+
"storybook:build:assets": "webpack",
30+
"prepare": "husky install"
3031
},
3132
"author": "Glints",
3233
"license": "MIT",
@@ -102,9 +103,11 @@
102103
"fork-ts-checker-webpack-plugin": "^1.3.4",
103104
"generate-changelog": "^1.7.1",
104105
"glob": "^7.1.6",
106+
"husky": "^8.0.0",
105107
"identity-obj-proxy": "^3.0.0",
106108
"jest": "^27.5.1",
107109
"jest-styled-components": "^7.0.2",
110+
"lint-staged": "^13.1.2",
108111
"lodash": "^4.17.21",
109112
"lodash-es": "^4.17.21",
110113
"prettier": "^2.8.1",
@@ -162,5 +165,11 @@
162165
"immer": "^9.0.6",
163166
"@types/react": "^17.0.37",
164167
"@types/react-dom": "^17.0.11"
168+
},
169+
"lint-staged": {
170+
"**/*.{ts,tsx}": [
171+
"yarn lint",
172+
"prettier --write"
173+
]
165174
}
166175
}

0 commit comments

Comments
 (0)