Switch to grunt-jslint

This commit is contained in:
Jacob Gable 2013-05-14 10:04:22 -05:00
parent 13e7a51bb7
commit b88e69a3cc
4 changed files with 51 additions and 42 deletions

View File

@ -1,47 +1,53 @@
(function () {
"use strict";
var configureGrunt = function (grunt) {
var configureGrunt = function (grunt) {
var cfg = {
// JSHint all the things!
jshint2: {
options: {
jshintrc: ".jshintrc"
var cfg = {
// JSLint all the things!
jslint: {
directives: {
nomen: true,
todo: true,
predef: ["__dirname", "module", "exports", "require", "process", "document", "console"]
},
files: [
// Lint files in the root, including Gruntfile.js
"*.js",
// Lint core files, but not libs
["core/**/*.js", "!**/assets/lib/**/*.js"]
]
},
all: [
// Lint files in the root, including Gruntfile.js
"*.js",
// Lint core files, but not libs
["core/**/*.js", "!**/assets/lib/**/*.js"]
]
},
// Unit test all the things!
nodeunit: {
all: ['core/test/ghost/**/test-*.js']
},
// Compile all the SASS!
compass: {
options: {
config: "config.rb"
// Unit test all the things!
nodeunit: {
all: ['core/test/ghost/**/test-*.js']
},
// No need for config, but separated for future options
admin: {}
}
// Compile all the SASS!
compass: {
options: {
config: "config.rb"
},
// No need for config, but separated for future options
admin: {}
}
};
grunt.initConfig(cfg);
grunt.loadNpmTasks("grunt-jslint");
grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-contrib-compass");
// Prepare the project for development
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask("init", ["compass:admin"]);
// Run tests and lint code
grunt.registerTask("validate", ["jslint", "nodeunit:all"]);
};
grunt.initConfig(cfg);
module.exports = configureGrunt;
grunt.loadNpmTasks("grunt-jshint2");
grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-contrib-compass");
// Prepare the project for development
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask("init", ["compass:admin"]);
// Run tests and lint code
grunt.registerTask("validate", ["jshint2:all", "nodeunit:all"]);
};
module.exports = configureGrunt;
}());

View File

@ -75,7 +75,7 @@
polyglot: function () { return polyglot; },
paths: function () {
return {
'activeTheme': path.resolve(__dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/'),
'activeTheme': __dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/',
'adminViews': __dirname + '/admin/views/',
'lang': __dirname + '/lang/'
};

View File

@ -19,6 +19,9 @@
if (lang === 'en') {
// TODO: do stuff here to optimise for en
// Make jslint empty block error go away
lang = 'en';
}
/** TODO potentially use req.acceptedLanguages rather than the default

View File

@ -22,8 +22,8 @@
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-nodeunit": "~0.1.2",
"grunt-jshint2": "~0.1.1",
"grunt-contrib-compass": "~0.2.0",
"nodeunit": "*"
"nodeunit": "*",
"grunt-jslint": "~0.2.5a"
}
}