issue #58 - removing the iiwf

In order to remove the iiwf we need to be able to lint backend and frontend code separately.
Changed our devDependency for grunt-jslint to use a fork which has multiTask (PR sent to main repo)
Updated Gruntfile with split rules for the jslint tasks
As a result, a few files failed to pass the new rules, these have been fixed and added to the commit
This commit is contained in:
Hannah Wolfe 2013-06-25 13:38:41 +01:00
parent 29ef492df9
commit 2c7245e0e5
6 changed files with 55 additions and 24 deletions

View File

@ -21,20 +21,52 @@
pkg: grunt.file.readJSON('package.json'),
// JSLint all the things!
jslint: {
directives: {
node: true,
browser: true,
nomen: true,
todo: true,
unparam: true
jslintm: {
node: {
directives: {
// node environment
node: true,
// browser environment
browser: false,
// allow dangling underscores in var names
nomen: true,
// allow to do statements
todo: true,
// allow unused parameters
unparam: true,
// don't require use strict pragma
sloppy: true
},
files: {
src: [
"*.js",
"core/**/*.js"
]
},
// Lint core files, but not libs, frontend or hbs files
exclude: [
"**/assets/lib/**/*.js",
"**/assets/js/**/*.js",
"**/assets/tpl/*.js"
]
},
files: [
// Lint files in the root, including Gruntfile.js
"*.js",
// Lint core files, but not libs
["core/**/*.js", "!**/assets/lib/**/*.js", "!**/assets/tpl/*.js"]
]
frontend: {
directives: {
// node environment
node: false,
// browser environment
browser: true,
// allow dangling underscores in var names
nomen: true,
// allow to do statements
todo: true,
// allow unused parameters
unparam: true
},
files: {
src: "**/assets/js/**/*.js"
}
}
},
mochaTest: {
@ -212,6 +244,9 @@
cfg.pkg = grunt.file.readJSON('package.json');
});
// jslintm aliased to jslint
grunt.registerTask("jslint", ["jslintm"]);
// Prepare the project for development
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask("init", ["shell:bourbon", "sass:admin", 'handlebars']);

View File

@ -12,7 +12,7 @@
'settings(/:pane)' : 'settings',
'editor/' : 'editor',
'editor(/:id)' : 'editor',
'debug/' : 'debug',
'debug/' : 'debug'
},
blog: function () {

View File

@ -1,5 +1,5 @@
/*global window, document, Ghost, Backbone, $, JST, _ */
(function (_, undefined) {
(function (_) {
"use strict";
Ghost.View = Backbone.View.extend({

View File

@ -89,15 +89,11 @@
tagName: 'article',
attributes: function () {
var size = (this.model.get('size'))
? " widget-" + this.model.get('size')
: "",
settings = (this.model.attributes.settings.enabled)
? " widget-settings"
: "";
var size = (this.model.get('size')) ? " widget-" + this.model.get('size') : "",
settings = (this.model.attributes.settings.enabled) ? " widget-settings" : "";
return {
class: 'widget-' + this.model.get('name') + size + settings + ' js-widget',
'class': 'widget-' + this.model.get('name') + size + settings + ' js-widget',
'data-widget-id': this.model.get('applicationID')
};
},

View File

@ -1,5 +1,5 @@
/*global jQuery, window, document, Ghost, Backbone, $, _, alert */
(function ($, _, Backbone, Ghost, undefined) {
(function ($, _, Backbone, Ghost) {
"use strict";
Ghost.Views.Debug = Ghost.View.extend({

View File

@ -24,7 +24,7 @@
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-jslint": "~0.2.6",
"grunt-jslint": "git+https://github.com/ErisDS/grunt-jslint.git#custom",
"should": "~1.2.2",
"grunt-mocha-test": "~0.4.0",
"grunt-shell": "~0.2.2",