-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
32 lines (26 loc) · 852 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
var elixir = require('laravel-elixir');
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var notify = require('gulp-notify');
var path = require('path');
// The files that will be linted
var files = [];
elixir.extend('jscs', function(src, options) {
// append all of the src files onto the end of the array. This allows us to keep calling the plugin to build more
// and more files on to the end
if(!src instanceof Array) {
src = [src];
}
Array.prototype.push.apply(files, src);
// default options
options = options || {};
// Setup the task
gulp.task('jscs', function() {
return gulp.src(files)
.pipe(jscs(options))
});
// register the task to actually run via elixir
this.registerWatcher('jscs', files);
return this.queueTask('jscs');
});