This repository was archived by the owner on Aug 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +670
-97
lines changed Expand file tree Collapse file tree 3 files changed +670
-97
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ script:
35
35
# Output useful info for debugging.
36
36
- node --version
37
37
- yarn --version
38
+ # Make sure prettier has ran on all files.
39
+ - yarn format-check
38
40
# Make sure we can actually build the examples.
39
41
- yarn run build-examples
40
42
# Run tests
Original file line number Diff line number Diff line change 34
34
"examples" : " webpack-dev-server --config examples/webpack.config.js --no-info --content-base examples" ,
35
35
"examples-server" : " babel-node examples/server.js" ,
36
36
"flow" : " flow check" ,
37
+ "format" : " prettier --write \" {src,examples}/**/*.js\" " ,
38
+ "format-check" : " prettier --list-different \" {src,examples}/**/*.js\" " ,
37
39
"eslint" : " eslint ." ,
38
40
"fixlint" : " npm run eslint -- --fix" ,
39
41
"lint" : " builder concurrent --buffer eslint flow" ,
63
65
"babel-preset-stage-1" : " ^6.22.0" ,
64
66
"builder" : " ^3.2.3" ,
65
67
"exenv" : " ^1.2.1" ,
68
+ "husky" : " ^1.2.0" ,
66
69
"inline-style-prefixer" : " ^4.0.0" ,
70
+ "lint-staged" : " ^8.1.0" ,
67
71
"prop-types" : " ^15.5.8" ,
68
72
"publishr" : " ^1.0.0" ,
69
73
"rimraf" : " ^2.6.1" ,
105
109
"node-libs-browser" : " ^2.0.0" ,
106
110
"nodemon" : " ^1.11.0" ,
107
111
"object-assign" : " ^4.1.1" ,
108
- "prettier" : " ^0.22.0 " ,
112
+ "prettier" : " ^1.15.3 " ,
109
113
"react" : " ^16.2.0" ,
110
114
"react-dom" : " ^16.2.0" ,
111
115
"react-test-renderer" : " ^16.2.0" ,
127
131
"scripts" : {
128
132
"postinstall" : " "
129
133
}
134
+ },
135
+ "husky" : {
136
+ "hooks" : {
137
+ "pre-commit" : " lint-staged"
138
+ }
139
+ },
140
+ "lint-staged" : {
141
+ "*.js" : [
142
+ " yarn format" ,
143
+ " yarn fixlint" ,
144
+ " git add"
145
+ ]
130
146
}
131
147
}
You can’t perform that action at this time.
0 commit comments