From 5d951d043ba3b56c6750d5e6aab22071aafbbe7e Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 26 Apr 2026 19:39:44 -0600 Subject: [PATCH] Lint and cleanup unused code --- module/api.mjs | 2 +- module/apps/AttributeItemSheet.mjs | 1 - module/apps/PlayerSheet.mjs | 5 ++--- module/data/Item/attribute.mjs | 3 ++- module/documents/Actor.mjs | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/module/api.mjs b/module/api.mjs index c294981..698f141 100644 --- a/module/api.mjs +++ b/module/api.mjs @@ -5,7 +5,7 @@ import { PlayerSheet } from "./apps/PlayerSheet.mjs"; import { QueryStatus } from "./apps/QueryStatus.mjs"; // Utils -import { toID, isValidID, } from "./utils/toID.mjs"; +import { isValidID, toID } from "./utils/toID.mjs"; import { attributeSorter } from "./utils/attributeSort.mjs"; import { DialogManager } from "./utils/DialogManager.mjs"; import { localizer } from "./utils/localizer.mjs"; diff --git a/module/apps/AttributeItemSheet.mjs b/module/apps/AttributeItemSheet.mjs index d39b3f0..bc33f6c 100644 --- a/module/apps/AttributeItemSheet.mjs +++ b/module/apps/AttributeItemSheet.mjs @@ -3,7 +3,6 @@ import { TAFDocumentSheetMixin } from "./mixins/TAFDocumentSheetMixin.mjs"; const { HandlebarsApplicationMixin } = foundry.applications.api; const { ItemSheetV2 } = foundry.applications.sheets; -const { setProperty } = foundry.utils; export class AttributeItemSheet extends TAFDocumentSheetMixin( diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index 4a1bbed..2e3da97 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -98,7 +98,6 @@ export class PlayerSheet extends * they occur. */ #expandedItems = new Set(); - #collapsedAttributeGroups = new Set(); /** * This method is used in order to ensure that when we hide specific @@ -317,7 +316,7 @@ export class PlayerSheet extends for (const attr of attrs) { if (attr.system.aboveTheFold) { continue }; - const groupName = attr.system.group ?? "Attributes"; + const groupName = attr.system.group ?? `Attributes`; if (!groups.has(groupName)) { groups.set(groupName, { name: groupName.titleCase(), @@ -374,7 +373,7 @@ export class PlayerSheet extends for (const item of items) { summedWeight += item.system.quantifiedWeight ?? 0; const data = await this._prepareItem(item); - if (data) preparedItems.push(data); + if (data) { preparedItems.push(data) }; }; totalWeight += summedWeight; diff --git a/module/data/Item/attribute.mjs b/module/data/Item/attribute.mjs index b8e6ea3..91ebcb5 100644 --- a/module/data/Item/attribute.mjs +++ b/module/data/Item/attribute.mjs @@ -90,7 +90,7 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel { const max = getProperty(data, `system.max`) ?? this.max; let min = getProperty(data, `system.min`) ?? this.min; - if (max != null) { min ??= 0; }; + if (max != null) { min ??= 0 }; setProperty(data, `system.value`, clamp(min, value, max)); }; @@ -106,6 +106,7 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel { if (this.isRange) { return this.min ?? 0; }; + return null; }; // #endregion Methods }; diff --git a/module/documents/Actor.mjs b/module/documents/Actor.mjs index 22f7881..ac58f4b 100644 --- a/module/documents/Actor.mjs +++ b/module/documents/Actor.mjs @@ -47,7 +47,7 @@ export class TAFActor extends Actor { `modifyTokenAttribute`, { attribute, value, isDelta, isBar, isEmbedded: true }, updates, - this + this, ); return allowed !== false ? await attr.update(updates) : this;