UNPKG

@nurun-sf/spark-component

Version:

A tool for building spark components

28 lines (23 loc) 707 B
'use strict'; const path = require('path'); const jscs = require('gulp-jscs'); const jshint = require('gulp-jshint'); const jshintStylish = require('jshint-stylish'); const config = require('../lib/config'); module.exports = function (gulp) { return function () { let stream = gulp.src('src/**/*.js') .pipe(jshint()) .pipe(jshint.reporter(jshintStylish)) .pipe(jscs({ configPath: path.join(__dirname, '..', '.jscsrc') })) .pipe(jscs.reporter()); // If not watching, end the stream after linting if there are errors. if (!config.watch) { stream.pipe(jshint.reporter('fail')) .pipe(jscs.reporter('fail')); } return stream; }; };