Fix eslint and lint the codebase

This commit is contained in:
Oliver 2026-03-16 22:01:06 -06:00
parent 23a402f11a
commit 761f0b6563
6 changed files with 22 additions and 12 deletions

View file

@ -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` }],

View file

@ -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;
};

View file

@ -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,

View file

@ -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`) {

View file

@ -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";

View file

@ -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.