在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):rogeriopvl/gulp-jsonlint开源软件地址(OpenSource Url):https://github.com/rogeriopvl/gulp-jsonlint开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-jsonlint
UsageFirst, install npm install --save-dev gulp-jsonlint Then, add it to your var jsonlint = require("gulp-jsonlint");
gulp.src("./src/*.json")
.pipe(jsonlint())
.pipe(jsonlint.reporter()); Using a custom reporter: var jsonlint = require('gulp-jsonlint');
var log = require('fancy-log');
var myCustomReporter = function (file) {
log('File ' + file.path + ' is not valid JSON.');
};
gulp.src('./src/*.json')
.pipe(jsonlint())
.pipe(jsonlint.reporter(myCustomReporter)); APIjsonlint(options)For now, jsonlint.reporter(customReporter)customReporter(file)Type: You can pass a custom reporter function. If ommited then the default reporter will be used. The fileType: This argument has the attribute jsonlint.failOnError()Stop a task/stream if an jsonlint error has been reported for any file. // Cause the stream to stop(/fail) before copying an invalid JS file to the output directory
gulp.src('**/*.js')
.pipe(jsonlint())
.pipe(jsonlint.failOnError())
.pipe(gulp.dest('../output')); jsonlint.failAfterError()Stop a task/stream if an jsonlint error has been reported for any file, but wait for all of them to be processed first. License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论