diff --git a/README.md b/README.md index 1a92eab..8613670 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,17 @@ Assert with status codes. Like ctx.throw() in Koa, but with a guard. ## Example ```js -var assert = require('http-assert'); -var ok = require('assert'); +var assert = require('http-assert') +var ok = require('assert') + +var username = 'foobar' // username from request try { - assert(username == 'fjodor', 401, 'authentication failed'); + assert(username === 'fjodor', 401, 'authentication failed') } catch (err) { - ok(err.status == 401); - ok(err.message == 'authentication failed'); - ok(err.expose); + ok(err.status === 401) + ok(err.message === 'authentication failed') + ok(err.expose) } ``` diff --git a/package.json b/package.json index cc9c947..c02eddf 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "eslint": "5.5.0", "eslint-config-standard": "12.0.0", "eslint-plugin-import": "2.14.0", + "eslint-plugin-markdown": "1.0.0-beta.6", "eslint-plugin-node": "7.0.1", "eslint-plugin-promise": "4.0.0", "eslint-plugin-standard": "4.0.0", @@ -30,7 +31,7 @@ "node": ">= 0.8" }, "scripts": { - "lint": "eslint .", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"