Skip to content

Commit

Permalink
Lint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 25, 2015
1 parent a7840e3 commit 8528cc1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(grunt) {
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'tasks/**/*.js',
'<%= nodeunit.tests %>'
],
options: {
Expand Down Expand Up @@ -141,7 +141,7 @@ module.exports = function(grunt) {
return require('./test/fixtures/inc/locals.json');
}
}
},
}
},


Expand Down
11 changes: 7 additions & 4 deletions tasks/jade.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ module.exports = function(grunt) {
var chalk = require('chalk');

// content conversion for templates
var defaultProcessContent = function(content) { return content; };
var defaultProcessContent = function(content) {
return content;
};

// filename conversion for templates
var defaultProcessName = function(name) { return name.replace('.jade', ''); };
var defaultProcessName = function(name) {
return name.replace('.jade', '');
};

grunt.registerMultiTask('jade', 'Compile jade templates.', function() {
var options = this.options({
Expand Down Expand Up @@ -46,9 +50,8 @@ module.exports = function(grunt) {
if (!grunt.file.exists(filepath)) {
grunt.log.warn('Source file "' + filepath + '" not found.');
return false;
} else {
return true;
}
return true;
})
.forEach(function(filepath) {
var src = processContent(grunt.file.read(filepath), filepath);
Expand Down
6 changes: 4 additions & 2 deletions tasks/lib/jade.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
'use strict';

exports.getNamespaceDeclaration = function(ns) {
var output = [];
var curPath = 'this';
if (ns !== 'this') {
var nsParts = ns.split('.');
nsParts.forEach(function(curPart, index) {
nsParts.forEach(function(curPart) {
if (curPart !== 'this') {
curPath += '[' + JSON.stringify(curPart) + ']';
output.push(curPath + ' = ' + curPath + ' || {};');
Expand All @@ -15,4 +17,4 @@ exports.getNamespaceDeclaration = function(ns) {
namespace: curPath,
declaration: output.join('\n')
};
};
};
5 changes: 3 additions & 2 deletions test/jade_amd_test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var grunt = require('grunt');

var read = function(src) {
Expand All @@ -6,7 +8,6 @@ var read = function(src) {

exports.jade = {
compile: function(test) {
'use strict';

test.expect(4);

Expand All @@ -28,4 +29,4 @@ exports.jade = {

test.done();
}
};
};
5 changes: 3 additions & 2 deletions test/jade_jst_test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var grunt = require('grunt');

var read = function(src) {
Expand All @@ -6,7 +8,6 @@ var read = function(src) {

exports.jade = {
compile: function(test) {
'use strict';

test.expect(4);

Expand All @@ -28,4 +29,4 @@ exports.jade = {

test.done();
}
};
};
3 changes: 2 additions & 1 deletion test/jade_test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var grunt = require('grunt');

var read = function(src) {
Expand All @@ -6,7 +8,6 @@ var read = function(src) {

exports.jade = {
compile: function(test) {
'use strict';

test.expect(9);

Expand Down

0 comments on commit 8528cc1

Please sign in to comment.