Skip to content

Commit

Permalink
Linting. But more relaxed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Diethelm committed Nov 4, 2013
1 parent dc17362 commit b223f18
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
34 changes: 23 additions & 11 deletions .jshintrc
@@ -1,13 +1,25 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"node": true
"curly": true
,"eqeqeq": true
,"immed": true
,"latedef": true
,"newcap": true
,"noarg": true
,"sub": true
,"undef": true
,"boss": true
,"eqnull": true
,"node": true

,"laxcomma" : true
,"smarttabs" : true
,"expr" : true
,"asi" : true
,"loopfunc" : true
,"nonew" : true
,"globals": {
"console" : true
,"log" : true
,"dir" : true
}
}
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -99,6 +99,6 @@ module.exports = function (grunt) {
grunt.registerTask('test', ['clean', 'glue'/*, 'mochacli'*/]);

// By default, lint and run all tests.
grunt.registerTask('default', [/*'jshint'*/, 'test']);
grunt.registerTask('default', ['jshint', 'test']);

};
16 changes: 9 additions & 7 deletions tasks/glue_nu.js
Expand Up @@ -109,7 +109,7 @@ module.exports = function (grunt) {
if (!this.directToGlue) {
// don't copy files if source is simple and bundleName is either not set or the same as task target name
// why? because Glue has no way to specify the generated file names except through the source folder
if ( isSourceSimple && (!this.options.bundleName || this.options.bundleName == this.taskTargetName) ) {
if ( isSourceSimple && (!this.options.bundleName || this.options.bundleName === this.taskTargetName) ) {
// just pass the location to glue
this.glueSrcDir = this.taskData.src;
}
Expand All @@ -135,7 +135,7 @@ module.exports = function (grunt) {

if (err) {
// Glue thinks it's terrible when the src is empty. We don't
if (err.message.indexOf('No images found') != -1) {
if (err.message.indexOf('No images found') !== -1) {
grunt.log.warn(err.message.replace(/^Error: /, 'Glue: '));
}
else {
Expand Down Expand Up @@ -186,11 +186,11 @@ module.exports = function (grunt) {
var taskDataSrc = this.taskData.src
,src
;
if (typeof taskDataSrc == 'string') {
if (typeof taskDataSrc === 'string') {
src = taskDataSrc;
}
// is it an array consisting of one string?
else if (grunt.util.kindOf(taskDataSrc) == 'array' && taskDataSrc.length == 1) {
else if (grunt.util.kindOf(taskDataSrc) === 'array' && taskDataSrc.length === 1) {
src = taskDataSrc[0];
}

Expand Down Expand Up @@ -242,18 +242,20 @@ module.exports = function (grunt) {

for (arg in this.options) {
// don't push non-glue options into glue args
if (extendedOptions.indexOf(arg) != -1) {
if (extendedOptions.indexOf(arg) !== -1) {
continue;
}
// don't push options that aren't set into glue args
if (this.options[arg] === null) {
continue;
}

if (typeof this.options[arg] == 'boolean')
if (typeof this.options[arg] === 'boolean') {
glueArgs.push('--'+ arg);
else
}
else {
glueArgs.push('--'+ arg +'='+ this.options[arg]);
}
}

glueArgs.push(this.glueSrcDir); // add the source dir last
Expand Down

0 comments on commit b223f18

Please sign in to comment.