Skip to content

Instantly share code, notes, and snippets.

@EvanLovely
Forked from febbraro/-
Last active September 14, 2016 18:54
Show Gist options
  • Save EvanLovely/17563625f00655cae6dd452b53271473 to your computer and use it in GitHub Desktop.
Save EvanLovely/17563625f00655cae6dd452b53271473 to your computer and use it in GitHub Desktop.
var jsonFiles = ['*.theme.json'];
// Setup the linting
function lintJson() {
return gulp.src(jsonFiles)
.pipe(jsonlint())
.pipe(jsonlint.reporter());
}
// Add a validate task that will fail on lint error
gulp.task('validate:json', 'Test JSON', function() {
return lintJson().pipe(jsonlint.failAfterError());
});
tasks.validate.push('validate:json');
// Add a lint task
gulp.task('lint:json', lintJson);
// Run the lint tasks on the watched files
gulp.task('watch:json', 'Watch JSON', ['lint:json'], function() {
return gulp.watch(jsonFiles, ['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