Skip to content

Commit

Permalink
fix(generators): adhere to jshint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cueedee committed Mar 17, 2015
1 parent 161660f commit f033ce1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
5 changes: 3 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";

var yeoman = require( "yeoman-generator" );
var yosay = require( "yosay" );
var path = require( "path" );


// Get the current running directory name
Expand Down Expand Up @@ -78,7 +79,7 @@ module.exports = yeoman.generators.Base.extend(
this.bootstrap = props.bootstrap;
this.ie8 = props.ie8;
this.multiLanguage = props.multiLanguage;
this.demo = props.demo
this.demo = props.demo;

callback();
}.bind( this ) );
Expand Down
8 changes: 4 additions & 4 deletions generators/collection/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";

var yeoman = require( "yeoman-generator" )
, yosay = require( "yosay" )
, path = require( 'path' )
, varname = require( "varname" )
, fs = require( "fs" )
;

// Get the current running directory name
//
var fullPath = process.cwd()
, folderName = fullPath.split( '/' ).pop()
, rootLocation = fullPath
;

Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = yeoman.generators.Base.extend(
, {
type: "confirm"
, name: "singleton"
, message: 'Should this collection be a singleton?'
, message: "Should this collection be a singleton?"
, default: false
}
];
Expand Down Expand Up @@ -166,4 +166,4 @@ module.exports = yeoman.generators.Base.extend(
} );
}
}
} );
} );
8 changes: 4 additions & 4 deletions generators/model/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";

var yeoman = require( "yeoman-generator" )
, yosay = require( "yosay" )
, path = require( 'path' )
, varname = require( "varname" )
, fs = require( "fs" )
;

// Get the current running directory name
//
var fullPath = process.cwd()
, folderName = fullPath.split( '/' ).pop()
, rootLocation = fullPath
;

Expand Down Expand Up @@ -112,7 +112,7 @@ module.exports = yeoman.generators.Base.extend(
, {
type: "confirm"
, name: "singleton"
, message: 'Should this model be a singleton?'
, message: "Should this model be a singleton?"
, default: false
}
];
Expand Down Expand Up @@ -140,4 +140,4 @@ module.exports = yeoman.generators.Base.extend(

this.template( "model.coffee", "src/models/" + this.fileName + ".coffee" );
}
} );
} );
26 changes: 13 additions & 13 deletions generators/view/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";

var yeoman = require( "yeoman-generator" )
, yosay = require( "yosay" )
, path = require( "path" )
, varname = require( "varname" )
, fs = require( "fs" )
;

// Get the current running directory name
//
var fullPath = process.cwd()
, folderName = fullPath.split( '/' ).pop()
, rootLocation = fullPath
;

Expand All @@ -21,7 +21,7 @@ module.exports = yeoman.generators.Base.extend(
determineRoot: function()
{
var callback = this.async()
, rootFound = false
, rootFound = false
, tries = 0
;

Expand All @@ -34,17 +34,17 @@ module.exports = yeoman.generators.Base.extend(
var previousLocation = rootLocation.split( "/" );

// Pop the last folder from the path
//
//
previousLocation.pop();

// Create the new path and open it
//
rootLocation = previousLocation.join( "/" );

// Change the process location
//
process.chdir( rootLocation );

// Check if we found the project root, up the counter
// we should stop looking some time.....
//
Expand All @@ -54,7 +54,7 @@ module.exports = yeoman.generators.Base.extend(

// If we couldn't find the root, let the user know and exit the proces...
//
if( rootFound == false )
if( rootFound === false )
{
yeoman.log( "Failed to find root of the project, check that you are somewhere within your project." );
process.exit();
Expand All @@ -66,7 +66,7 @@ module.exports = yeoman.generators.Base.extend(

, askSomeQuestions: function ()
{
// This is async
// This is async
//
var callback = this.async();

Expand Down Expand Up @@ -102,10 +102,10 @@ module.exports = yeoman.generators.Base.extend(
{
this.viewName = props.viewName;
this.description = props.description;

// Convert the filename to dashes instead of camel casing
//
this.fileName = varname.dash( this.viewName )
this.fileName = varname.dash( this.viewName );

// Classnames are uppercase by convention
//
Expand All @@ -122,7 +122,7 @@ module.exports = yeoman.generators.Base.extend(
}.bind( this ) );
}

, createView: function( obj )
, createView: function ()
{
// Create the views coffee file and handlebars template file
//
Expand All @@ -145,7 +145,7 @@ module.exports = yeoman.generators.Base.extend(
// for the newly created sass file
//
var views = this.readFileAsString( "src/sass/_views.sass" )
, insert = '@import "views/_' + this.fileName + '"';
, insert = "@import \"views/_" + this.fileName + "\"";

// Check if there isn't already in import for this file
// just in case....
Expand All @@ -156,4 +156,4 @@ module.exports = yeoman.generators.Base.extend(
}
}
}
} );
} );

0 comments on commit f033ce1

Please sign in to comment.