Permalink
Browse files

lint: use standard style in readme

  • Loading branch information...
1 parent a90858e commit 1df3c34cd867a1fe01461454b68c2b1b181dbfc3 @dougwilson dougwilson committed Nov 17, 2016
Showing with 15 additions and 8 deletions.
  1. +1 −1 .travis.yml
  2. +11 −5 README.md
  3. +3 −2 package.json
View
@@ -19,7 +19,7 @@ before_install:
# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul"
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- - "test $(echo $TRAVIS_NODE_VERSION | cut -d'.' -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard"
+ - "test $(echo $TRAVIS_NODE_VERSION | cut -d'.' -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-markdown eslint-plugin-promise eslint-plugin-standard"
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
View
@@ -21,11 +21,13 @@ $ npm install http-errors
## Example
```js
-var createError = require('http-errors');
+var createError = require('http-errors')
+var express = require('express')
+var app = express()
app.use(function (req, res, next) {
- if (!req.user) return next(createError(401, 'Please login to view this page.'));
- next();
+ if (!req.user) return next(createError(401, 'Please login to view this page.'))
+ next()
})
```
@@ -43,8 +45,10 @@ All errors inherit from JavaScript `Error` and the exported `createError.HttpErr
### createError([status], [message], [properties])
+<!-- eslint-disable no-undef, no-unused-vars -->
+
```js
-var err = createError(404, 'This video does not exist!');
+var err = createError(404, 'This video does not exist!')
```
- `status: 500` - the status code as a number
@@ -53,8 +57,10 @@ var err = createError(404, 'This video does not exist!');
### new createError\[code || name\](\[msg]\))
+<!-- eslint-disable no-undef, no-unused-vars -->
+
```js
-var err = new createError.NotFound();
+var err = new createError.NotFound()
```
- `code` - the status code as a number
View
@@ -15,8 +15,9 @@
"statuses": ">= 1.3.1 < 2"
},
"devDependencies": {
- "eslint": "3.10.0",
+ "eslint": "3.10.2",
"eslint-config-standard": "6.2.1",
+ "eslint-plugin-markdown": "1.0.0-beta.3",
"eslint-plugin-promise": "3.3.2",
"eslint-plugin-standard": "2.0.1",
"istanbul": "0.4.5",
@@ -26,7 +27,7 @@
"node": ">= 0.6"
},
"scripts": {
- "lint": "eslint .",
+ "lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"

0 comments on commit 1df3c34

Please sign in to comment.