mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add gulp-coffeelint
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
/// <reference path="gulp-coffeelint.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import coffeelint = require('gulp-coffeelint');
|
||||
import gulp = require('gulp');
|
||||
|
||||
|
||||
gulp.task('lint', function () {
|
||||
gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter())
|
||||
});
|
||||
|
||||
gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter('csv'));
|
||||
|
||||
|
||||
declare var stylish: Function;
|
||||
|
||||
gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter(stylish));
|
||||
|
||||
gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter('coffelint-stylish'));
|
||||
|
||||
gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter('coffeelint-stylish'))
|
||||
.pipe(coffeelint.reporter('fail'));
|
||||
|
||||
var myReporter = (function() {
|
||||
function MyReporter(errorReport: any) {
|
||||
this.errorReport = errorReport;
|
||||
}
|
||||
|
||||
MyReporter.prototype.publish = function() {
|
||||
var hasError = this.errorReport.hasError();
|
||||
if (hasError) {
|
||||
return console.log('Oh no!');
|
||||
}
|
||||
return console.log('Oh yeah!');
|
||||
};
|
||||
|
||||
return MyReporter;
|
||||
})();
|
||||
|
||||
gulp.task('lint', function() {
|
||||
return gulp.src('./src/*.coffee')
|
||||
.pipe(coffeelint())
|
||||
.pipe(coffeelint.reporter(myReporter));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for gulp-coffeelint
|
||||
// Project: https://github.com/janraasch/gulp-coffeelint
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "gulp-coffeelint" {
|
||||
namespace coffeelint {
|
||||
interface Coffeelint {
|
||||
/**
|
||||
* @param optFile Absolute path of a json file containing options for coffeelint.
|
||||
* @param opt Options you wish to send to coffeelint. If optFile is given, this will be ignored.
|
||||
* @param literate Are we dealing with Literate CoffeeScript?
|
||||
* @param rules Add custom rules to coffeelint.
|
||||
*/
|
||||
(optFile?: string, opt?: any, literate?: boolean, rules?: Function[]): NodeJS.ReadWriteStream;
|
||||
reporter(reporter?: string|Function): NodeJS.ReadWriteStream;
|
||||
}
|
||||
}
|
||||
|
||||
var coffeelint: coffeelint.Coffeelint;
|
||||
|
||||
export = coffeelint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user