// Dependencies
const coffeelint = require('gulp-coffeelint');
const debug = require('gulp-debug');
const gulp = require('gulp');
const jshint = require('gulp-jshint');
const jsonlint = require('gulp-jsonlint');
const lesshint = require('gulp-lesshint');
const stylish = require('coffeelint-stylish');

// Files
const coffeeFiles = [
    './grammars/*.cson',
    './keymaps/*.cson',
    './lib/**/*.coffee',
    './menus/*.cson',
    './snippets/*.cson'
];

const jsFiles = [
    './lib/**/*.js'
];

const jsonFiles = [
    './grammars/*.json',
    './keymaps/*.json',
    './menus/*.json',
    './snippets/*.json',
    './package.json'
];

const lessFiles = [
    './styles/**/*.less'
];

// Tasks
gulp.task('lint', ['coffeelint', 'jshint', 'jsonlint', 'lesshint']);

// Lint CoffeeScript & CSON files
gulp.task('coffeelint', function () {
    gulp.src(coffeeFiles)
        .pipe(debug({title: 'coffeelint:'}))
        .pipe(coffeelint())
        .pipe(coffeelint.reporter(stylish))
        .pipe(coffeelint.reporter('fail'));
});

// Lint LESS files
gulp.task('lesshint', function () {
     gulp.src(lessFiles)
        .pipe(debug({title: 'lesshint:'}))
        .pipe(lesshint())
        .pipe(lesshint.reporter());
});

// Lint JavaScript files
gulp.task('jshint', function() {
    return gulp.src(jsFiles)
        .pipe(debug({title: 'jshint:'}))
        .pipe(jshint());
});

// Lint JSON files
gulp.task('jsonlint', function() {
   gulp.src(jsonFiles)
        .pipe(debug({title: 'jsonlint:'}))
        .pipe(jsonlint())
        .pipe(jsonlint.reporter());
});

@@ -716,52 +716,56 @@
 , %5B'
+lint:
 coffee
+', '
 lint
+:js
 ', '
-jshint', 'jsonlint', 'lesshint
+lint:json', 'lint:less
 '%5D);
@@ -811,26 +811,27 @@
 p.task('
+lint:
 coffee
-lint
 ', funct
@@ -1062,23 +1062,24 @@
 .task('l
-esshint
+int:less
 ', funct
@@ -1258,22 +1258,23 @@
 p.task('
-jshint
+lint:js
 ', funct
@@ -1411,24 +1411,25 @@
 p.task('
-json
 lint
+:json
 ', funct
@@ -1520,32 +1520,73 @@
 ipe(jsonlint())%0A
+        .pipe(jsonlint.failAfterError())%0A
         .pipe(js

replace JSON linter