Dev environment : closure compiler + jshint update

Fixed error raised by closure compiler
Added es3 option to jshint (detect trailing commas)
Added curly option to jshint (missing curly braces for if/for blocks)
Removed trailing whitespaces (not enforced through jshint though)
This commit is contained in:
Julian Descottes
2013-09-28 23:52:51 +02:00
parent b254c582b9
commit ca427e0853
26 changed files with 136 additions and 129 deletions

View File

@@ -36,6 +36,8 @@ module.exports = function(grunt) {
undef : true, undef : true,
latedef : true, latedef : true,
browser : true, browser : true,
curly : true,
es3 : true,
globals : {'$':true, 'jQuery' : true, 'pskl':true, 'Events':true, 'Constants':true, 'console' : true, 'module':true, 'require':true} globals : {'$':true, 'jQuery' : true, 'pskl':true, 'Events':true, 'Constants':true, 'console' : true, 'module':true, 'require':true}
}, },
files: [ files: [
@@ -61,17 +63,17 @@ module.exports = function(grunt) {
} }
}, },
ghost : { ghost : {
default : getGhostConfig(3000), 'default' : getGhostConfig(3000),
local : getGhostConfig(50) local : getGhostConfig(50)
}, },
concat : { concat : {
options : { options : {
separator : ';', separator : ';'
}, },
dist : { dist : {
src : piskelScripts, src : piskelScripts,
dest : 'build/piskel-packaged.js', dest : 'build/piskel-packaged.js'
}, }
}, },
uglify : { uglify : {
options : { options : {

View File

@@ -53,7 +53,7 @@
[1], [1],
[5], [5],
[10,true], //default [10,true], //default
[20], [20]
]; ];
for (var i = 0 ; i < dpis.length ; i++) { for (var i = 0 ; i < dpis.length ; i++) {

View File

@@ -56,7 +56,10 @@
// Do what you need to for this // Do what you need to for this
pixels.push({"col": x0, "row": y0}); pixels.push({"col": x0, "row": y0});
if ((x0==x1) && (y0==y1)) break; if ((x0==x1) && (y0==y1)) {
break;
}
var e2 = 2*err; var e2 = 2*err;
if (e2>-dy){ if (e2>-dy){
err -= dy; err -= dy;

View File

@@ -34,8 +34,10 @@ if (typeof Function.prototype.bind !== "function") {
var ns = $.namespace("pskl.utils"); var ns = $.namespace("pskl.utils");
ns.rgbToHex = function(r, g, b) { ns.rgbToHex = function(r, g, b) {
if (r > 255 || g > 255 || b > 255) if (r > 255 || g > 255 || b > 255) {
throw "Invalid color component"; throw "Invalid color component";
}
return ((r << 16) | (g << 8) | b).toString(16); return ((r << 16) | (g << 8) | b).toString(16);
}; };