From 3dd3139281593e8f8b4d1834e38ead95dfdb8e49 Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Wed, 8 Oct 2025 23:10:15 -0600 Subject: [PATCH] Update the brace format from 1tbs to stroustrup --- eslint.config.mjs | 2 +- module/Apps/ActorSheets/CraftCardV1.mjs | 3 ++- module/Apps/ActorSheets/SkillsCardV1.mjs | 3 ++- module/Apps/DelveDiceHUD.mjs | 6 ++++-- module/Apps/components/mixins/StyledShadowElement.mjs | 3 ++- module/consts.mjs | 6 ++++-- module/data/Item/Weapon.mjs | 3 ++- module/dice/CryptDie.mjs | 3 ++- module/documents/combat.mjs | 6 ++++-- module/documents/combatant.mjs | 3 ++- module/documents/token.mjs | 3 ++- module/hooks/ready.mjs | 3 ++- module/sockets/updateSands.mjs | 3 ++- 13 files changed, 31 insertions(+), 16 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index c18baac..4ef4c09 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -75,7 +75,7 @@ export default [ "@stylistic/eol-last": `warn`, "@stylistic/operator-linebreak": [`warn`, `before`], "@stylistic/indent": [`warn`, `tab`], - "@stylistic/brace-style": [`warn`, `1tbs`, { "allowSingleLine": true }], + "@stylistic/brace-style": [`warn`, `stroustrup`, { "allowSingleLine": true }], "@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` }], "@stylistic/comma-style": [`warn`, `last`], diff --git a/module/Apps/ActorSheets/CraftCardV1.mjs b/module/Apps/ActorSheets/CraftCardV1.mjs index 808843d..4a650df 100644 --- a/module/Apps/ActorSheets/CraftCardV1.mjs +++ b/module/Apps/ActorSheets/CraftCardV1.mjs @@ -115,7 +115,8 @@ export class CraftCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(Acto const length = crafts.length; if (length >= limit) { crafts = crafts.slice(0, limit); - } else { + } + else { crafts = crafts .concat(Array(limit - length).fill(null)) .slice(0, limit); diff --git a/module/Apps/ActorSheets/SkillsCardV1.mjs b/module/Apps/ActorSheets/SkillsCardV1.mjs index 9be3429..b0231f3 100644 --- a/module/Apps/ActorSheets/SkillsCardV1.mjs +++ b/module/Apps/ActorSheets/SkillsCardV1.mjs @@ -194,7 +194,8 @@ export class SkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(Act const length = ctx.skills[ability].length; if (length >= limit) { ctx.skills[ability] = ctx.skills[ability].slice(0, limit); - } else { + } + else { ctx.skills[ability] = ctx.skills[ability] .concat(Array(limit - length).fill(null)) .slice(0, limit); diff --git a/module/Apps/DelveDiceHUD.mjs b/module/Apps/DelveDiceHUD.mjs index e9a6f2f..9599fa1 100644 --- a/module/Apps/DelveDiceHUD.mjs +++ b/module/Apps/DelveDiceHUD.mjs @@ -88,7 +88,8 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) { const existing = document.getElementById(element.id); if (existing) { existing.replaceWith(element); - } else { + } + else { const parent = document.getElementById(`ui-top`); parent.prepend(element); }; @@ -292,7 +293,8 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) { if (delta === 0 || !shouldUpdateSands) { return }; if (game.user.isActiveGM) { ui.delveDice.sandsOfFateDelta(delta); - } else { + } + else { game.socket.emit(`system.ripcrypt`, { event: `updateSands`, payload: { delta }, diff --git a/module/Apps/components/mixins/StyledShadowElement.mjs b/module/Apps/components/mixins/StyledShadowElement.mjs index e5ef291..37f81d1 100644 --- a/module/Apps/components/mixins/StyledShadowElement.mjs +++ b/module/Apps/components/mixins/StyledShadowElement.mjs @@ -51,7 +51,8 @@ export function StyledShadowElement(Base) { const stylePath = this.constructor._stylePath; if (this.constructor._styles.has(stylePath)) { this._style.innerHTML = this.constructor._styles.get(stylePath); - } else { + } + else { fetch(`./systems/${game.system.id}/templates/${stylePath}`) .then(r => r.text()) .then(t => { diff --git a/module/consts.mjs b/module/consts.mjs index 405707e..ee88a31 100644 --- a/module/consts.mjs +++ b/module/consts.mjs @@ -42,9 +42,11 @@ export function toBoolean(val) { export function documentSorter(a, b) { if (!a && !b) { return 0; - } else if (!a) { + } + else if (!a) { return 1; - } else if (!b) { + } + else if (!b) { return -1; }; diff --git a/module/data/Item/Weapon.mjs b/module/data/Item/Weapon.mjs index 420149d..ec35f29 100644 --- a/module/data/Item/Weapon.mjs +++ b/module/data/Item/Weapon.mjs @@ -199,7 +199,8 @@ export class WeaponData extends CommonItemData { value: this.range.long, }, }); - } else { + } + else { fields.push({ id: `short-range`, type: `integer`, diff --git a/module/dice/CryptDie.mjs b/module/dice/CryptDie.mjs index 9f304d2..4da7ce7 100644 --- a/module/dice/CryptDie.mjs +++ b/module/dice/CryptDie.mjs @@ -38,7 +38,8 @@ export class CryptDie extends Die { if (almostCrypted) { this.ripCryptState = `crypted`; break; - } else { + } + else { almostCrypted = true; } } diff --git a/module/documents/combat.mjs b/module/documents/combat.mjs index 0e3936f..f2aeb4b 100644 --- a/module/documents/combat.mjs +++ b/module/documents/combat.mjs @@ -16,7 +16,8 @@ export class RipCryptCombat extends Combat { if (groups.has(groupKey)) { groups.get(groupKey).push(combatant); - } else { + } + else { groups.set(groupKey, [combatant]); }; }; @@ -129,7 +130,8 @@ export class RipCryptCombat extends Combat { const currentToken = this.combatant?.token?._object; if (!tokenGroup && currentToken) { currentToken.renderFlags.set({refreshTurnMarker: true}); - } else { + } + else { const group = this.customGroups.get(tokenGroup) ?? []; for (const combatant of group) { combatant.token?._object?.renderFlags.set({ refreshTurnMarker: true }); diff --git a/module/documents/combatant.mjs b/module/documents/combatant.mjs index 0594db5..128f042 100644 --- a/module/documents/combatant.mjs +++ b/module/documents/combatant.mjs @@ -28,7 +28,8 @@ export class RipCryptCombatant extends Combatant { const disposition = this.disposition; if (disposition === `unknown`) { total += 0.25; - } else if (whoFirst !== disposition) { + } + else if (whoFirst !== disposition) { total += 0.5; }; }; diff --git a/module/documents/token.mjs b/module/documents/token.mjs index c4913fe..9492339 100644 --- a/module/documents/token.mjs +++ b/module/documents/token.mjs @@ -26,7 +26,8 @@ export class RipCryptToken extends Token { }; canvas.tokens.turnMarkers.add(this); this.turnMarker.draw(); - } else if (this.turnMarker) { + } + else if (this.turnMarker) { canvas.tokens.turnMarkers.delete(this); this.turnMarker.destroy(); this.turnMarker = null; diff --git a/module/hooks/ready.mjs b/module/hooks/ready.mjs index 71e9c99..e77e0e7 100644 --- a/module/hooks/ready.mjs +++ b/module/hooks/ready.mjs @@ -9,7 +9,8 @@ Hooks.once(`ready`, () => { try { Logger.debug(`Switching sidebar tab to:`, defaultTab); ui.sidebar.changeTab(defaultTab, `primary`); - } catch { + } + catch { Logger.error(`Failed to change to sidebar tab:`, defaultTab); }; }; diff --git a/module/sockets/updateSands.mjs b/module/sockets/updateSands.mjs index f74d007..8560b6d 100644 --- a/module/sockets/updateSands.mjs +++ b/module/sockets/updateSands.mjs @@ -31,7 +31,8 @@ export function updateSands(payload) { `sandsOfFate`, sands, ); - } else if (delta != null) { + } + else if (delta != null) { ui.delveDice.sandsOfFateDelta(delta); }; };