在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):karimsa/gulp-jslint开源软件地址(OpenSource Url):https://github.com/karimsa/gulp-jslint开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-jslintIt's JSLint for Gulp.js. Supports Table of ContentsInstallationSimply install with npm by running Usagevar gulp = require('gulp');
var jslint = require('gulp-jslint');
gulp.task('default', function () {
return gulp.src(['source.js'])
.pipe(jslint({ /* this object represents the JSLint directives being passed down */ }))
.pipe(jslint.reporter( 'my-reporter' ));
}); If you would like to specify a custom jslint edition to use, set the property 'edition' in your directives object. These versions should follow what the package node-jslint expects or this property can be set to a pre-loaded jslint function. DirectivesAll directives being passed to the However, to supply a list of global variables for your code, use the directive 'predef' or 'global' like so ('global' is an alias of 'predef' but 'predef' will be prefered since it is the official JSLint standard): gulp.task('default', function () {
return gulp.src(['source.js'])
.pipe(jslint({
predef: [ 'a_global' ],
global: [ 'a_global' ]
}));
}); Please see ReportersBy default, two reporters are provided by gulp-jslint. The first is the default reporter (appropriately named 'default') and the second report is the popular 'jshint-stylish' (named 'stylish'). To use either of these reporters, provide the name of the reporter followed by whatever arguments they expect to the function
For example: gulp.task('default', function () {
return gulp.src(['source.js'])
.pipe(jslint())
.pipe(jslint.reporter('default', errorsOnly))
.pipe(jslint.reporter('stylish', options));
}); It's probably a good idea to use something like Custom ReportersCustom reporters should be either be synchronous or streams. Either way, the reporter will receive a The results object will contain the following properties:
LicenseLicensed under MIT license. Copyright © 2017 Karim Alibhai. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论