diff --git a/sanityCheck.sh b/sanityCheck.sh index a9b919314930efd96725e8ec6b1c08de17f5abc8..e78439d5781459a5e5daf28d9a5025b67462f9f2 100755 --- a/sanityCheck.sh +++ b/sanityCheck.sh @@ -121,6 +121,10 @@ $GREP -E "@@(\.|,|;|:)\s" -- src/*.tw | myprint "WrongSelectorPunctuation" $GREP "@@[a-z]\+;" -- 'src/*' | myprint "SelectorMissingDot" # Check for </span>. instead of .</span> $GREP -E "</span>(\.|,|;|:)\s" -- src/*.js | myprint "WrongSelectorPunctuation" +# Check for missing whitespace between operators +#$GREP -E "\(.(\+|\-|\*|\/|\=)." -- src/*.js --exclude={dTree,dTree.min,format,Jquery,mousetrap}.js | myprint "MissingWhitespace" // can't quite get this to work +# Check for @@ selector instead of <span> selector +$GREP -E "@@\." -- src/*.js | myprint "WrongSelectorUsed" # Check that we do not have any variables that we use only once. e.g. $onlyUsedOnce # Ignore *Nationalities diff --git a/src/endWeek/saRest.js b/src/endWeek/saRest.js index cd32de24646df7155de4da6c5142851baa9732ea..771b3e49ea246d2041612a6ac6823c46d3cb196e 100644 --- a/src/endWeek/saRest.js +++ b/src/endWeek/saRest.js @@ -92,7 +92,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav } else { t += `an incident without lasting effect.`; } - slave.devotion += (1*_vignette.effect); + slave.devotion += (1 * _vignette.effect); } else if (_vignette.type === "trust") { if (_vignette.effect > 0) { if (slave.trust > 20) { @@ -113,7 +113,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav } else { t += `an incident without lasting effect.`; } - slave.trust += (1*_vignette.effect); + slave.trust += (1 * _vignette.effect); } else if (_vignette.type === "health") { if (_vignette.effect > 0) { t += `<span class='green'>improving ${his} health.</span>`; @@ -122,7 +122,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav } else { t += `an incident without lasting effect.`; } - slave.health += (2*_vignette.effect); + slave.health += (2 * _vignette.effect); } else { if (_vignette.effect > 0) { t += `<span class='green'>gaining you a bit of reputation.</span>`; diff --git a/src/js/utilJS.js b/src/js/utilJS.js index f525e80cd249c44f813a43ee8958053a4a9a14cf..d999102978187378875ae65fb079dc04b1acd051 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -815,7 +815,7 @@ window.generateNewID = function generateNewID() { let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { let r = (date + Math.random()*16)%16 | 0; date = Math.floor(date/16); - return (c==="x" ? r : (r & 0x3 | 0x8)).toString(16); + return (c ==="x" ? r : (r & 0x3 | 0x8)).toString(16); }); return uuid; }; @@ -943,7 +943,7 @@ window.dickToInchString = function(s) { // takes a dick value e.g. $activeSlave.dick, returns an int of the dick length in cm window.dickToCM = function(s) { - return (s<9?s*5:(s===9?50:s*6)); + return (s < 9 ? s * 5 : (s === 9 ? 50 : s * 6)); // TODO: use if blocks instead of nested ternary operators for readibility? }; // takes a ball value e.g. $activeSlave.balls, returns a string in the format 3 inches diff --git a/src/js/wombJS.js b/src/js/wombJS.js index 5ebbf4ea90e34800cf4dc6be64fb11abbe52ec73..2fb2c454e27d8f67fadb7a10c26fe1a3827743b2 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -83,7 +83,7 @@ window.WombInit = function(actor) { window.WombImpregnate = function(actor, fCount, fatherID, age, surrogate) { let i; let tf; - for (i=0; i<fCount; i++) { + for (i = 0; i < fCount; i++) { tf = {}; // new Object tf.age = age; // initial age tf.realAge = 1; // initial real age (first week in mother) @@ -128,7 +128,7 @@ window.WombSurrogate = function (actor, fCount, mother, fatherID, age) { window.WombImpregnateClone = function(actor, fCount, mother, motherOriginal, age) { let i; let tf; - for (i=0; i<fCount; i++) { + for (i = 0; i < fCount; i++) { tf = {}; // new Object tf.age = age; // initial age tf.realAge = 1; // initial real age (first week in mother) @@ -216,7 +216,7 @@ window.WombBirth = function (actor, readyAge) { let ready = WombBirthReady(actor, readyAge); let i; - for (i=0; i<ready; i++) { // here can't be used "for .. in .." syntax. + for ( i = 0; i < ready; i++) { // here can't be used "for .. in .." syntax. birthed.push(actor.womb.shift()); }