From 1011487876c60f8aee62561ed2282a411b25e77a Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@mailbox.org> Date: Sat, 16 Dec 2023 16:30:55 +0100 Subject: [PATCH] update eslint plugins and run eslint --fix --- js/003-data/futureSocietyData.js | 14 ++++++++++++-- js/003-data/slaveBody.js | 2 +- js/003-data/slaveMods.js | 2 +- package.json | 6 +++--- src/endWeek/saServeThePublic.js | 2 +- src/endWeek/saStayConfined.js | 2 +- src/endWeek/saWorkAGloryHole.js | 2 +- src/events/eventUtils.js | 4 ++-- src/interaction/sellSlave.js | 2 +- src/interaction/siRules.js | 2 +- src/interaction/siWork.js | 6 +++--- src/interaction/slaveInteract.js | 2 +- src/js/makePurchase.js | 2 +- src/js/reminder.js | 2 +- src/js/slaveCostJS.js | 4 ++-- src/js/slaveSummaryHelpers.js | 2 +- src/js/upgrade.js | 4 ++-- src/js/utilsArcology.js | 2 +- src/js/utilsSlave.js | 6 +++--- 19 files changed, 39 insertions(+), 29 deletions(-) diff --git a/js/003-data/futureSocietyData.js b/js/003-data/futureSocietyData.js index 4543bd9a734..68d4ab30e72 100644 --- a/js/003-data/futureSocietyData.js +++ b/js/003-data/futureSocietyData.js @@ -17,12 +17,22 @@ App.Data.FutureSociety = { FSSlimnessEnthusiast: {noun: "Slimness Enthusiasm", adj: "Slimness Enthusiast", deco: "Slimness Enthusiast"}, FSAssetExpansionist: {noun: "Asset Expansionism", adj: "Asset Expansionist", deco: "Asset Expansionist"}, FSPastoralist: {noun: "Pastoralism", adj: "Pastoralist", deco: "Pastoralist"}, - FSCummunism: {noun: "Cummunism", adj: "Cummunist", deco: undefined, NPCOnly: true}, + FSCummunism: { + noun: "Cummunism", + adj: "Cummunist", + deco: undefined, + NPCOnly: true + }, FSPhysicalIdealist: {noun: "Physical Idealism", adj: "Physical Idealist", deco: "Physical Idealist"}, FSHedonisticDecadence: {noun: "Decadent Hedonism", adj: "Decadent Hedonist", deco: "Hedonistic"}, FSChattelReligionist: {noun: "Chattel Religionism", adj: "Chattel Religionist", deco: "Chattel Religionist"}, FSNull: {noun: "Multiculturalism", adj: "Multiculturalist", deco: undefined}, - FSIncestFetishist: {noun: "Incest Fetishism", adj: "Incest Fetishist", deco: undefined, NPCOnly: true}, + FSIncestFetishist: { + noun: "Incest Fetishism", + adj: "Incest Fetishist", + deco: undefined, + NPCOnly: true + }, FSRomanRevivalist: { noun: "Roman Revivalism", adj: "Roman Revivalist", diff --git a/js/003-data/slaveBody.js b/js/003-data/slaveBody.js index 7739c267722..553f2d29563 100644 --- a/js/003-data/slaveBody.js +++ b/js/003-data/slaveBody.js @@ -1,5 +1,5 @@ /** - * @typedef {Object} bodyPart + * @typedef {object} bodyPart * @property {"head"|"torso"|"arms"|"legs"} category * @property {function(App.Entity.SlaveState):boolean} [requirements] * @property {boolean} [isPair] diff --git a/js/003-data/slaveMods.js b/js/003-data/slaveMods.js index 77f22fa08da..8e1a5f7cb69 100644 --- a/js/003-data/slaveMods.js +++ b/js/003-data/slaveMods.js @@ -266,7 +266,7 @@ App.Medicine.Modification.Color = { ], }; /** - * @typedef {Object} hairStyle + * @typedef {object} hairStyle * @property {string} title * @property {FC.HairStyle} value * @property {number} [hLength] diff --git a/package.json b/package.json index 706037722a7..db57146c9d8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://gitgud.io/pregmodfan/fc-pregmod.git" }, "scripts": { - "lint": "eslint src/**/*.js", + "lint": "eslint src/**/*.js js/**/*.js", "compile": "sh compile.sh" }, "license": "GPL-3.0-only", @@ -19,8 +19,8 @@ "@types/mousetrap": "^1.6.3", "@types/twine-sugarcube": "^2.36.1", "eslint": "^8.0.0", - "eslint-plugin-jsdoc": "^37.0.0", - "eslint-plugin-sonarjs": "^0.11.0", + "eslint-plugin-jsdoc": "^46.0.0", + "eslint-plugin-sonarjs": "^0.23.0", "ts-essentials": "^9.1.1", "typescript": "^4.4.0" }, diff --git a/src/endWeek/saServeThePublic.js b/src/endWeek/saServeThePublic.js index 3737524d8de..b55f03bee4f 100644 --- a/src/endWeek/saServeThePublic.js +++ b/src/endWeek/saServeThePublic.js @@ -51,7 +51,7 @@ App.SlaveAssignment.serveThePublic = function saServeThePublic(slave) { /** * @param {App.Entity.SlaveState} slave - * @returns {Object} + * @returns {object} */ function gatherStatistics(slave) { const facility = (slave.assignment === Job.CLUB || slave.assignment === Job.DJ) ? V.facility.club : undefined; diff --git a/src/endWeek/saStayConfined.js b/src/endWeek/saStayConfined.js index 02233b05d7d..877bca10453 100644 --- a/src/endWeek/saStayConfined.js +++ b/src/endWeek/saStayConfined.js @@ -1,5 +1,5 @@ /** - * @typedef {Object} confinedResults + * @typedef {object} confinedResults * @property {string} text * @property {boolean} broken */ diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index 508d214c46b..0aa6e1e0023 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -24,7 +24,7 @@ App.SlaveAssignment.workAGloryHole = function saWorkAGloryHole(slave) { /** * @param {App.Entity.SlaveState} slave - * @returns {Object} + * @returns {object} */ function gatherStatistics(slave) { /* Statistics gathering */ diff --git a/src/events/eventUtils.js b/src/events/eventUtils.js index 6c902c9e2bc..c829719e33e 100644 --- a/src/events/eventUtils.js +++ b/src/events/eventUtils.js @@ -466,7 +466,7 @@ App.Events.auctionREFSArtifact = function(basePrice) { /** Queue an event for scheduled execution on a later week. Queued events are executed automatically at the end of Nonrandom Event on the chosen week. * @param {number} weeks - the number of weeks to wait before executing the event. 0 means execute this week, 1 execute next week, etc. Note that events generally cannot safely queue other events for the same week; they should always pass 1 or more in this parameter. Other parts of the game (Slave Interact, etc) can safely queue events for this week (i.e. the upcoming End Week cycle) by passing 0. * @param {App.Events.BaseEvent} event - the event to execute. note that this event is serialized normally, so changes to the class name or parameter structure will break the event in saved games! - * @param {Object} [params] - any parameters to serialize with the event. when the event executes, these will be accessible in "this.params". + * @param {object} [params] - any parameters to serialize with the event. when the event executes, these will be accessible in "this.params". */ App.Events.queueEvent = function(weeks, event, params = {}) { Object.assign(event.params, params); @@ -503,7 +503,7 @@ App.Events.runPassageEvent = function(event, node) { event.execute(node); } catch (ex) { // add the event name to any exceptions thrown from events, without altering the stack or other error data - const addEventName = (/** @type {Object} */e) => { e.event = eventName; }; + const addEventName = (/** @type {object} */e) => { e.event = eventName; }; if (ex instanceof Error) { addEventName(ex); throw ex; diff --git a/src/interaction/sellSlave.js b/src/interaction/sellSlave.js index 8a4e8e9afc5..3b4609a1587 100644 --- a/src/interaction/sellSlave.js +++ b/src/interaction/sellSlave.js @@ -836,7 +836,7 @@ App.Interact.sellSlave = function(slave) { } /** - * @typedef {Object} slaveBuyerData + * @typedef {object} slaveBuyerData * @property {number} cost * @property {string} offerDesc * @property {boolean} requirements diff --git a/src/interaction/siRules.js b/src/interaction/siRules.js index cc69840747c..64657cc1588 100644 --- a/src/interaction/siRules.js +++ b/src/interaction/siRules.js @@ -265,7 +265,7 @@ App.UI.SlaveInteract.rules = function(slave, refresh) { return frag; /** - * @typedef {Object} listChoice + * @typedef {object} listChoice * @property {string} value * @property {string} [title] * @property {string|HTMLElement|DocumentFragment} [tooltip] diff --git a/src/interaction/siWork.js b/src/interaction/siWork.js index f6fc1fccdc6..c1fc5105a99 100644 --- a/src/interaction/siWork.js +++ b/src/interaction/siWork.js @@ -298,12 +298,12 @@ App.UI.SlaveInteract.work = function(slave, refresh) { let el = document.createElement('div'); /** - * @typedef {Object} sexOption + * @typedef {object} sexOption * @property {string} text "Link text" * @property {string|App.Interact.BaseChoosePartnerRenderer|function():Node} [scene] * @property {string} [goto] if another passage is needed - * @property {Object} [updateSlave] update slave itself if needed, like {trust: 2}, - * @property {Object} [update] updates V., + * @property {object} [updateSlave] update slave itself if needed, like {trust: 2}, + * @property {object} [update] updates V., * @property {string} [note] if a note must appear after the link * @property {string} [disabled] */ diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 1581d938617..40efd6cd47b 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -68,7 +68,7 @@ App.UI.SlaveInteract.mainPage = function(slave) { el.append(App.UI.SlaveInteract.navigation(slave)); /** - * @typedef {Object} siCategory + * @typedef {object} siCategory * @property {string} title * @property {string} id * @property {DocumentFragment|HTMLElement} node diff --git a/src/js/makePurchase.js b/src/js/makePurchase.js index 1a13728e694..00b63e13fcd 100644 --- a/src/js/makePurchase.js +++ b/src/js/makePurchase.js @@ -3,7 +3,7 @@ * @param {string} text The text to display. * @param {number} cost The amount of ¤ the purchase costs. * @param {keyof App.Data.Records.LastWeeksCash} what What the purchase is for. - * @param {Object} [args] Any additional arguments to pass. + * @param {object} [args] Any additional arguments to pass. * @param {string[]} [args.notes] Any additional information to display. Must be lowercase and end in no punctuation. * @param {function():void} args.handler Any custom handler to run upon purchase. * @param {[boolean, string][]} [args.prereqs] Any prerequisites that must be met for the purchase to be available, with a note for when the prerequisites are not met. diff --git a/src/js/reminder.js b/src/js/reminder.js index adbe7cee2c5..667ff39ddb0 100644 --- a/src/js/reminder.js +++ b/src/js/reminder.js @@ -41,7 +41,7 @@ App.Reminders = (function() { } /** - * @param {Object} [obj] + * @param {object} [obj] * @param {number} [obj.maxFuture] how far into the future should reminders be displayed. * @param {function(FC.ReminderEntry):boolean} [obj.filter] * @param {boolean} [obj.link] permit passage links diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index 278ab8cd01c..4809016319f 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -2315,7 +2315,7 @@ globalThis.FResultTooltip = function(slave, forSale = 0) { * @param {boolean} [isSpecial] is this slave a special/hero slave * @param {boolean} [returnDOM] * @param {Array<{factor: number, reason: string}>} [modifiers] - * @returns {number|Object} + * @returns {number | object} */ globalThis.slaveCost = function(slave, isStartingSlave = false, followLaws = false, isSpecial = false, returnDOM = false, modifiers = []) { const milked = App.SlaveAssignment.getMilked(slave, 1.0, true); @@ -2437,7 +2437,7 @@ globalThis.slaveCost = function(slave, isStartingSlave = false, followLaws = fal * @param {boolean} followLaws Apply cost variations from enacted Slave Market Regulations * @param {boolean} isSpecial is this slave a special/hero slave * @param {Array<{factor: number, reason: string}>} modifiers market discounts, etc - * @returns {Object} + * @returns {object} */ globalThis.slaveCostBeauty = function(slave, isStartingSlave, followLaws, isSpecial, modifiers) { const arcology = V.arcologies[0]; diff --git a/src/js/slaveSummaryHelpers.js b/src/js/slaveSummaryHelpers.js index c535ee8a95f..5dfcc3fe444 100644 --- a/src/js/slaveSummaryHelpers.js +++ b/src/js/slaveSummaryHelpers.js @@ -170,7 +170,7 @@ App.UI.SlaveSummaryImpl = function() { } /** - * @typedef {Object} FSDatum + * @typedef {object} FSDatum * @property {number} active FS policy is active (0,1) * @property {number} strength FS decoration level divided by 10 */ diff --git a/src/js/upgrade.js b/src/js/upgrade.js index 49ee68f797e..c5ae3e58277 100644 --- a/src/js/upgrade.js +++ b/src/js/upgrade.js @@ -3,7 +3,7 @@ App.Upgrade = class Upgrade { /** * @param {string} property The variable name of the property. * @param {FC.IUpgradeTier[]} tiers A list of tiers available for the upgrade. - * @param {Object} [object] Any object to attach the upgrade to, if not the default `V`. + * @param {object} [object] Any object to attach the upgrade to, if not the default `V`. */ constructor(property, tiers, object = V) { /** @private */ @@ -112,7 +112,7 @@ App.Upgrade = class Upgrade { /** * The object the upgrade is attached to. * - * @returns {Object} + * @returns {object} */ get object() { return this._object; diff --git a/src/js/utilsArcology.js b/src/js/utilsArcology.js index 50502a724d3..3ad6588c3a1 100644 --- a/src/js/utilsArcology.js +++ b/src/js/utilsArcology.js @@ -35,7 +35,7 @@ App.Utils.schoolCounter = function() { }; /** - * @typedef {Object} menialObject + * @typedef {object} menialObject * @property {string} text * @property {number} value */ diff --git a/src/js/utilsSlave.js b/src/js/utilsSlave.js index 71b4e46dd85..d66f556404e 100644 --- a/src/js/utilsSlave.js +++ b/src/js/utilsSlave.js @@ -2997,7 +2997,7 @@ globalThis.induceLactation = function(slave, induce = 0) { /** * @param {string} targetSkill - Skill to be checked. - * @param {Object} slave - Slave to be checked. + * @param {object} slave - Slave to be checked. * @param {number} [skillIncrease=1] * @returns {string} */ @@ -3417,8 +3417,8 @@ globalThis.applyMindbroken = function(slave, oldIntelligence = -200) { /** * Compares two slaves and returns differences - * @param {Object} edited - * @param {Object} original + * @param {object} edited + * @param {object} original * @param {function(string): void} dispatch * @param {string} crumb */ -- GitLab