// 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'
];

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

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

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

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

// Tasks
gulp.task('lint', gulp.parallel('lint:coffee', 'lint:js', 'lint:json', 'lint:less', function(done) {
  done();
}));

@@ -135,118 +135,36 @@
 t js
-hint = require('gulp-jshint');%0Aconst jsonlint = require('gulp-jsonlint');%0Aconst lesshint = require('gulp-lessh
+onlint = require('gulp-jsonl
 int'
@@ -373,50 +373,8 @@
 %5D;%0A%0A
-const jsFiles = %5B%0A    './lib/**/*.js'%0A%5D;%0A%0A
 cons
@@ -514,57 +514,8 @@
 %5D;%0A%0A
-const lessFiles = %5B%0A    './styles/**/*.less'%0A%5D;%0A%0A
 // L
@@ -573,37 +573,19 @@
 e', 
-gulp.series(function
 (done) 
+=%3E 
 %7B
- 
 %0A   
@@ -786,410 +786,8 @@
 ;%0A%7D)
-);%0A%0A// Lint LESS files%0Agulp.task('lint:less', gulp.series(function(done) %7B %0A    gulp.src(lessFiles)%0A        .pipe(debug(%7Btitle: 'lesshint:'%7D))%0A        .pipe(lesshint())%0A        .pipe(lesshint.reporter());%0A    done();%0A%7D));%0A%0A// Lint JavaScript files%0Agulp.task('lint:js', gulp.series(function(done) %7B %0A    gulp.src(jsFiles)%0A        .pipe(debug(%7Btitle: 'jshint:'%7D))%0A        .pipe(jshint());%0A    done();%0A%7D))
 ;%0A%0A/
@@ -831,37 +831,19 @@
 n', 
-gulp.series(function
 (done) 
+=%3E 
 %7B
- 
 %0A   
@@ -1023,17 +1023,16 @@
 ne();%0A%7D)
-)
 ;%0A%0A// Ta
@@ -1094,51 +1094,20 @@
 t:js
+on
 ', 
-'lint:json', 'lint:less', function(
 done
-)
+ =%3E
  %7B%0A 

remove unused tasks