Skip to content

Commit

Permalink
使用 husky 强制代码提交前必须通过测试
Browse files Browse the repository at this point in the history
  • Loading branch information
modood committed May 31, 2017
1 parent 43999f6 commit cc78047
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ module.exports = {
root: true,
extends: 'standard',
globals: {
'describe': true,
'it': true,
'before': true,
'beforeEach': true,
'after': true,
'afterEach': true,
'context': true,
'expect': true
// mocha BDD
describe: true,
context: true,
it: true,
specify: true,
before: true,
beforeEach: true,
after: true,
afterEach: true
}
}

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "中华人民共和国行政区划:省份、城市、区县、乡镇(街道)",
"main": "index.js",
"scripts": {
"test": "mocha -t 5000"
"test": "eslint . && mocha -t 5000",
"precommit": "npm test"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,6 +34,13 @@
"iconv-lite": "^0.4.15"
},
"devDependencies": {
"eslint": "^3.19.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"husky": "^0.13.4",
"mocha": "^3.1.0"
},
"license": "MIT",
Expand Down

0 comments on commit cc78047

Please # to comment.