From a0fdb2f76be8ff21d0dfc1cd30f82b208d340dec Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Sun, 17 Mar 2019 16:44:17 -0400
Subject: [PATCH] Revert "Revert "Fixed the Farmyard report, marked ESLint
 problems""

This reverts commit 582a28f0e1cdaca1b29c0c474d55afda7f4edd6c.
---
 src/facilities/farmyard/farmyardReport.tw |  2 +-
 src/js/economyJS.js                       |  6 +++---
 src/js/rulesAssistantOptions.js           | 12 ++++++------
 src/js/slaveSummaryWidgets.js             | 13 +++++++------
 4 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/facilities/farmyard/farmyardReport.tw b/src/facilities/farmyard/farmyardReport.tw
index 2338cb6e9e1..9dc4adabd91 100644
--- a/src/facilities/farmyard/farmyardReport.tw
+++ b/src/facilities/farmyard/farmyardReport.tw
@@ -203,7 +203,7 @@
 		<<set $i = $slaveIndices[$FarmyardiIDs[_dI]]>>
 		<<setLocalPronouns $slaves[$i]>>
 		/* Perform facility based rule changes */
-		<<set $slaves[$i].health += _healthBonus, $slaves[$i].aphrodisiacs = _aphrod>>
+		<<set $slaves[$i].health += _healthBonus>>
 		<<switch $farmyardDecoration>>
 		<<case "Degradationist" "standard">>	/* TODO: add the rest of the FS */
 			<<set $slaves[$i].livingRules = "spare">>
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index c27a61ba457..f6cff1e7848 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -269,21 +269,21 @@ window.getSecurityExpansionCost = function() {
 			soldierMod = 2;
 		}
 		if (State.variables.militiaUnits !== null) {
-			for (var i = 0; i < State.variables.militiaUnits.length; i++) {
+			for (let i = 0; i < State.variables.militiaUnits.length; i++) {
 				if (State.variables.militiaUnits[i] !== null) {
 					secExpCost += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep * soldierMod;
 				}
 			}
 		}
 		if (State.variables.slaveUnits !== null) {
-			for (var i = 0; i < State.variables.slaveUnits.length; i++) {
+			for (let i = 0; i < State.variables.slaveUnits.length; i++) {
 				if (State.variables.slaveUnits[i] !== null) {
 					secExpCost += State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5 * soldierMod;
 				}
 			}
 		}
 		if (State.variables.mercUnits !== null) {
-			for (var i = 0; i < State.variables.mercUnits.length; i++) {
+			for (let i = 0; i < State.variables.mercUnits.length; i++) {
 				if (State.variables.mercUnits[i] !== null) {
 					secExpCost += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5 * soldierMod;
 				}
diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js
index 4e084ac766c..67a0738df41 100644
--- a/src/js/rulesAssistantOptions.js
+++ b/src/js/rulesAssistantOptions.js
@@ -22,7 +22,7 @@ window.rulesAssistantOptions = (function() {
 			else
 				current_rule = V.defaultRules[idx];
 		}
-		const root = new Root(element);
+		const root = new Root(element);	/** FIXME: 'root' is declared but its value is never read.ts(6133) */
 	}
 
 	function returnP(e) { return e.keyCode === 13; }
@@ -212,7 +212,7 @@ window.rulesAssistantOptions = (function() {
 				this.value.innerHTML = ""+what;
 		}
 
-		getData(what) {
+		getData(what) {	/** FIXME: 'what' is declared but its value is never read.ts(6133) */
 			return (this.value.tagName === "INPUT" ? this.parse(this.value.value): this.selectedItem.data);
 		}
 
@@ -300,7 +300,7 @@ window.rulesAssistantOptions = (function() {
 			this.label = label;
 			this.onclick = onclick;
 		}
-		render(label, onclick) {
+		render(label, onclick) {	/** FIXME: 'onclick' is declared but its value is never read.ts(6133) */
 			const elem = document.createElement("span");
 			elem.classList.add("rajs-listitem");
 			elem.innerHTML = label;
@@ -670,7 +670,7 @@ window.rulesAssistantOptions = (function() {
 			min.setAttribute("type", "text");
 			min.value = "" + data.value[0];
 			min.onkeypress = e => { if (returnP(e)) this.setmin(min.value); };
-			min.onblur = e => this.setmin(min.value);
+			min.onblur = e => this.setmin(min.value);	/** FIXME: 'e' is declared but its value is never read.ts(6133) */
 			this.min = min;
 			elem.appendChild(min);
 
@@ -684,7 +684,7 @@ window.rulesAssistantOptions = (function() {
 			max.setAttribute("type", "text");
 			max.value = "" + data.value[1];
 			max.onkeypress = e => { if (returnP(e)) this.setmax(max.value); };
-			max.onblur = e => this.setmax(max.value);
+			max.onblur = e => this.setmax(max.value);	/** FIXME: 'e' is declared but its value is never read.ts(6133) */
 			this.max = max;
 			elem.appendChild(max);
 
@@ -743,7 +743,7 @@ window.rulesAssistantOptions = (function() {
 			input.setAttribute("type", "text");
 			input.value = JSON.stringify(data.value);
 			input.onkeypress = e => { if (returnP(e)) this.setValue(input); };
-			input.onblur = e => this.setValue(input);
+			input.onblur = e => this.setValue(input);	/** FIXME: 'e' is declared but its value is never read.ts(6133) */
 			this.input = input;
 			elem.appendChild(input);
 
diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js
index f5729d019cb..6296b71d796 100644
--- a/src/js/slaveSummaryWidgets.js
+++ b/src/js/slaveSummaryWidgets.js
@@ -4861,7 +4861,7 @@ App.UI.slaveSummaryList = function (passageName) {
 		if ("object" === typeof attributes)
 			attributes = $.map(attributes, (val, key) => key + '="' + val + '"').join(" ");
 		else
-			attributes = 'id="' + String(this.args[0]).trim() + '"'; /** TODO: If a strict mode function is executed using function invocation, its 'this' value will be undefined. jshint(W040) */
+			attributes = 'id="' + String(this.args[0]).trim() + '"'; /** FIXME: If a strict mode function is executed using function invocation, its 'this' value will be undefined. jshint(W040) */
 
 		return '<' + htag + ' ' + attributes + '>' + payload + '</' + htag + '>';
 	}
@@ -4906,8 +4906,8 @@ App.UI.slaveSummaryList = function (passageName) {
 		 */
 
 		if (((_Count > 1) && (_indexed === 0) && (((passageName === 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs === 0) || (V.slaveAssignmentTab === "all"))) || (V.Flag === 1)))) {
-			let _indexed = 1,
-				_counter = 0,
+			let _indexed = 1, /** FIXME: '_indexed' is declared but its value is never read.ts(6133) */
+				_counter = 0, /** FIXME: '_counter' is declared but its value is never read.ts(6133) */
 				_buttons = [],
 				_offset = -50;
 			if (/Select/i.test(passageName)) {
@@ -4988,7 +4988,7 @@ App.UI.slaveSummaryList = function (passageName) {
 
 		const _slaveName = SlaveFullName(_Slave);
 
-		let _tableCount = 0;
+		let _tableCount = 0;	/** FIXME: '_tableCount' is declared but its value is never read.ts(6133) */
 		let slaveImagePrinted = (V.seeImages === 1) && (V.seeSummaryImages === 1);
 
 		res.push('<div id="slave_' + _Slave.ID + '" style="clear:both">');
@@ -4997,7 +4997,7 @@ App.UI.slaveSummaryList = function (passageName) {
 			case "Main":
 				if ((_Slave.choosesOwnClothes === 1) && (_Slave.clothes === "choosing her own clothes")) {
 					const _oldDevotion = _Slave.devotion;
-					const _chosenClothes = saChoosesOwnClothes(_Slave);
+					const _chosenClothes = saChoosesOwnClothes(_Slave);	/** FIXME: '_chosenClothes' is declared but its value is never read.ts(6133) */
 					slaves[_ssi].devotion = _oldDevotion;
 					_Slave = slaves[_ssi]; /* restore devotion value so repeatedly changing clothes isn't an exploit */
 				}
@@ -5006,7 +5006,8 @@ App.UI.slaveSummaryList = function (passageName) {
 				else if ("recruit girls" === _Slave.assignment) res.push('<strong>@@.lightcoral;RC@@</strong> ');
 				else if ("guard you" === _Slave.assignment) res.push('<strong>@@.lightcoral;BG@@</strong> ');
 
-				if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1) {
+				if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1)	/** FIXME: Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (_Slave) jshint(W083) */
+				{
 					res.push('<strong>@@.lightcoral; PA@@</strong> ');
 				}
 				res.push(this.passageLink(_slaveName, 'Slave Interact', `$activeSlave = $slaves[${_ssi}]`)); /* lists their names */
-- 
GitLab