gulp-jsonlint
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "gulp-jsonlint", | ||
"version": "0.0.1", | ||
"description": "A plugin for Gulp", | ||
"version": "0.0.2", | ||
"description": "A jsonlint plugin for Gulp", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "gulpplugin", "jsonlint", "json", "lint" |
@@ -23,2 +23,17 @@ # gulp-jsonlint [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
Using a custom reporter: | ||
```javascript | ||
var jsonlint = require('gulp-jsonlint'); | ||
var gutil = require('gulp-util'); | ||
var myCustomReporter = function (file) { | ||
gutil.log('File ' + file.path + ' is not valid JSON.'); | ||
}; | ||
gulp.src('./src/*.json'); | ||
.pipe(jsonlint()) | ||
.pipe(jsonlint.reporter(myCustomReporter)); | ||
``` | ||
## API | ||
@@ -30,2 +45,18 @@ | ||
### 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. | ||
## License | ||
@@ -32,0 +63,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9097
72