Skip to content

Commit 8cd51d9

Browse files
authored
Merge pull request #624 from feross/timoxley-patch-1
Add example of usage within npm scripts
2 parents 39ded11 + 0b2270e commit 8cd51d9

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

README.md

+29-27
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ in JavaScript Standard Style, or check out some of
6565

6666
- [Install](#install)
6767
- [Usage](#usage)
68+
- [What you might do if you're clever](#what-you-might-do-if-youre-clever)
6869
- [Badge](#badge)
6970
- [Text editor plugins](#text-editor-plugins)
70-
- [What you might do if you're clever](#what-you-might-do-if-youre-clever)
7171
- [FAQ](#faq)
7272
- [Why would I use JavaScript Standard Style?](#why-would-i-use-javascript-standard-style)
7373
- [I disagree with rule X, can you change it?](#i-disagree-with-rule-x-can-you-change-it)
@@ -132,6 +132,34 @@ $ standard "src/util/**/*.js" "test/**/*.js"
132132
**Note:** by default `standard` will look for all files matching the patterns:
133133
`**/*.js`, `**/*.jsx`.
134134

135+
### What you might do if you're clever
136+
137+
1. Add it to `package.json`
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+
2. Check style automatically when you run `npm test`
152+
153+
```
154+
$ npm test
155+
Error: Use JavaScript Standard Style
156+
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
157+
```
158+
159+
3. Never give style feedback on a pull request again!
160+
161+
162+
135163
### Badge
136164

137165
Use this in one of your projects? Include one of these badges in your readme to
@@ -231,32 +259,6 @@ Both WebStorm and PhpStorm can be [configured for Standard Style][webstorm-2].
231259
[webstorm-1]: https://www.jetbrains.com/webstorm/
232260
[webstorm-2]: https://github.com/feross/standard/blob/master/docs/webstorm.md
233261

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-
260262
## FAQ
261263

262264
### Why would I use JavaScript Standard Style?

0 commit comments

Comments
 (0)