All Projects â†’ rogeriopvl â†’ Gulp Jsonlint

rogeriopvl / Gulp Jsonlint

Licence: mit
🔍 jsonlint plugin for Gulp

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gulp Jsonlint

gulp-px2rem
This is a gulp plugin for node-px2rem.
Stars: ✭ 19 (-26.92%)
Mutual labels:  gulp, gulp-plugin
gulp-golang
gulp plugin for golang projects
Stars: ✭ 13 (-50%)
Mutual labels:  gulp, gulp-plugin
gulp-recess
[DEPRECATED] Lint CSS and LESS with RECESS
Stars: ✭ 42 (+61.54%)
Mutual labels:  gulp, gulp-plugin
gulp-merge-json
A gulp plugin to merge JSON & JSON5 files into one file
Stars: ✭ 35 (+34.62%)
Mutual labels:  gulp, gulp-plugin
gulp-markdown-to-json
Parse Markdown and YAML → compile Markdown to HTML → wrap it all up in JSON
Stars: ✭ 76 (+192.31%)
Mutual labels:  gulp, gulp-plugin
gulp-ava
Run AVA tests
Stars: ✭ 56 (+115.38%)
Mutual labels:  gulp, gulp-plugin
gulp-iife
A Gulp plugin for wrapping JavaScript code in IIFEs.
Stars: ✭ 39 (+50%)
Mutual labels:  gulp, gulp-plugin
gulp-xo
Validate files with XO
Stars: ✭ 37 (+42.31%)
Mutual labels:  gulp, gulp-plugin
gulp-convert-encoding
Plugin for gulp to convert files from one encoding to another.
Stars: ✭ 15 (-42.31%)
Mutual labels:  gulp, gulp-plugin
gulp-yarn
Automatically install node modules using Yarn. ðŸ˜ŧ
Stars: ✭ 22 (-15.38%)
Mutual labels:  gulp, gulp-plugin
gulp-es6-transpiler
[DEPRECATED] Transpile ES2015 to ES5
Stars: ✭ 47 (+80.77%)
Mutual labels:  gulp, gulp-plugin
Gulp Pug
Gulp plugin for compiling Pug templates
Stars: ✭ 512 (+1869.23%)
Mutual labels:  gulp, gulp-plugin
gulp-sitemap
Generate a search engine friendly sitemap.xml using a Gulp stream
Stars: ✭ 60 (+130.77%)
Mutual labels:  gulp, gulp-plugin
gulp-esbuild
gulp plugin for esbuild bundler
Stars: ✭ 39 (+50%)
Mutual labels:  gulp, gulp-plugin
gulp-sort
Sort files in stream by path or any custom sort comparator
Stars: ✭ 22 (-15.38%)
Mutual labels:  gulp, gulp-plugin
gulp-tinypng-compress
TinyPNG API wrapper for compressing PNG & JPG images
Stars: ✭ 49 (+88.46%)
Mutual labels:  gulp, gulp-plugin
Gulp Html Replace
Replace build blocks in HTML. Like useref but done right.
Stars: ✭ 222 (+753.85%)
Mutual labels:  gulp, gulp-plugin
gulp-upload-qcloud
č…ūčŪŊ乑 cos 静态čĩ„暐äļŠäž  gulp 插äŧķ
Stars: ✭ 18 (-30.77%)
Mutual labels:  gulp, gulp-plugin
anyfs
Portable file system for Node
Stars: ✭ 17 (-34.62%)
Mutual labels:  gulp, gulp-plugin
Gulp Shell
A handy command line interface for gulp
Stars: ✭ 474 (+1723.08%)
Mutual labels:  gulp, gulp-plugin

gulp-jsonlint NPM version Build Status Dependency Status

jsonlint plugin for gulp

Usage

First, install gulp-jsonlint as a development dependency:

npm install --save-dev gulp-jsonlint

Then, add it to your gulpfile.js:

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));

API

jsonlint(options)

For now, options are not supported yet.

jsonlint.reporter(customReporter)

customReporter(file)

Type: function

You can pass a custom reporter function. If ommited then the default reporter will be used.

The customReporter function will be called with the argument file.

file

Type: object

This argument has the attribute jsonlint wich is an object that contains a success boolean attribute. If it's false you also have a message attribute containing the jsonlint error message.

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

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].