Skip to content

Commit

Permalink
Merge pull request #5 from elliotttf/eslint
Browse files Browse the repository at this point in the history
Switch to eslint
  • Loading branch information
elliotttf committed Oct 7, 2015
2 parents 703173a + eedc409 commit 27aeaf1
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 78 deletions.
79 changes: 79 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"env": {
"browser": false,
"node": true
},
"rules": {
"block-scoped-var": 2,
"camelcase": 2,
"comma-dangle": [2, "never"],
"comma-dangle": 2,
"complexity": 2,
"consistent-return": 2,
"curly": 2,
"default-case": 2,
"dot-location": [2, "property"],
"dot-notation": 2,
"eol-last": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-else-return": 2,
"no-empty": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-extra-bind": 1,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"semi": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sparse-arrays": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"no-unreachable": 2,
"no-unused-expressions": 0,
"no-unused-vars": 2,
"no-use-before-define": [2, "nofunc"],
"no-warning-comments": 1,
"quotes": [2, "single"],
"radix": 2,
"space-after-keywords": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-infix-ops": 2,
"object-curly-spacing": [2, "never"],
"array-bracket-spacing": [2, "never"],
"space-unary-ops": [1, { "words": true, "nonwords": false }],
"strict": [1, "never"],
"use-isnan": 2,
"valid-jsdoc": [2, {"requireReturn": false}],
"valid-typeof": 2,
"vars-on-top": 0,
"wrap-iife": 2,
"yoda": 2
}
}
67 changes: 0 additions & 67 deletions .jshintrc

This file was deleted.

9 changes: 4 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ var coveralls = require('gulp-coveralls');
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
var nodeunit = require('gulp-nodeunit');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var eslint = require('gulp-eslint');

gulp.task('lint', function () {
return gulp.src([
'./lib/**/*.js',
'./test/**/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter(stylish))
.pipe(jshint.reporter('fail'));
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});

gulp.task('test', [ 'lint' ], function (cb) {
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-conditional-middleware",
"version": "1.0.3",
"version": "1.0.4",
"description": "Allow express middlewares to be overridden based on a condition.",
"repository": "https://github.com/elliotttf/express-conditional-middleware",
"main": "lib/conditional.js",
Expand All @@ -13,10 +13,9 @@
"ghooks": "0.3.2",
"gulp": "3.9.0",
"gulp-coveralls": "0.1.4",
"gulp-eslint": "1.0.0",
"gulp-istanbul": "0.8.1",
"gulp-jshint": "1.11.2",
"gulp-nodeunit": "0.0.5",
"jshint-stylish": "1.0.2"
"gulp-nodeunit": "0.0.5"
},
"config": {
"ghooks": {
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
}
);

middleware({ working: true }, {}, function () {
middleware({working: true}, {}, function () {
test.done();
});

Expand All @@ -47,7 +47,7 @@ module.exports = {
}
);

middleware({ working: false }, {}, function () {
middleware({working: false}, {}, function () {
test.ok(true, 'Conditional function returned false.');
test.done();
});
Expand Down

0 comments on commit 27aeaf1

Please sign in to comment.