gulp-json-lint
JSON linter plugin for Gulp.
First install gulp-json-lint
npm install --save-dev gulp-json-lint
Usage:
var jsonlint = ; gulp;
The output is added to file.jsonlint. You can output the errors by using reporters. There are two default reporters:
- 'json' prints stringified JSON to console.log.
- 'verbose' prints longer human-readable failures to console.log.
Reporters are executed only if there is an error.
You can use your own reporter by supplying a function.
/* Output is in the following form: * { * "error": "Unknown Character 'a', expecting a string for key statement.", * "line": 2, * "character": 5 * } */var { console;}; gulp;
gulp-json-lint only has one option, which specifies if comments are allowed. By default, they're not.
gulp;
Development
Fork this repository, run npm install and send pull requests.