Skip to content

Instantly share code, notes, and snippets.

@michaeljacobdavis
Created September 29, 2014 19:54
Show Gist options
  • Select an option

  • Save michaeljacobdavis/44b45f9b1e50529b8e8d to your computer and use it in GitHub Desktop.

Select an option

Save michaeljacobdavis/44b45f9b1e50529b8e8d to your computer and use it in GitHub Desktop.
Grunt Clean Up
module.exports = function(grunt) {
'use strict';
var _ = require('lodash');
// Configuration
// -------------
// Load Tasks
// ----------
var tasks = grunt.file.expand([
'./tasks/**.js'
]);
var taskConfigs = _.reduce(tasks, function (taskObj, task) {
// Loads the tasks and merges configuration sub-object for inclusion in
// `initConfig`.
return _.merge(taskObj, require(task)(grunt));
}, {});
// Task Configuration
// ------------------
grunt.initConfig(_.merge({
pkg: grunt.file.readJSON('package.json')
}, taskConfigs));
};
// Style Enforcement
// =================
module.exports = function (grunt) {
// Configuration
// -------------
var cfg = {
eslint: {
options: {
config: '.eslintrc'
},
target: ['repo/**/*.js', '!**/node_modules/**/*.js', '!**/vendor/**/*.js', '!repo/bundles/**/*.js']
}
};
// Plugins
// -------
grunt.loadNpmTasks('grunt-eslint');
// Tasks
// -----
return cfg;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment