Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function jsStart () {
return src(`${helpers.src()}/${helpers.trim(global.config.js.src)}/*.js`)
.pipe(sourcemaps.init())
.pipe(standard())
.pipe(standard.reporter('default', standardConfig))
.pipe(eslint(eslintConfig))
.pipe(eslint.format())
.pipe(eslint.failAfterError())
.pipe(eslint.result((result) => {
gutil.log(gutil.colors.blue(`ESLint result: ${result.filePath}`))
gutil.log(gutil.colors.green(`# Messages: ${result.messages.length}`))
gutil.log(gutil.colors.yellow(`# Warnings: ${result.warningCount}`))
gutil.log(gutil.colors.red(`# Errors: ${result.errorCount}`))
}))
.pipe(include(includeConfig))
.pipe(babel(babelConfig))
.pipe(dest(`${helpers.dist()}/${helpers.trim(global.config.js.dist)}`))
.pipe(uglify())
.pipe(rename(renameConfig))
.pipe(sourcemaps.write(sourcemapsConfig))
.pipe(dest(`${helpers.dist()}/${helpers.trim(global.config.js.dist)}`))
gulp.task('standard', function () {
return gulp.src(['src/**/*.js', 'test/**/*.js'])
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: true
}))
})
function scriptTestLint () {
return src(paths.test + '/**/*.js')
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: true,
quiet: true
}))
}
gulp.task('standard', function () {
return gulp.src(['./src/**/*.js'])
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: true
}))
})
gulp.task('test-lint', function () {
return gulp.src(['gulpfile.js', 'generators/**/*.js'])
.pipe(standard())
.pipe(standard.reporter('default', { breakOnError: true }))
})
gulp.task('lint', [], function () {
return gulp.src(['./index.js', './test/**/*.js'])
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: false
}))
})
function lint (files) {
return gulp.src(files)
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: true,
quiet: true
}))
}