mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Enable no unused vars and add more types
This commit is contained in:
parent
af49c1f4c8
commit
ba11651b0c
20 changed files with 141 additions and 31 deletions
14
module/data/actor/_types.d.ts
vendored
Normal file
14
module/data/actor/_types.d.ts
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import DhpActor from '../../documents/actor.mjs'
|
||||
import DhCharacter from './character.mjs';
|
||||
|
||||
declare module './base.mjs' {
|
||||
export default interface BaseDataActor {
|
||||
parent: DhpActor<this>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module './companion.mjs' {
|
||||
export default interface DhCompanion {
|
||||
partner: DhpActor<DhCharacter>;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
|
||||
import DHItem from '../../documents/item.mjs';
|
||||
import { createShallowProxy, getScrollTextData } from '../../helpers/utils.mjs';
|
||||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
/**
|
||||
* @import DHItem from '../../documents/item.mjs';
|
||||
* @import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
|
||||
*/
|
||||
|
||||
/** Function to generate resistance fields for damage types */
|
||||
const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) =>
|
||||
new fields.SchemaField({
|
||||
resistance: new fields.BooleanField({
|
||||
|
|
@ -96,6 +100,8 @@ export const commonActorRules = (extendedData = { damageReduction: {}, attack: {
|
|||
* @property {Boolean} isNPC - This data model represents a NPC?
|
||||
* @property {typeof DHBaseActorSettings} settingSheet - The sheet class used to render the settings UI for this actor type.
|
||||
*/
|
||||
|
||||
/** Base actor type data model for all actors in Daggerheart */
|
||||
export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
||||
/** @returns {ActorDataModelMetadata}*/
|
||||
static get metadata() {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default class FormulaField extends foundry.data.fields.StringField {
|
|||
let roll = null;
|
||||
try {
|
||||
roll = new Roll(value.replace(/@([a-z.0-9_-]+)/gi, '1'));
|
||||
} catch (_) {
|
||||
} catch {
|
||||
roll = new Roll(value.replace(/@([a-z.0-9_-]+)/gi, 'd6'));
|
||||
}
|
||||
roll.evaluateSync({ strict: false });
|
||||
|
|
|
|||
8
module/data/item/_types.d.ts
vendored
Normal file
8
module/data/item/_types.d.ts
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import DHItem from '../../documents/item.mjs';
|
||||
|
||||
declare module './base.mjs' {
|
||||
export default interface BaseDataItem {
|
||||
parent: DHItem<this>;
|
||||
actor: DhpActor;
|
||||
}
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ export default class RegisteredTriggers extends Map {
|
|||
|
||||
const result = await command(...args);
|
||||
if (result?.updates?.length) updates.push(...result.updates);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
const triggerName = game.i18n.localize(triggerData.label);
|
||||
ui.notifications.error(
|
||||
game.i18n.format('DAGGERHEART.CONFIG.Triggers.triggerError', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue