Skip to content

Commit 22b9718

Browse files
committed
add husky
1 parent d82a220 commit 22b9718

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
max_line_length = 80
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
max_line_length = 0
15+
trim_trailing_whitespace = false

.eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
"react/prop-types": 0,
3030
"semi": [2, "never"]
3131
}
32-
}
32+
}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"test": "jest",
88
"prettier": "prettier --write --single-quote --no-semi --trailing-comma es5 --print-width 80 \"app/**/*.js\"",
99
"lint": "eslint app",
10-
"format": "yarn prettier && yarn lint -- --fix"
10+
"format": "yarn prettier && yarn lint -- --fix",
11+
"precommit": "yarn format"
1112
},
1213
"dependencies": {
1314
"dva": "1.3.0-beta.4",
@@ -29,6 +30,7 @@
2930
"eslint-plugin-jsx-a11y": "^5.0.3",
3031
"eslint-plugin-prettier": "^2.1.1",
3132
"eslint-plugin-react": "^7.0.1",
33+
"husky": "^0.13.4",
3234
"jest": "^20.0.4",
3335
"prettier": "^1.4.4",
3436
"react-test-renderer": "^15.5.4"

yarn.lock

+18-1
Original file line numberDiff line numberDiff line change
@@ -1961,6 +1961,10 @@ [email protected]:
19611961
on-finished "~2.3.0"
19621962
unpipe "~1.0.0"
19631963

1964+
find-parent-dir@^0.3.0:
1965+
version "0.3.0"
1966+
resolved "http://registry.npm.taobao.org/find-parent-dir/download/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54"
1967+
19641968
find-up@^1.0.0:
19651969
version "1.1.2"
19661970
resolved "http://registry.npm.taobao.org/find-up/download/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -2265,6 +2269,15 @@ http-signature@~1.1.0:
22652269
jsprim "^1.2.2"
22662270
sshpk "^1.7.0"
22672271

2272+
husky@^0.13.4:
2273+
version "0.13.4"
2274+
resolved "http://registry.npm.taobao.org/husky/download/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407"
2275+
dependencies:
2276+
chalk "^1.1.3"
2277+
find-parent-dir "^0.3.0"
2278+
is-ci "^1.0.9"
2279+
normalize-path "^1.0.0"
2280+
22682281
22692282
version "0.4.11"
22702283
resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.11.tgz#2ecb42fd294744922209a2e7c404dac8793d8ade"
@@ -2350,7 +2363,7 @@ is-callable@^1.1.1, is-callable@^1.1.3:
23502363
version "1.1.3"
23512364
resolved "http://registry.npm.taobao.org/is-callable/download/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
23522365

2353-
is-ci@^1.0.10:
2366+
is-ci@^1.0.10, is-ci@^1.0.9:
23542367
version "1.0.10"
23552368
resolved "http://registry.npm.taobao.org/is-ci/download/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e"
23562369
dependencies:
@@ -3302,6 +3315,10 @@ normalize-package-data@^2.3.2:
33023315
semver "2 || 3 || 4 || 5"
33033316
validate-npm-package-license "^3.0.1"
33043317

3318+
normalize-path@^1.0.0:
3319+
version "1.0.0"
3320+
resolved "http://registry.npm.taobao.org/normalize-path/download/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
3321+
33053322
normalize-path@^2.0.1:
33063323
version "2.0.1"
33073324
resolved "http://registry.npm.taobao.org/normalize-path/download/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"

0 commit comments

Comments
 (0)