Skip to content

Instantly share code, notes, and snippets.

@jgable
Forked from anonymous/Gruntfile.basic.js
Last active December 17, 2015 13:19
Show Gist options
  • Save jgable/5616414 to your computer and use it in GitHub Desktop.
Save jgable/5616414 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.registerMultiTask("filecount", "Count how many files were passed to the task", function() {
var fileCount = this.filesSrc.length;
if(grunt.option("verbose")) {
this.filesSrc.each(function(filePath) {
grunt.verbose.writeln(filePath);
});
}
grunt.log(">> " + fileCount + " files.");
});
};
module.exports = function(grunt) {
var cfg = {
jshint2: {
options: {
jshint: {
node: true,
unused: true,
undef: true
}
},
all: ["lib/**/*.js"]
}
};
grunt.initConfig(cfg);
// Assumes you have: npm install grunt-jshint2 --save-dev
grunt.loadNpmTasks("grunt-jshint2");
grunt.registerTask("default", ["jshint2:all"]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment