module.exports = function( gulp, plugins ) {
    var watching = false;
    var paths = [
        // JS files to watch and lint
        'tasks/*.js',
        'src/scripts/**/*.js',
        '!src/scripts/vendor/**/*'
    ];


    gulp.task( 'lint:js:jscs', 'lints all javascript files with jscs', function() {
        return gulp
            .src( paths )
            .pipe( plugins.jscs() )
            .pipe( plugins.jscsStylish() );
    } );


    gulp.task( 'lint:js:jshint', 'lints all javascript files with jshint', function() {
        return gulp
            .src( paths )
            .pipe( plugins.jshint() )
            .pipe( plugins.jshint.reporter( 'jshint-stylish' ) )
            .pipe( plugins.if( !watching, plugins.jshint.reporter( 'fail' ) ) );
    } );


    gulp.task( 'lint:js', 'lints all javascript files with both jscs and jshint', [
        'lint:js:jshint',
        'lint:js:jscs'
    ] );


    gulp.task( 'watch:js', 'waits for javascript files to change, then lints them ', function() {
        watching = true;

        return gulp.watch( paths, [ 'lint:js' ] );
    } );
};

@@ -42,34 +42,8 @@
 ) %7B%0A
-    var watching = false;%0A
     
@@ -214,21 +214,16 @@
 'lint:js
-:jscs
 ', 'lint
@@ -250,20 +250,36 @@
 es with 
-jscs
+both jscs and jshint
 ', funct
@@ -361,18 +361,20 @@
 ugins.js
-cs
+hint
 () )%0A   
@@ -405,199 +405,117 @@
 jscs
-Stylish
 () )
-;
 %0A
+ 
     
-%7D );%0A%0A%0A    gulp.task( 'lint:js:jshint', 'lints all javascript files with jshint', function() %7B%0A        return gulp%0A            .src( paths )%0A            .pipe( plugins.jshint
+       .on( 'error', function() %7B %7D )%0A            .pipe( plugins.jscsStylish.combineWithHintResults
 () )
@@ -602,31 +602,8 @@
 ipe(
- plugins.if( !watching,
  plu
@@ -632,18 +632,16 @@
 'fail' )
- )
  );%0A    
@@ -651,152 +651,8 @@
 ;%0A%0A%0A
-    gulp.task( 'lint:js', 'lints all javascript files with both jscs and jshint', %5B%0A        'lint:js:jshint',%0A        'lint:js:jscs'%0A    %5D );%0A%0A%0A
     
@@ -749,34 +749,8 @@
 ) %7B%0A
-        watching = true;%0A%0A
     

Combine js linting tasks (jscs and jshint) into a single report