Skip to content

adam-lynch/gulp-coffeelint-threshold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-coffeelint-threshold

NPM version Build Status Windows Build Status Dependency Status


A GulpJS plugin to catch the output from gulp-coffeelint and call a callback if the error or warning count is above a threshold you set.

Information

Packagegulp-coffeelint-threshold
Description A GulpJS plugin to catch the output from gulp-coffeelint and call a callback if the error or warning count is above a threshold you set.
Node Version >= 0.9

Installation

npm install gulp-coffeelint-threshold

Usage

var gulp = require('gulp');
var gutil = require('gulp-util');
var coffeelint = require('gulp-coffeelint');
var coffeelintThreshold = require('gulp-coffeelint-threshold');

gulp.task('lint', function() {
    gulp.src('./*.coffee')
        .pipe(coffeelint())
        .pipe(coffeelintThreshold(10, 0, function(numberOfWarnings, numberOfErrors){
            gutil.beep();
            throw new Error('CoffeeLint failure; see above. Warning count: ' + numberOfWarnings
                + '. Error count: ' + numberOfErrors + '.');
        }));
});

gulp.task('default', ['lint']);

Arguments

coffeelintThreshold(maxWarnings, maxErrors, callbackOnFailure)

  • maxWarnings, a number. Set to -1 if you don't want any warning threshold.
  • errorWarnings, a number. Set to -1 if you don't want any warning threshold.
  • callbackOnFailure(numberOfWarnings, numberOfWarnings), a function that gets called when the number of warnings or errors are over their respective thresholds you have set. It gets passed the number of warnings and errors as arguments.

About

A GulpJS plugin to catch the output from gulp-coffeelint and call a callback if the error or warning count is above a threshold you set

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published