50cb71ab by Adam Heath

Add more jshint targets; this is the beginning of library build

support.
1 parent f7be81d6
......@@ -206,6 +206,11 @@ module.exports = function (grunt) {
});
}
function jshintAddExtra(src, container, dest) {
if (src) {
container[dest] = container[dest].concat(src);
}
}
if (mpConfig.jshint) {
initConfig.jshint = {
options: mpConfig.jshint.options,
......@@ -222,15 +227,40 @@ module.exports = function (grunt) {
files: {
src: [
'src/scripts/*.js',
],
},
},
model: {
options: _.extend({}, mpConfig.jshint.modelOptions || mpConfig.jshint.browserOptions, {
globals: {
define: false,
require: false,
},
}),
files: {
src: [
'src/scripts/model/**/*.js',
],
},
},
view: {
options: _.extend({}, mpConfig.jshint.viewOptions || mpConfig.jshint.browserOptions, {
globals: {
define: false,
require: false,
},
}),
files: {
src: [
'src/scripts/view/**/*.js',
],
},
}
},
};
if (mpConfig.jshint.all) {
initConfig.jshint.all = initConfig.jshint.all.concat(mpConfig.jshint.all);
}
jshintAddExtra(mpConfig.jshint.all, initConfig.jshint, 'all');
jshintAddExtra(mpConfig.jshint.main, initConfig.jshint.main.files, 'src');
jshintAddExtra(mpConfig.jshint.model, initConfig.jshint.model.files, 'src');
jshintAddExtra(mpConfig.jshint.view, initConfig.jshint.view.files, 'src');
checkList.push('jshint');
}
......