From 761f0b656370ae9293aa2918a5097267257d600f Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 16 Mar 2026 22:01:06 -0600 Subject: [PATCH] Fix eslint and lint the codebase --- eslint.config.mjs | 13 +++++++++++-- module/apps/AttributeManager.mjs | 11 ++++++----- module/apps/GenericItemSheet.mjs | 2 +- module/documents/Actor.mjs | 2 +- module/hooks/init.mjs | 4 ++-- module/hooks/renderSettingsConfig.mjs | 2 +- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7c89266..70c0b59 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -29,7 +29,7 @@ export default [ // v14 Additions: _loc: `readonly`, - _del: `reaonly`, + _del: `readonly`, _replace: `readonly`, }, }, @@ -72,7 +72,16 @@ export default [ "@stylistic/space-infix-ops": `warn`, "@stylistic/eol-last": `warn`, "@stylistic/operator-linebreak": [`warn`, `before`], - "@stylistic/indent": [`warn`, `tab`], + "@stylistic/indent": [ + `warn`, + `tab`, + { + SwitchCase: 1, + ignoredNodes: [ + `.superClass CallExpression`, + ], + }, + ], "@stylistic/brace-style": [`off`], "@stylistic/quotes": [`warn`, `backtick`, { "avoidEscape": true }], "@stylistic/comma-dangle": [`warn`, { arrays: `always-multiline`, objects: `always-multiline`, imports: `always-multiline`, exports: `always-multiline`, functions: `always-multiline` }], diff --git a/module/apps/AttributeManager.mjs b/module/apps/AttributeManager.mjs index 7ca3bf4..6b159c3 100644 --- a/module/apps/AttributeManager.mjs +++ b/module/apps/AttributeManager.mjs @@ -1,6 +1,6 @@ import { __ID__, filePath } from "../consts.mjs"; -import { attributeSorter } from "../utils/attributeSort.mjs"; import { ask } from "../utils/DialogManager.mjs"; +import { attributeSorter } from "../utils/attributeSort.mjs"; import { localizer } from "../utils/localizer.mjs"; import { toID } from "../utils/toID.mjs"; @@ -29,7 +29,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) label: `Save As Defaults`, visible: () => game.user.isGM, action: `saveAsDefault`, - } + }, ], }, form: { @@ -137,7 +137,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) const attrs = []; for (const [id, data] of Object.entries(this.#attributes)) { if (data == null) { continue }; - if (game.release.generation >= 14 && data == _del) continue; + if (game.release.generation >= 14 && data == _del) {continue} attrs.push({ id, name: data.name, @@ -150,7 +150,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }; // #endregion Data Prep -// #region Actions + // #region Actions /** * @param {Event} event */ @@ -227,7 +227,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }, ], }, - { type: `divider` } + { type: `divider` }, ); continue; }; @@ -254,6 +254,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) switch (response.state) { case `errored`: ui.notifications.error(response.error); + // eslint-disable-next-line no-fallthrough case `fronted`: return; }; diff --git a/module/apps/GenericItemSheet.mjs b/module/apps/GenericItemSheet.mjs index 5b37eac..f392a85 100644 --- a/module/apps/GenericItemSheet.mjs +++ b/module/apps/GenericItemSheet.mjs @@ -40,7 +40,7 @@ export class GenericItemSheet extends HandlebarsApplicationMixin(ItemSheetV2) { meta: { idp: this.id, editable: this.isEditable, - limited: this.isLimited + limited: this.isLimited, }, item: this.item, system: this.item.system, diff --git a/module/documents/Actor.mjs b/module/documents/Actor.mjs index ece866c..bebc21d 100644 --- a/module/documents/Actor.mjs +++ b/module/documents/Actor.mjs @@ -90,7 +90,7 @@ export class TAFActor extends Actor { // #region Getters #sortedTypes = null; get itemTypes() { - if (this.#sortedTypes) return this.#sortedTypes; + if (this.#sortedTypes) { return this.#sortedTypes }; const types = {}; for (const item of this.items) { if (item.type !== `generic`) { diff --git a/module/hooks/init.mjs b/module/hooks/init.mjs index 0fd7c19..a6f623e 100644 --- a/module/hooks/init.mjs +++ b/module/hooks/init.mjs @@ -1,12 +1,12 @@ // Apps import { AttributeOnlyPlayerSheet } from "../apps/AttributeOnlyPlayerSheet.mjs"; +import { GenericItemSheet } from "../apps/GenericItemSheet.mjs"; import { PlayerSheet } from "../apps/PlayerSheet.mjs"; import { SingleModePlayerSheet } from "../apps/SingleModePlayerSheet.mjs"; -import { GenericItemSheet } from "../apps/GenericItemSheet.mjs"; // Data Models -import { PlayerData } from "../data/Actor/player.mjs"; import { GenericItemData } from "../data/Item/generic.mjs"; +import { PlayerData } from "../data/Actor/player.mjs"; // Documents import { TAFActor } from "../documents/Actor.mjs"; diff --git a/module/hooks/renderSettingsConfig.mjs b/module/hooks/renderSettingsConfig.mjs index 62eb341..a75c55c 100644 --- a/module/hooks/renderSettingsConfig.mjs +++ b/module/hooks/renderSettingsConfig.mjs @@ -1,6 +1,6 @@ import { __ID__ } from "../consts.mjs"; -Hooks.on(`renderSettingsConfig`, (app, html, context, options) => { +Hooks.on(`renderSettingsConfig`, (app, html) => { /* This section is used to insert a button into the settings config that unsets a world setting when it exists but doesn't allow any other form of editing it.