Skip to content

Commit f28c569

Browse files
zhangxiaoshangvanoneang
authored andcommitted
style: 使用lint-staged禁止提交未通过eslint校验的代码 (#255)
1 parent 4e256ac commit f28c569

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"fs-extra": "^8.1.0",
5555
"inquirer": "^6.5.0",
5656
"js-yaml": "^3.13.1",
57+
"lint-staged": "^10.0.0-1",
5758
"node-sass": "^4.12.0",
5859
"sass-loader": "^7.1.0",
5960
"semver": "^6.2.0",
@@ -77,5 +78,14 @@
7778
"commitizen": {
7879
"path": "./node_modules/cz-conventional-changelog"
7980
}
81+
},
82+
"gitHooks": {
83+
"pre-commit": "lint-staged"
84+
},
85+
"lint-staged": {
86+
"*.{js,vue}": [
87+
"vue-cli-service lint",
88+
"git add"
89+
]
8090
}
8191
}

0 commit comments

Comments
 (0)