Permalink
Browse files

Implement auto-linting with grunt-contrib-watch.

Run with `grunt watch[:<sub_task>]`.
Polls filesystem for changes to watched files and runs the linting tasks.
  • Loading branch information...
1 parent 332799f commit 51c0c8b2203492783363fd979a7d7f76b73771d3 @0xazure 0xazure committed Oct 13, 2014
Showing with 34 additions and 1 deletion.
  1. +34 −1 Gruntfile.js
View
@@ -133,14 +133,47 @@ module.exports = function(grunt) {
},
},
+ // grunt-contrib-watch task
+ watch: {
+ gruntfile: {
+ files: '<%= jshint.gruntfile.src %>',
+ tasks: ['jshint:gruntfile'],
+ },
+ extensions: {
+ files: [
+ 'Extensions/**/*.js',
+ '!Extensions/**/*.icon.js',
+ ],
+ tasks: ['jshint:extensions'],
+ },
+ chrome: {
+ files: [
+ 'Chrome/**/*.js',
+ ],
+ tasks: ['jshint:chrome'],
+ },
+ firefox: {
+ files: [
+ 'Firefox/**/*.js',
+ ],
+ tasks: ['jshint:firefox'],
+ },
+ safari: {
+ files: [
+ 'Safari/**/*.js',
+ ],
+ tasks: ['jshint:safari'],
+ },
+ },
+
});
// Grunt-contrib tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-jshint');
-
+ grunt.loadNpmTasks('grunt-contrib-watch');
// Default task
grunt.registerTask('default', ['jshint']);

0 comments on commit 51c0c8b

Please sign in to comment.