Skip to content

Commit 98c52c1

Browse files
committed
feat: added pre-commit hook for prettier
1 parent e550e42 commit 98c52c1

File tree

4 files changed

+444
-7
lines changed

4 files changed

+444
-7
lines changed

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

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

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
{
22
"devDependencies": {
33
"@vuepress/plugin-pwa": "^1.5.4",
4+
"husky": "^6.0.0",
5+
"lint-staged": "^10.5.4",
6+
"prettier": "^2.2.1",
47
"sass": "^1.32.0",
58
"sass-loader": "^8.0.2",
69
"vuepress": "^1.5.4"
710
},
811
"scripts": {
912
"dev": "yarn serve",
1013
"serve": "vuepress dev src",
11-
"build": "vuepress build src"
14+
"build": "vuepress build src",
15+
"prepare": "husky install"
1216
},
1317
"dependencies": {
1418
"@docsearch/css": "^1.0.0-alpha.27",
@@ -17,5 +21,8 @@
1721
"axios": "^0.21.1",
1822
"intersection-observer": "^0.11.0",
1923
"showdown": "^1.9.1"
24+
},
25+
"lint-staged": {
26+
"*": "prettier --check --write --ignore-unknown"
2027
}
2128
}

0 commit comments

Comments
 (0)