mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-22 19:32:54 +03:00
Switch to grunt-jslint
This commit is contained in:
parent
13e7a51bb7
commit
b88e69a3cc
84
Gruntfile.js
84
Gruntfile.js
@ -1,47 +1,53 @@
|
|||||||
|
(function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var configureGrunt = function (grunt) {
|
var configureGrunt = function (grunt) {
|
||||||
|
|
||||||
var cfg = {
|
var cfg = {
|
||||||
// JSHint all the things!
|
// JSLint all the things!
|
||||||
jshint2: {
|
jslint: {
|
||||||
options: {
|
directives: {
|
||||||
jshintrc: ".jshintrc"
|
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!
|
// Unit test all the things!
|
||||||
nodeunit: {
|
nodeunit: {
|
||||||
all: ['core/test/ghost/**/test-*.js']
|
all: ['core/test/ghost/**/test-*.js']
|
||||||
},
|
|
||||||
|
|
||||||
// Compile all the SASS!
|
|
||||||
compass: {
|
|
||||||
options: {
|
|
||||||
config: "config.rb"
|
|
||||||
},
|
},
|
||||||
// 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;
|
|
@ -75,7 +75,7 @@
|
|||||||
polyglot: function () { return polyglot; },
|
polyglot: function () { return polyglot; },
|
||||||
paths: function () {
|
paths: function () {
|
||||||
return {
|
return {
|
||||||
'activeTheme': path.resolve(__dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/'),
|
'activeTheme': __dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/',
|
||||||
'adminViews': __dirname + '/admin/views/',
|
'adminViews': __dirname + '/admin/views/',
|
||||||
'lang': __dirname + '/lang/'
|
'lang': __dirname + '/lang/'
|
||||||
};
|
};
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
if (lang === 'en') {
|
if (lang === 'en') {
|
||||||
// TODO: do stuff here to optimise for 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
|
/** TODO potentially use req.acceptedLanguages rather than the default
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-contrib-nodeunit": "~0.1.2",
|
"grunt-contrib-nodeunit": "~0.1.2",
|
||||||
"grunt-jshint2": "~0.1.1",
|
|
||||||
"grunt-contrib-compass": "~0.2.0",
|
"grunt-contrib-compass": "~0.2.0",
|
||||||
"nodeunit": "*"
|
"nodeunit": "*",
|
||||||
|
"grunt-jslint": "~0.2.5a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user