From 6d725bc503fea3a510745108cbea13f65cb7c0ea Mon Sep 17 00:00:00 2001 From: Rohit Mulange Date: Wed, 29 Jul 2015 00:01:58 +0530 Subject: [PATCH 1/2] Build: Add variable files to linting and update jscs --- .jshintrc | 6 ++++-- package.json | 2 +- scss/variables/chassis.js | 22 +++++++++++----------- scss/variables/colors.js | 23 ++++++++++++----------- scss/variables/index.js | 2 +- scss/variables/template.js | 21 +++++++++++---------- scss/variables/typography.js | 16 ++++++++-------- tasks/options/jscs.js | 4 ++-- tasks/options/jshint.js | 4 ++-- 9 files changed, 52 insertions(+), 48 deletions(-) diff --git a/.jshintrc b/.jshintrc index d34c42d..bbbbf9d 100644 --- a/.jshintrc +++ b/.jshintrc @@ -12,6 +12,8 @@ "trailing": true, "undef": true, "unused": true, - - "node": true + "node": true, + "globals": { + "define": false + } } diff --git a/package.json b/package.json index 1a089eb..e6c8d80 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "grunt-csscomb": "3.0.0", "grunt-git-authors": "2.0.0", "grunt-html": "1.6.0", - "grunt-jscs": "0.6.2", + "grunt-jscs": "2.0.0", "grunt-sass": "0.17.0", "grunt-selenium-server": "0.1.2", "grunt-svgmin": "2.0.0", diff --git a/scss/variables/chassis.js b/scss/variables/chassis.js index 99715df..3e5ec91 100644 --- a/scss/variables/chassis.js +++ b/scss/variables/chassis.js @@ -1,13 +1,13 @@ -// This is just boiuler plate dont worry about it +// This is just boiler plate dont worry about it // This just supports loading in any enviroment -(function ( root, factory ) { - if ( typeof define === "function" && define.amd ) { - define( [], factory ); - } else if ( typeof exports === "object" ) { - module.exports = factory(); - } else { - root.chassis = factory(); - } -}( this, function () { +( function( root, factory ) { + if ( typeof define === "function" && define.amd ) { + define( [], factory ); + } else if ( typeof exports === "object" ) { + module.exports = factory(); + } else { + root.chassis = factory(); + } +}( this, function() { return {}; -} ) ); \ No newline at end of file +} ) ); diff --git a/scss/variables/colors.js b/scss/variables/colors.js index 16a577e..5f7cb5d 100644 --- a/scss/variables/colors.js +++ b/scss/variables/colors.js @@ -1,12 +1,13 @@ -( function ( root, factory ) { - if ( typeof define === 'function' && define.amd ) { - define( [ "./chassis" ], factory ); - } else if (typeof exports === 'object') { - module.exports = factory( require('./chassis') ); - } else { - root.chassis = factory( root.chassis ); - } -}(this, function ( chassis ) { +( function( root, factory ) { + if ( typeof define === "function" && define.amd ) { + define( [ "./chassis" ], factory ); + } else if ( typeof exports === "object" ) { + module.exports = factory( require( "./chassis" ) ); + } else { + root.chassis = factory( root.chassis ); + } +}( this, function( chassis ) { + var colors = { "chassis-gray-dark": { "value": "#383838", @@ -32,7 +33,7 @@ var colors = { "value": "#fadf51", "name": "Chassis Yellow" } -} +}; chassis.colors = { "background": colors[ "chassis-gray-dark" ], "font": colors[ "chassis-gray-dark" ], @@ -43,6 +44,6 @@ chassis.colors = { name: "Chassis - Blockquote color", value: "#eee" } -} +}; return chassis; } ) ); diff --git a/scss/variables/index.js b/scss/variables/index.js index 840d981..3a414e4 100644 --- a/scss/variables/index.js +++ b/scss/variables/index.js @@ -7,4 +7,4 @@ fs.readdirSync( varPath ).forEach( function( file ) { chassis = require( path.join( process.cwd(), "scss/variables" ) + "/" + file ); } ); -module.exports = chassis; \ No newline at end of file +module.exports = chassis; diff --git a/scss/variables/template.js b/scss/variables/template.js index 1bc9c9a..6039c71 100644 --- a/scss/variables/template.js +++ b/scss/variables/template.js @@ -1,13 +1,14 @@ -// This is just boiuler plate dont worry about it +// This is just boiler plate dont worry about it // This just supports loading in any enviroment -(function ( root, factory ) { - if ( typeof define === "function" && define.amd ) { - define( [], factory ); - } else if ( typeof exports === "object" ) { - module.exports = factory(); - } else { - root.chassis = factory(); - } -}( this, function () { +( function( root, factory ) { + if ( typeof define === "function" && define.amd ) { + define( [], factory ); + } else if ( typeof exports === "object" ) { + module.exports = factory(); + } else { + root.chassis = factory(); + } +}( this, function() { + //>> return chasses.moduleName; } ) ); diff --git a/scss/variables/typography.js b/scss/variables/typography.js index 3b55a80..9a734e6 100644 --- a/scss/variables/typography.js +++ b/scss/variables/typography.js @@ -1,12 +1,12 @@ -( function ( root, factory ) { - if ( typeof define === 'function' && define.amd ) { +( function( root, factory ) { + if ( typeof define === "function" && define.amd ) { define( [ "./chassis" ], factory ); - } else if (typeof exports === 'object') { - module.exports = factory( require('./chassis') ); + } else if ( typeof exports === "object" ) { + module.exports = factory( require( "./chassis" ) ); } else { root.chassis = factory( root.chassis ); } -}(this, function ( chassis ) { +}( this, function( chassis ) { var color = "#222"; var fontSize = "20px"; @@ -43,15 +43,15 @@ chassis.typography = { }, monospace: { name: "Font Family - Monospace", - value :"\"courier new\", monospace" + value: "\"courier new\", monospace" }, serif: { name: "Font Family - Serif", - value :"Georgia, \"Times New Roman\", Times, serif" + value: "Georgia, \"Times New Roman\", Times, serif" }, sans: { name: "Font Family - Sans", - value :"Helvetica, Arial, sans-serif" + value: "Helvetica, Arial, sans-serif" } }; diff --git a/tasks/options/jscs.js b/tasks/options/jscs.js index bea072d..1a9796d 100644 --- a/tasks/options/jscs.js +++ b/tasks/options/jscs.js @@ -1,3 +1,3 @@ module.exports = { - all: [ "*.js", "performance/**/*.js" ] -}; \ No newline at end of file + all: [ "*.js", "performance/**/*.js", "scss/variables/**/*.js" ] +}; diff --git a/tasks/options/jshint.js b/tasks/options/jshint.js index 226c39e..dd71980 100644 --- a/tasks/options/jshint.js +++ b/tasks/options/jshint.js @@ -1,6 +1,6 @@ module.exports = { - files: [ "*.js", "performance/**/*.js" ], + files: [ "*.js", "performance/**/*.js", "scss/variables/**/*.js" ], options: { jshintrc: ".jshintrc" } -}; \ No newline at end of file +}; From 0f3472284c03d66f1cc324f5edc9d2fe440eaadc Mon Sep 17 00:00:00 2001 From: Rohit Mulange Date: Wed, 5 Aug 2015 02:47:29 +0530 Subject: [PATCH 2/2] Build: Correct Spacing --- performance/component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/performance/component.js b/performance/component.js index f8e6213..9438d32 100644 --- a/performance/component.js +++ b/performance/component.js @@ -7,7 +7,7 @@ var components = { html = ""; function render( i ) { - framework[ component ].variations[ keys[ i ] ].forEach(function( value ) { + framework[ component ].variations[ keys[ i ] ].forEach( function( value ) { current[ keys[ i ] ] = value; if ( i < keys.length - 1 ) { render( i + 1 ); @@ -17,7 +17,7 @@ var components = { html = html + framework[ component ].generator.call( this, current ); } } - }); + } ); } while ( currentCount < count ) { render( 0 );