Permalink
Browse files

lint: use standard style

  • Loading branch information...
1 parent fb378a8 commit 2492832be960b5bc06397e3368bae6d2dafab114 @dougwilson dougwilson committed May 18, 2016
Showing with 188 additions and 177 deletions.
  1. +2 −0 .eslintignore
  2. +3 −0 .eslintrc
  3. +3 −2 .travis.yml
  4. +17 −17 index.js
  5. +5 −0 package.json
  6. +5 −0 test/.eslintrc
  7. +153 −158 test/test.js
View
@@ -0,0 +1,2 @@
+coverage
+node_modules
View
@@ -0,0 +1,3 @@
+{
+ "extends": "standard"
+}
View
@@ -16,8 +16,8 @@ cache:
- node_modules
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 $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard istanbul"
+ - "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard istanbul"
# Update Node.js modules
- "test ! -d node_modules || npm prune"
@@ -26,5 +26,6 @@ script:
# Run test script, depending on istanbul install
- "test ! -z $(npm -ps ls istanbul) || npm test"
- "test -z $(npm -ps ls istanbul) || npm run-script test-travis"
+ - "test -z $(npm -ps ls eslint ) || npm run-script lint"
after_script:
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
View
@@ -11,8 +11,8 @@
*/
var setPrototypeOf = require('setprototypeof')
-var statuses = require('statuses');
-var inherits = require('inherits');
+var statuses = require('statuses')
+var inherits = require('inherits')
/**
* Module exports.
@@ -34,27 +34,27 @@ populateConstructorExports(module.exports, statuses.codes, module.exports.HttpEr
function createError () {
// so much arity going on ~_~
- var err;
- var msg;
- var status = 500;
- var props = {};
+ var err
+ var msg
+ var status = 500
+ var props = {}
for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
+ var arg = arguments[i]
if (arg instanceof Error) {
- err = arg;
- status = err.status || err.statusCode || status;
- continue;
+ err = arg
+ status = err.status || err.statusCode || status
+ continue
}
switch (typeof arg) {
case 'string':
- msg = arg;
- break;
+ msg = arg
+ break
case 'number':
- status = arg;
- break;
+ status = arg
+ break
case 'object':
- props = arg;
- break;
+ props = arg
+ break
}
}
@@ -85,7 +85,7 @@ function createError () {
}
}
- return err;
+ return err
}
/**
View
@@ -15,13 +15,18 @@
"statuses": ">= 1.3.0 < 2"
},
"devDependencies": {
+ "eslint": "2.10.2",
+ "eslint-config-standard": "5.3.1",
+ "eslint-plugin-promise": "1.1.0",
+ "eslint-plugin-standard": "1.3.2",
"istanbul": "0.4.3",
"mocha": "1.21.5"
},
"engines": {
"node": ">= 0.6"
},
"scripts": {
+ "lint": "eslint **/*.js",
"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"
View
@@ -0,0 +1,5 @@
+{
+ "env": {
+ "mocha": true
+ }
+}
Oops, something went wrong.

0 comments on commit 2492832

Please sign in to comment.