diff --git a/Gruntfile.js b/Gruntfile.js index d06c68080..04273c683 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -158,6 +158,15 @@ module.exports = function(grunt) { }] } }, + jsonlint: { + messages: { + src: [ + 'nodes/core/locales/en-US/messages.json', + 'locales/en-US/editor.json', + 'locales/en-US/runtime.json' + ] + } + }, attachCopyright: { js: { src: [ @@ -198,6 +207,14 @@ module.exports = function(grunt) { 'editor/sass/**/*.scss' ], tasks: ['sass','attachCopyright:css'] + }, + json: { + files: [ + 'nodes/core/locales/en-US/messages.json', + 'locales/en-US/editor.json', + 'locales/en-US/runtime.json' + ], + tasks: ['jsonlint:messages'] } }, @@ -207,7 +224,7 @@ module.exports = function(grunt) { script: 'red.js', options: { args:['-v'], - ext: 'js,html', + ext: 'js,html,json', watch: [ 'red','nodes' ] @@ -314,6 +331,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-chmod'); + grunt.loadNpmTasks('grunt-jsonlint'); grunt.registerMultiTask('attachCopyright', function() { var files = this.data.src; @@ -379,7 +397,7 @@ module.exports = function(grunt) { grunt.registerTask('build', 'Builds editor content', - ['clean:build','concat:build','concat:vendor','uglify:build','sass:build','copy:build','attachCopyright']); + ['clean:build','concat:build','concat:vendor','uglify:build','sass:build','jsonlint:messages','copy:build','attachCopyright']); grunt.registerTask('dev', 'Developer mode: run node-red, watch for source changes and build/restart', diff --git a/package.json b/package.json index e4c0a998b..fdfd9cc2e 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "grunt-contrib-jshint": "0.11.2", "grunt-contrib-uglify": "0.9.1", "grunt-contrib-watch":"0.6.1", + "grunt-jsonlint":"1.0.4", "grunt-nodemon":"0.4.0", "grunt-sass":"1.0.0", "grunt-simple-mocha": "0.4.0",