@@ -65,9 +65,9 @@ in JavaScript Standard Style, or check out some of
65
65
66
66
- [ Install] ( #install )
67
67
- [ Usage] ( #usage )
68
+ - [ Runnning standard with npm test] ( #runnning-standard-with-npm-test )
68
69
- [ Badge] ( #badge )
69
70
- [ Text editor plugins] ( #text-editor-plugins )
70
- - [ What you might do if you're clever] ( #what-you-might-do-if-youre-clever )
71
71
- [ FAQ] ( #faq )
72
72
- [ Why would I use JavaScript Standard Style?] ( #why-would-i-use-javascript-standard-style )
73
73
- [ I disagree with rule X, can you change it?] ( #i-disagree-with-rule-x-can-you-change-it )
@@ -132,6 +132,32 @@ $ standard "src/util/**/*.js" "test/**/*.js"
132
132
** Note:** by default ` standard ` will look for all files matching the patterns:
133
133
` **/*.js ` , ` **/*.jsx ` .
134
134
135
+ ### Runnning standard with npm test
136
+
137
+ Below is a simple example of running standard before running tests:
138
+
139
+ ``` json
140
+ {
141
+ "name" : " my-cool-package" ,
142
+ "devDependencies" : {
143
+ "standard" : " *"
144
+ },
145
+ "scripts" : {
146
+ "test" : " standard && node my-tests.js"
147
+ }
148
+ }
149
+ ```
150
+
151
+ Style will now be checked automatically when you run ` npm test ` . Never give style feedback on a pull request again!
152
+
153
+ ```
154
+ $ npm test
155
+ Error: Use JavaScript Standard Style
156
+ lib/torrent.js:950:11: Expected '===' and instead saw '=='.
157
+ ```
158
+
159
+
160
+
135
161
### Badge
136
162
137
163
Use this in one of your projects? Include one of these badges in your readme to
@@ -231,32 +257,6 @@ Both WebStorm and PhpStorm can be [configured for Standard Style][webstorm-2].
231
257
[ webstorm-1 ] : https://www.jetbrains.com/webstorm/
232
258
[ webstorm-2 ] : https://github.com/feross/standard/blob/master/docs/webstorm.md
233
259
234
- ### What you might do if you're clever
235
-
236
- 1 . Add it to ` package.json `
237
-
238
- ``` json
239
- {
240
- "name" : " my-cool-package" ,
241
- "devDependencies" : {
242
- "standard" : " *"
243
- },
244
- "scripts" : {
245
- "test" : " standard && node my-tests.js"
246
- }
247
- }
248
- ```
249
-
250
- 2 . Check style automatically when you run ` npm test `
251
-
252
- ```
253
- $ npm test
254
- Error: Use JavaScript Standard Style
255
- lib/torrent.js:950:11: Expected '===' and instead saw '=='.
256
- ```
257
-
258
- 3 . Never give style feedback on a pull request again!
259
-
260
260
## FAQ
261
261
262
262
### Why would I use JavaScript Standard Style?
0 commit comments