Skip to content

Instantly share code, notes, and snippets.

@febbraro
Created September 14, 2016 18:42
Show Gist options
  • Save febbraro/2185b2561ee3412382b0334d59b5c03e to your computer and use it in GitHub Desktop.
Save febbraro/2185b2561ee3412382b0334d59b5c03e to your computer and use it in GitHub Desktop.
function lintJson() {
return gulp.src('*.theme.json')
.pipe(jsonlint())
.pipe(jsonlint.reporter());
}
gulp.task('validate:json', 'Test JSON', function() {
return lintJson().pipe(jsonlint.failAfterError());
});
tasks.validate.push('validate:json');
tasks.watch.push('validate:json');
gulp.task('lint:json', function() {
return lintJson();
});
gulp.task('watch:json', function() {
return gulp.watch('*.theme.json', ['lint:json']);
});
tasks.watch.push('watch:json');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment