diff --git a/Gruntfile.js b/Gruntfile.js index 7b7cb12..07f406a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,7 @@ module.exports = function(grunt) { + // Load all grunt tasks + require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), @@ -10,16 +12,15 @@ module.exports = function(grunt) { } } }, + jshint: { + all: ['assets/script.js'] + }, watch: { files: ['assets/script.js'], - tasks: ['uglify'] + tasks: ['jshint', 'uglify'] } }); - // Load the plugin that provides the "uglify" task. - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-watch'); - // Default task(s). - grunt.registerTask('default', ['uglify']); + grunt.registerTask( 'default', ['jshint', 'uglify'] ); }; diff --git a/assets/script.js b/assets/script.js index ee6cacc..537cc13 100755 --- a/assets/script.js +++ b/assets/script.js @@ -79,10 +79,9 @@ jQuery( function( $ ) { that.checkLength(this); }); } - } + }; } }; - //start the show LIMIT_WIDGETS.init(); }); \ No newline at end of file diff --git a/package.json b/package.json index 5c15d03..2bdc3b7 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-uglify": "~0.7.0", - "grunt-contrib-watch": "~0.6.1" + "grunt-contrib-watch": "~0.6.1", + "grunt-contrib-jshint": "~0.11.0", + "matchdep": "~0.3.0" } }