cleanup loadNpmTasks
Thomas Aylott committed
Nov 6, 2013 at 17:12 UTC
0a120bb5d0200623e9629872a8dd3f3b4ad436f2
1 file changed
+6
-3
Gruntfile.js
+6
-3
@@ -27,9 +27,12 @@ module.exports = function(grunt) {
27
28
grunt.config.set('compress', require('./grunt/config/compress'));
29
30
- for (var key in grunt.file.readJSON("package.json").devDependencies) {
31
- if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
32
- }
30
+ Object.keys(grunt.file.readJSON('package.json').devDependencies)
31
+ .filter(function(npmTaskName){ return npmTaskName.indexOf('grunt-') === 0;})
32
+ .forEach(function(npmTaskName){
33
+ grunt.loadNpmTasks(npmTaskName);
34
+ })
35
+ ;
36
37
// Alias 'jshint' to 'lint' to better match the workflow we know
38
grunt.registerTask('lint', ['jshint']);