Update the brace format from 1tbs to stroustrup

This commit is contained in:
Eldritch-Oliver 2025-10-08 23:10:15 -06:00
parent 1c7308e188
commit 3dd3139281
13 changed files with 31 additions and 16 deletions

View file

@ -75,7 +75,7 @@ export default [
"@stylistic/eol-last": `warn`, "@stylistic/eol-last": `warn`,
"@stylistic/operator-linebreak": [`warn`, `before`], "@stylistic/operator-linebreak": [`warn`, `before`],
"@stylistic/indent": [`warn`, `tab`], "@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/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-dangle": [`warn`, { arrays: `always-multiline`, objects: `always-multiline`, imports: `always-multiline`, exports: `always-multiline`, functions: `always-multiline` }],
"@stylistic/comma-style": [`warn`, `last`], "@stylistic/comma-style": [`warn`, `last`],

View file

@ -115,7 +115,8 @@ export class CraftCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(Acto
const length = crafts.length; const length = crafts.length;
if (length >= limit) { if (length >= limit) {
crafts = crafts.slice(0, limit); crafts = crafts.slice(0, limit);
} else { }
else {
crafts = crafts crafts = crafts
.concat(Array(limit - length).fill(null)) .concat(Array(limit - length).fill(null))
.slice(0, limit); .slice(0, limit);

View file

@ -194,7 +194,8 @@ export class SkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(Act
const length = ctx.skills[ability].length; const length = ctx.skills[ability].length;
if (length >= limit) { if (length >= limit) {
ctx.skills[ability] = ctx.skills[ability].slice(0, limit); ctx.skills[ability] = ctx.skills[ability].slice(0, limit);
} else { }
else {
ctx.skills[ability] = ctx.skills[ability] ctx.skills[ability] = ctx.skills[ability]
.concat(Array(limit - length).fill(null)) .concat(Array(limit - length).fill(null))
.slice(0, limit); .slice(0, limit);

View file

@ -88,7 +88,8 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) {
const existing = document.getElementById(element.id); const existing = document.getElementById(element.id);
if (existing) { if (existing) {
existing.replaceWith(element); existing.replaceWith(element);
} else { }
else {
const parent = document.getElementById(`ui-top`); const parent = document.getElementById(`ui-top`);
parent.prepend(element); parent.prepend(element);
}; };
@ -292,7 +293,8 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) {
if (delta === 0 || !shouldUpdateSands) { return }; if (delta === 0 || !shouldUpdateSands) { return };
if (game.user.isActiveGM) { if (game.user.isActiveGM) {
ui.delveDice.sandsOfFateDelta(delta); ui.delveDice.sandsOfFateDelta(delta);
} else { }
else {
game.socket.emit(`system.ripcrypt`, { game.socket.emit(`system.ripcrypt`, {
event: `updateSands`, event: `updateSands`,
payload: { delta }, payload: { delta },

View file

@ -51,7 +51,8 @@ export function StyledShadowElement(Base) {
const stylePath = this.constructor._stylePath; const stylePath = this.constructor._stylePath;
if (this.constructor._styles.has(stylePath)) { if (this.constructor._styles.has(stylePath)) {
this._style.innerHTML = this.constructor._styles.get(stylePath); this._style.innerHTML = this.constructor._styles.get(stylePath);
} else { }
else {
fetch(`./systems/${game.system.id}/templates/${stylePath}`) fetch(`./systems/${game.system.id}/templates/${stylePath}`)
.then(r => r.text()) .then(r => r.text())
.then(t => { .then(t => {

View file

@ -42,9 +42,11 @@ export function toBoolean(val) {
export function documentSorter(a, b) { export function documentSorter(a, b) {
if (!a && !b) { if (!a && !b) {
return 0; return 0;
} else if (!a) { }
else if (!a) {
return 1; return 1;
} else if (!b) { }
else if (!b) {
return -1; return -1;
}; };

View file

@ -199,7 +199,8 @@ export class WeaponData extends CommonItemData {
value: this.range.long, value: this.range.long,
}, },
}); });
} else { }
else {
fields.push({ fields.push({
id: `short-range`, id: `short-range`,
type: `integer`, type: `integer`,

View file

@ -38,7 +38,8 @@ export class CryptDie extends Die {
if (almostCrypted) { if (almostCrypted) {
this.ripCryptState = `crypted`; this.ripCryptState = `crypted`;
break; break;
} else { }
else {
almostCrypted = true; almostCrypted = true;
} }
} }

View file

@ -16,7 +16,8 @@ export class RipCryptCombat extends Combat {
if (groups.has(groupKey)) { if (groups.has(groupKey)) {
groups.get(groupKey).push(combatant); groups.get(groupKey).push(combatant);
} else { }
else {
groups.set(groupKey, [combatant]); groups.set(groupKey, [combatant]);
}; };
}; };
@ -129,7 +130,8 @@ export class RipCryptCombat extends Combat {
const currentToken = this.combatant?.token?._object; const currentToken = this.combatant?.token?._object;
if (!tokenGroup && currentToken) { if (!tokenGroup && currentToken) {
currentToken.renderFlags.set({refreshTurnMarker: true}); currentToken.renderFlags.set({refreshTurnMarker: true});
} else { }
else {
const group = this.customGroups.get(tokenGroup) ?? []; const group = this.customGroups.get(tokenGroup) ?? [];
for (const combatant of group) { for (const combatant of group) {
combatant.token?._object?.renderFlags.set({ refreshTurnMarker: true }); combatant.token?._object?.renderFlags.set({ refreshTurnMarker: true });

View file

@ -28,7 +28,8 @@ export class RipCryptCombatant extends Combatant {
const disposition = this.disposition; const disposition = this.disposition;
if (disposition === `unknown`) { if (disposition === `unknown`) {
total += 0.25; total += 0.25;
} else if (whoFirst !== disposition) { }
else if (whoFirst !== disposition) {
total += 0.5; total += 0.5;
}; };
}; };

View file

@ -26,7 +26,8 @@ export class RipCryptToken extends Token {
}; };
canvas.tokens.turnMarkers.add(this); canvas.tokens.turnMarkers.add(this);
this.turnMarker.draw(); this.turnMarker.draw();
} else if (this.turnMarker) { }
else if (this.turnMarker) {
canvas.tokens.turnMarkers.delete(this); canvas.tokens.turnMarkers.delete(this);
this.turnMarker.destroy(); this.turnMarker.destroy();
this.turnMarker = null; this.turnMarker = null;

View file

@ -9,7 +9,8 @@ Hooks.once(`ready`, () => {
try { try {
Logger.debug(`Switching sidebar tab to:`, defaultTab); Logger.debug(`Switching sidebar tab to:`, defaultTab);
ui.sidebar.changeTab(defaultTab, `primary`); ui.sidebar.changeTab(defaultTab, `primary`);
} catch { }
catch {
Logger.error(`Failed to change to sidebar tab:`, defaultTab); Logger.error(`Failed to change to sidebar tab:`, defaultTab);
}; };
}; };

View file

@ -31,7 +31,8 @@ export function updateSands(payload) {
`sandsOfFate`, `sandsOfFate`,
sands, sands,
); );
} else if (delta != null) { }
else if (delta != null) {
ui.delveDice.sandsOfFateDelta(delta); ui.delveDice.sandsOfFateDelta(delta);
}; };
}; };