Skip to content

Commit

Permalink
Merge pull request #624 from feross/timoxley-patch-1
Browse files Browse the repository at this point in the history
Add example of usage within npm scripts
  • Loading branch information
feross authored Sep 14, 2016
2 parents 39ded11 + 0b2270e commit 8cd51d9
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ in JavaScript Standard Style, or check out some of

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

### What you might do if you're clever

1. Add it to `package.json`

```json
{
"name": "my-cool-package",
"devDependencies": {
"standard": "*"
},
"scripts": {
"test": "standard && node my-tests.js"
}
}
```

2. Check style automatically when you run `npm test`

```
$ npm test
Error: Use JavaScript Standard Style
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
```

3. Never give style feedback on a pull request again!



### Badge

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

### What you might do if you're clever

1. Add it to `package.json`

```json
{
"name": "my-cool-package",
"devDependencies": {
"standard": "*"
},
"scripts": {
"test": "standard && node my-tests.js"
}
}
```

2. Check style automatically when you run `npm test`

```
$ npm test
Error: Use JavaScript Standard Style
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
```

3. Never give style feedback on a pull request again!

## FAQ

### Why would I use JavaScript Standard Style?
Expand Down

0 comments on commit 8cd51d9

Please # to comment.