diff --git a/.vscode/settings.json b/.vscode/settings.json index 62787842..f8012687 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,11 @@ "eslint.nodePath": ".yarn/sdks", "prettier.prettierPath": ".yarn/sdks/prettier/index.js", "typescript.tsdk": ".yarn/sdks/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true + "typescript.enablePromptUseWorkspaceTsdk": true, + "importSorter.generalConfiguration.sortOnBeforeSave": true, + "importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.type": "newLineEachExpressionAfterCountLimitExceptIfOnlyOne", + "importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.count": 120, + "importSorter.importStringConfiguration.tabSize": 4, + "importSorter.importStringConfiguration.quoteMark": "double", + "importSorter.importStringConfiguration.trailingComma": "multiLine" } diff --git a/spec/item/spell/calculate-spell-price.spec.ts b/spec/item/spell/calculate-spell-price.spec.ts index 4b0262b2..56d49f6d 100644 --- a/spec/item/spell/calculate-spell-price.spec.ts +++ b/spec/item/spell/calculate-spell-price.spec.ts @@ -2,9 +2,10 @@ // // SPDX-License-Identifier: MIT -import { CooldownDuration, DS4SpellDataSourceData } from "../../../src/item/spell/spell-data-source"; import { calculateSpellPrice } from "../../../src/item/spell/calculate-spell-price"; +import type { CooldownDuration, DS4SpellDataSourceData } from "../../../src/item/spell/spell-data-source"; + const defaultData: DS4SpellDataSourceData = { description: "", equipped: false, diff --git a/src/active-effect.ts b/src/active-effect.ts index 81689bfb..d810e6b0 100644 --- a/src/active-effect.ts +++ b/src/active-effect.ts @@ -4,7 +4,8 @@ import { DS4Actor } from "./actor/actor"; import { getGame } from "./helpers"; -import { DS4Item } from "./item/item"; + +import type { DS4Item } from "./item/item"; declare global { interface DocumentClassConfig { diff --git a/src/actor/actor-data-properties-base.ts b/src/actor/actor-data-properties-base.ts index 2360ecb6..9aa9e335 100644 --- a/src/actor/actor-data-properties-base.ts +++ b/src/actor/actor-data-properties-base.ts @@ -5,9 +5,10 @@ // // SPDX-License-Identifier: MIT -import { ModifiableDataBaseTotal, ResourceDataBaseTotalMax } from "../common/common-data"; import { DS4 } from "../config"; +import type { ModifiableDataBaseTotal, ResourceDataBaseTotalMax } from "../common/common-data"; + export interface DS4ActorDataPropertiesDataBase { attributes: DS4ActorDataPropertiesDataAttributes; traits: DS4ActorDataPropertiesDataTraits; diff --git a/src/actor/actor-data-properties.ts b/src/actor/actor-data-properties.ts index 28275571..9360e728 100644 --- a/src/actor/actor-data-properties.ts +++ b/src/actor/actor-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4CharacterDataProperties } from "./character/character-data-properties"; -import { DS4CreatureDataProperties } from "./creature/creature-data-properties"; +import type { DS4CharacterDataProperties } from "./character/character-data-properties"; +import type { DS4CreatureDataProperties } from "./creature/creature-data-properties"; declare global { interface DataConfig { diff --git a/src/actor/actor-data-source-base.ts b/src/actor/actor-data-source-base.ts index c740dcd4..e57ad17d 100644 --- a/src/actor/actor-data-source-base.ts +++ b/src/actor/actor-data-source-base.ts @@ -5,9 +5,10 @@ // // SPDX-License-Identifier: MIT -import { ModifiableData, ModifiableDataBase, ResourceData } from "../common/common-data"; import { DS4 } from "../config"; +import type { ModifiableData, ModifiableDataBase, ResourceData } from "../common/common-data"; + export interface DS4ActorDataSourceDataBase { attributes: DS4ActorDataSourceDataAttributes; traits: DS4ActorDataSourceDataTraits; diff --git a/src/actor/actor-data-source.ts b/src/actor/actor-data-source.ts index ca74631b..f0fd61fe 100644 --- a/src/actor/actor-data-source.ts +++ b/src/actor/actor-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4CharacterDataSource } from "./character/character-data-source"; -import { DS4CreatureDataSource } from "./creature/creature-data-source"; +import type { DS4CharacterDataSource } from "./character/character-data-source"; +import type { DS4CreatureDataSource } from "./creature/creature-data-source"; declare global { interface SourceConfig { diff --git a/src/actor/actor-sheet.ts b/src/actor/actor-sheet.ts index 21a97b65..517af2ee 100644 --- a/src/actor/actor-sheet.ts +++ b/src/actor/actor-sheet.ts @@ -6,15 +6,17 @@ // SPDX-License-Identifier: MIT import { DS4ActiveEffect } from "../active-effect"; -import { ModifiableDataBaseTotal } from "../common/common-data"; import { DS4 } from "../config"; import { getCanvas, getGame } from "../helpers"; -import { DS4Settings, getDS4Settings } from "../settings"; +import { getDS4Settings } from "../settings"; import notifications from "../ui/notifications"; import { enforce } from "../utils"; import { isCheck } from "./actor-data-properties-base"; +import type { ModifiableDataBaseTotal } from "../common/common-data"; +import type { DS4Settings } from "../settings"; import type { DS4Item } from "../item/item"; + /** * The base sheet class for all {@link DS4Actor}s. */ diff --git a/src/actor/actor.ts b/src/actor/actor.ts index 32d5da70..ecad7f40 100644 --- a/src/actor/actor.ts +++ b/src/actor/actor.ts @@ -3,17 +3,18 @@ // // SPDX-License-Identifier: MIT -import { ModifiableDataBaseTotal } from "../common/common-data"; import { DS4 } from "../config"; import { getGame } from "../helpers"; -import { DS4ArmorDataProperties } from "../item/armor/armor-data-properties"; -import { DS4Item } from "../item/item"; -import { ItemType } from "../item/item-data-source"; -import { DS4ShieldDataProperties } from "../item/shield/shield-data-properties"; import { createCheckRoll } from "../rolls/check-factory"; -import { Check } from "./actor-data-properties-base"; import { isAttribute, isTrait } from "./actor-data-source-base"; +import type { ModifiableDataBaseTotal } from "../common/common-data"; +import type { DS4ArmorDataProperties } from "../item/armor/armor-data-properties"; +import type { DS4Item } from "../item/item"; +import type { ItemType } from "../item/item-data-source"; +import type { DS4ShieldDataProperties } from "../item/shield/shield-data-properties"; +import type { Check } from "./actor-data-properties-base"; + declare global { interface DocumentClassConfig { Actor: typeof DS4Actor; diff --git a/src/actor/character/character-data-properties.ts b/src/actor/character/character-data-properties.ts index db511a38..515d0319 100644 --- a/src/actor/character/character-data-properties.ts +++ b/src/actor/character/character-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base"; -import { +import type { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base"; +import type { DS4CharacterDataSourceDataBaseInfo, DS4CharacterDataSourceDataCurrency, DS4CharacterDataSourceDataProfile, diff --git a/src/actor/character/character-data-source.ts b/src/actor/character/character-data-source.ts index 6dcba132..69192285 100644 --- a/src/actor/character/character-data-source.ts +++ b/src/actor/character/character-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { UsableResource } from "../../common/common-data"; -import { DS4ActorDataSourceDataBase } from "../actor-data-source-base"; +import type { UsableResource } from "../../common/common-data"; +import type { DS4ActorDataSourceDataBase } from "../actor-data-source-base"; export interface DS4CharacterDataSource { type: "character"; diff --git a/src/actor/character/character.ts b/src/actor/character/character.ts index 8a425aed..b8dd87a6 100644 --- a/src/actor/character/character.ts +++ b/src/actor/character/character.ts @@ -2,9 +2,10 @@ // // SPDX-License-Identifier: MIT -import { ItemType } from "../../item/item-data-source"; import { DS4Actor } from "../actor"; +import type { ItemType } from "../../item/item-data-source"; + export class DS4Character extends DS4Actor { /** @override */ prepareFinalDerivedData(): void { diff --git a/src/actor/creature/creature-data-properties.ts b/src/actor/creature/creature-data-properties.ts index c5d5a4c3..63ac946b 100644 --- a/src/actor/creature/creature-data-properties.ts +++ b/src/actor/creature/creature-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base"; -import { DS4CreatureDataSourceDataBaseInfo } from "./creature-data-source"; +import type { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base"; +import type { DS4CreatureDataSourceDataBaseInfo } from "./creature-data-source"; export interface DS4CreatureDataProperties { type: "creature"; diff --git a/src/actor/creature/creature-data-source.ts b/src/actor/creature/creature-data-source.ts index 7bd2368b..6d01ccbe 100644 --- a/src/actor/creature/creature-data-source.ts +++ b/src/actor/creature/creature-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../../config"; -import { DS4ActorDataSourceDataBase } from "../actor-data-source-base"; +import type { DS4 } from "../../config"; +import type { DS4ActorDataSourceDataBase } from "../actor-data-source-base"; export interface DS4CreatureDataSource { type: "creature"; diff --git a/src/actor/creature/creature.ts b/src/actor/creature/creature.ts index f9829015..f6ae06a7 100644 --- a/src/actor/creature/creature.ts +++ b/src/actor/creature/creature.ts @@ -2,9 +2,10 @@ // // SPDX-License-Identifier: MIT -import { ItemType } from "../../item/item-data-source"; import { DS4Actor } from "../actor"; +import type { ItemType } from "../../item/item-data-source"; + export class DS4Creature extends DS4Actor { /** @override */ get ownableItemTypes(): Array { diff --git a/src/ds4.ts b/src/ds4.ts index 285b2bfd..57f61604 100644 --- a/src/ds4.ts +++ b/src/ds4.ts @@ -3,6 +3,7 @@ // SPDX-License-Identifier: MIT import "../scss/ds4.scss"; + import registerForHooks from "./hooks/hooks"; registerForHooks(); diff --git a/src/hooks/init.ts b/src/hooks/init.ts index 5efa4c8b..ee2f8870 100644 --- a/src/hooks/init.ts +++ b/src/hooks/init.ts @@ -5,18 +5,17 @@ // SPDX-License-Identifier: MIT import { DS4ActiveEffect } from "../active-effect"; -import { DS4Actor } from "../actor/actor"; -import { DS4ActorProxy } from "../actor/proxy"; import { DS4CharacterActorSheet } from "../actor/character/character-sheet"; import { DS4CreatureActorSheet } from "../actor/creature/creature-sheet"; +import { DS4ActorProxy } from "../actor/proxy"; import { DS4ChatMessage } from "../chat-message"; import { DS4 } from "../config"; -import { preloadFonts as preloadFonts } from "../fonts"; +import { preloadFonts } from "../fonts"; import registerHandlebarsHelpers from "../handlebars/handlebars-helpers"; import registerHandlebarsPartials from "../handlebars/handlebars-partials"; import { getGame } from "../helpers"; -import { DS4Item } from "../item/item"; import { DS4ItemSheet } from "../item/item-sheet"; +import { DS4ItemProxy } from "../item/proxy"; import logger from "../logger"; import { macros } from "../macros/macros"; import { migration } from "../migrations"; @@ -26,7 +25,9 @@ import { DS4Roll } from "../rolls/roll"; import registerSlayingDiceModifier from "../rolls/slaying-dice-modifier"; import { registerSystemSettings } from "../settings"; import { DS4TokenDocument } from "../token-document"; -import { DS4ItemProxy } from "../item/proxy"; + +import type { DS4Actor } from "../actor/actor"; +import type { DS4Item } from "../item/item"; export default function registerForInitHook(): void { Hooks.once("init", init); diff --git a/src/hooks/render.ts b/src/hooks/render.ts index 547f80e2..14a7f689 100644 --- a/src/hooks/render.ts +++ b/src/hooks/render.ts @@ -20,9 +20,7 @@ export default function registerForRenderHooks(): void { * @param html - The {@link JQuery} representing the HTML of the application. */ function selectTargetInputOnFocus(app: Application, html: JQuery) { - $(html) - .find("input") - .on("focus", (ev: JQuery.FocusEvent) => { - ev.currentTarget.select(); - }); + html.find("input").on("focus", (ev: JQuery.FocusEvent) => { + ev.currentTarget.select(); + }); } diff --git a/src/item/alphabet/alphabet-data-properties.ts b/src/item/alphabet/alphabet-data-properties.ts index 36e3100e..b66becb8 100644 --- a/src/item/alphabet/alphabet-data-properties.ts +++ b/src/item/alphabet/alphabet-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4AlphabetDataSourceData } from "./alphabet-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4AlphabetDataSourceData } from "./alphabet-data-source"; export interface DS4AlphabetDataProperties { type: "alphabet"; diff --git a/src/item/alphabet/alphabet-data-source.ts b/src/item/alphabet/alphabet-data-source.ts index c659add4..291e1504 100644 --- a/src/item/alphabet/alphabet-data-source.ts +++ b/src/item/alphabet/alphabet-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataSourceDataBase } from "../item-data-source-base"; +import type { DS4ItemDataSourceDataBase } from "../item-data-source-base"; export interface DS4AlphabetDataSource { type: "alphabet"; diff --git a/src/item/armor/armor-data-properties.ts b/src/item/armor/armor-data-properties.ts index 943b7ced..0166f01e 100644 --- a/src/item/armor/armor-data-properties.ts +++ b/src/item/armor/armor-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4ArmorDataSourceData } from "./armor-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4ArmorDataSourceData } from "./armor-data-source"; export interface DS4ArmorDataProperties { type: "armor"; diff --git a/src/item/armor/armor-data-source.ts b/src/item/armor/armor-data-source.ts index 9a689d48..e19f8a06 100644 --- a/src/item/armor/armor-data-source.ts +++ b/src/item/armor/armor-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../../config"; -import { +import type { DS4 } from "../../config"; +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable, DS4ItemDataSourceDataPhysical, diff --git a/src/item/equipment/equipment-data-properties.ts b/src/item/equipment/equipment-data-properties.ts index c6493d6a..5852842f 100644 --- a/src/item/equipment/equipment-data-properties.ts +++ b/src/item/equipment/equipment-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4EquipmentDataSourceData } from "./equipment-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4EquipmentDataSourceData } from "./equipment-data-source"; export interface DS4EquipmentDataProperties { type: "equipment"; diff --git a/src/item/equipment/equipment-data-source.ts b/src/item/equipment/equipment-data-source.ts index 0d96f00d..6db28e7f 100644 --- a/src/item/equipment/equipment-data-source.ts +++ b/src/item/equipment/equipment-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable, DS4ItemDataSourceDataPhysical, diff --git a/src/item/item-data-properties.ts b/src/item/item-data-properties.ts index 54383451..6e7125e7 100644 --- a/src/item/item-data-properties.ts +++ b/src/item/item-data-properties.ts @@ -2,17 +2,17 @@ // // SPDX-License-Identifier: MIT -import { DS4AlphabetDataProperties } from "./alphabet/alphabet-data-properties"; -import { DS4ArmorDataProperties } from "./armor/armor-data-properties"; -import { DS4EquipmentDataProperties } from "./equipment/equipment-data-properties"; -import { DS4LanguageDataProperties } from "./language/language-data-properties"; -import { DS4LootDataProperties } from "./loot/loot-data-properties"; -import { DS4RacialAbilityDataProperties } from "./racial-ability/racial-ability-data-properties"; -import { DS4ShieldDataProperties } from "./shield/shield-data-properties"; -import { DS4SpecialCreatureAbilityDataProperties } from "./special-creature-ability/special-creature-ability-data-properties"; -import { DS4SpellDataProperties } from "./spell/spell-data-properties"; -import { DS4TalentDataProperties } from "./talent/talent-data-properties"; -import { DS4WeaponDataProperties } from "./weapon/weapon-data-properties"; +import type { DS4AlphabetDataProperties } from "./alphabet/alphabet-data-properties"; +import type { DS4ArmorDataProperties } from "./armor/armor-data-properties"; +import type { DS4EquipmentDataProperties } from "./equipment/equipment-data-properties"; +import type { DS4LanguageDataProperties } from "./language/language-data-properties"; +import type { DS4LootDataProperties } from "./loot/loot-data-properties"; +import type { DS4RacialAbilityDataProperties } from "./racial-ability/racial-ability-data-properties"; +import type { DS4ShieldDataProperties } from "./shield/shield-data-properties"; +import type { DS4SpecialCreatureAbilityDataProperties } from "./special-creature-ability/special-creature-ability-data-properties"; +import type { DS4SpellDataProperties } from "./spell/spell-data-properties"; +import type { DS4TalentDataProperties } from "./talent/talent-data-properties"; +import type { DS4WeaponDataProperties } from "./weapon/weapon-data-properties"; declare global { interface DataConfig { diff --git a/src/item/item-data-source-base.ts b/src/item/item-data-source-base.ts index 7b020446..ce801d31 100644 --- a/src/item/item-data-source-base.ts +++ b/src/item/item-data-source-base.ts @@ -4,7 +4,7 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../config"; +import type { DS4 } from "../config"; export interface DS4ItemDataSourceDataBase { description: string; diff --git a/src/item/item-data-source.ts b/src/item/item-data-source.ts index a43a8b3a..ab4cf950 100644 --- a/src/item/item-data-source.ts +++ b/src/item/item-data-source.ts @@ -2,18 +2,18 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../config"; -import { DS4AlphabetDataSource } from "./alphabet/alphabet-data-source"; -import { DS4ArmorDataSource } from "./armor/armor-data-source"; -import { DS4EquipmentDataSource } from "./equipment/equipment-data-source"; -import { DS4LanguageDataSource } from "./language/language-data-source"; -import { DS4LootDataSource } from "./loot/loot-data-source"; -import { DS4RacialAbilityDataSource } from "./racial-ability/racial-ability-data-source"; -import { DS4ShieldDataSource } from "./shield/shield-data-source"; -import { DS4SpecialCreatureAbilityDataSource } from "./special-creature-ability/special-creature-ability-data-source"; -import { DS4SpellDataSource } from "./spell/spell-data-source"; -import { DS4TalentDataSource } from "./talent/talent-data-source"; -import { DS4WeaponDataSource } from "./weapon/weapon-data-source"; +import type { DS4 } from "../config"; +import type { DS4AlphabetDataSource } from "./alphabet/alphabet-data-source"; +import type { DS4ArmorDataSource } from "./armor/armor-data-source"; +import type { DS4EquipmentDataSource } from "./equipment/equipment-data-source"; +import type { DS4LanguageDataSource } from "./language/language-data-source"; +import type { DS4LootDataSource } from "./loot/loot-data-source"; +import type { DS4RacialAbilityDataSource } from "./racial-ability/racial-ability-data-source"; +import type { DS4ShieldDataSource } from "./shield/shield-data-source"; +import type { DS4SpecialCreatureAbilityDataSource } from "./special-creature-ability/special-creature-ability-data-source"; +import type { DS4SpellDataSource } from "./spell/spell-data-source"; +import type { DS4TalentDataSource } from "./talent/talent-data-source"; +import type { DS4WeaponDataSource } from "./weapon/weapon-data-source"; declare global { interface SourceConfig { diff --git a/src/item/item.ts b/src/item/item.ts index 78e7d5dc..d3041604 100644 --- a/src/item/item.ts +++ b/src/item/item.ts @@ -4,7 +4,8 @@ // SPDX-License-Identifier: MIT import { getGame } from "../helpers"; -import { ItemType } from "./item-data-source"; + +import type { ItemType } from "./item-data-source"; declare global { interface DocumentClassConfig { diff --git a/src/item/language/language-data-properties.ts b/src/item/language/language-data-properties.ts index d86bf6cc..963f3f66 100644 --- a/src/item/language/language-data-properties.ts +++ b/src/item/language/language-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4LanguageDataSourceData } from "./language-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4LanguageDataSourceData } from "./language-data-source"; export interface DS4LanguageDataProperties { type: "language"; diff --git a/src/item/language/language-data-source.ts b/src/item/language/language-data-source.ts index bbe680ab..15b3d33d 100644 --- a/src/item/language/language-data-source.ts +++ b/src/item/language/language-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataSourceDataBase } from "../item-data-source-base"; +import type { DS4ItemDataSourceDataBase } from "../item-data-source-base"; export interface DS4LanguageDataSource { type: "language"; diff --git a/src/item/loot/loot-data-properties.ts b/src/item/loot/loot-data-properties.ts index dcb13ae6..71fd948f 100644 --- a/src/item/loot/loot-data-properties.ts +++ b/src/item/loot/loot-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4LootDataSourceData } from "./loot-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4LootDataSourceData } from "./loot-data-source"; export interface DS4LootDataProperties { type: "loot"; diff --git a/src/item/loot/loot-data-source.ts b/src/item/loot/loot-data-source.ts index 8cb48edf..9ebef459 100644 --- a/src/item/loot/loot-data-source.ts +++ b/src/item/loot/loot-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataPhysical } from "../item-data-source-base"; +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataPhysical } from "../item-data-source-base"; export interface DS4LootDataSource { type: "loot"; diff --git a/src/item/racial-ability/racial-ability-data-properties.ts b/src/item/racial-ability/racial-ability-data-properties.ts index 45944609..5592fe69 100644 --- a/src/item/racial-ability/racial-ability-data-properties.ts +++ b/src/item/racial-ability/racial-ability-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4RacialAbilityDataSourceData } from "./racial-ability-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4RacialAbilityDataSourceData } from "./racial-ability-data-source"; export interface DS4RacialAbilityDataProperties { type: "racialAbility"; diff --git a/src/item/racial-ability/racial-ability-data-source.ts b/src/item/racial-ability/racial-ability-data-source.ts index b3149ca7..589775f5 100644 --- a/src/item/racial-ability/racial-ability-data-source.ts +++ b/src/item/racial-ability/racial-ability-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataSourceDataBase } from "../item-data-source-base"; +import type { DS4ItemDataSourceDataBase } from "../item-data-source-base"; export interface DS4RacialAbilityDataSource { type: "racialAbility"; diff --git a/src/item/shield/shield-data-properties.ts b/src/item/shield/shield-data-properties.ts index 1064717b..a51b0512 100644 --- a/src/item/shield/shield-data-properties.ts +++ b/src/item/shield/shield-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4ShieldDataSourceData } from "./shield-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4ShieldDataSourceData } from "./shield-data-source"; export interface DS4ShieldDataProperties { type: "shield"; diff --git a/src/item/shield/shield-data-source.ts b/src/item/shield/shield-data-source.ts index 493ae000..74cdda26 100644 --- a/src/item/shield/shield-data-source.ts +++ b/src/item/shield/shield-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable, DS4ItemDataSourceDataPhysical, diff --git a/src/item/special-creature-ability/special-creature-ability-data-properties.ts b/src/item/special-creature-ability/special-creature-ability-data-properties.ts index 213fd416..06f96d4a 100644 --- a/src/item/special-creature-ability/special-creature-ability-data-properties.ts +++ b/src/item/special-creature-ability/special-creature-ability-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4SpecialCreatureAbilityDataSourceData } from "./special-creature-ability-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4SpecialCreatureAbilityDataSourceData } from "./special-creature-ability-data-source"; export interface DS4SpecialCreatureAbilityDataProperties { type: "specialCreatureAbility"; diff --git a/src/item/special-creature-ability/special-creature-ability-data-source.ts b/src/item/special-creature-ability/special-creature-ability-data-source.ts index 2772b101..1017a6f2 100644 --- a/src/item/special-creature-ability/special-creature-ability-data-source.ts +++ b/src/item/special-creature-ability/special-creature-ability-data-source.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataSourceDataBase } from "../item-data-source-base"; +import type { DS4ItemDataSourceDataBase } from "../item-data-source-base"; export interface DS4SpecialCreatureAbilityDataSource { type: "specialCreatureAbility"; diff --git a/src/item/spell/calculate-spell-price.ts b/src/item/spell/calculate-spell-price.ts index 910fa7da..caf3bc6c 100644 --- a/src/item/spell/calculate-spell-price.ts +++ b/src/item/spell/calculate-spell-price.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -import { CooldownDuration, DS4SpellDataSourceData } from "./spell-data-source"; +import type { CooldownDuration, DS4SpellDataSourceData } from "./spell-data-source"; export function calculateSpellPrice(data: DS4SpellDataSourceData): number | null { const spellPriceFactor = calculateSpellPriceFactor(data.cooldownDuration); diff --git a/src/item/spell/spell-data-properties.ts b/src/item/spell/spell-data-properties.ts index 2cb88079..874f0544 100644 --- a/src/item/spell/spell-data-properties.ts +++ b/src/item/spell/spell-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4SpellDataSourceData } from "./spell-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4SpellDataSourceData } from "./spell-data-source"; export interface DS4SpellDataProperties { type: "spell"; diff --git a/src/item/spell/spell-data-source.ts b/src/item/spell/spell-data-source.ts index 23393c99..7c578dc9 100644 --- a/src/item/spell/spell-data-source.ts +++ b/src/item/spell/spell-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../../config"; -import { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable } from "../item-data-source-base"; +import type { DS4 } from "../../config"; +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable } from "../item-data-source-base"; export interface DS4SpellDataSource { type: "spell"; diff --git a/src/item/talent/talent-data-properties.ts b/src/item/talent/talent-data-properties.ts index c4eec70c..fe679226 100644 --- a/src/item/talent/talent-data-properties.ts +++ b/src/item/talent/talent-data-properties.ts @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: MIT -import { ModifiableDataBaseTotalMax } from "../../common/common-data"; -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4TalentDataSourceData } from "./talent-data-source"; +import type { ModifiableDataBaseTotalMax } from "../../common/common-data"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4TalentDataSourceData } from "./talent-data-source"; export interface DS4TalentDataProperties { type: "talent"; diff --git a/src/item/talent/talent-data-source.ts b/src/item/talent/talent-data-source.ts index 98a5288d..f5cb46b8 100644 --- a/src/item/talent/talent-data-source.ts +++ b/src/item/talent/talent-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { ModifiableDataBaseMax } from "../../common/common-data"; -import { DS4ItemDataSourceDataBase } from "../item-data-source-base"; +import type { ModifiableDataBaseMax } from "../../common/common-data"; +import type { DS4ItemDataSourceDataBase } from "../item-data-source-base"; export interface DS4TalentDataSource { type: "talent"; diff --git a/src/item/weapon/weapon-data-properties.ts b/src/item/weapon/weapon-data-properties.ts index 3a74c508..446037b3 100644 --- a/src/item/weapon/weapon-data-properties.ts +++ b/src/item/weapon/weapon-data-properties.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; -import { DS4WeaponDataSourceData } from "./weapon-data-source"; +import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base"; +import type { DS4WeaponDataSourceData } from "./weapon-data-source"; interface DS4WeaponDataPropertiesData extends DS4WeaponDataSourceData, DS4ItemDataPropertiesDataRollable {} diff --git a/src/item/weapon/weapon-data-source.ts b/src/item/weapon/weapon-data-source.ts index 72641e21..3dbe5410 100644 --- a/src/item/weapon/weapon-data-source.ts +++ b/src/item/weapon/weapon-data-source.ts @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT -import { DS4 } from "../../config"; -import { +import type { DS4 } from "../../config"; +import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable, DS4ItemDataSourceDataPhysical, diff --git a/src/item/weapon/weapon.ts b/src/item/weapon/weapon.ts index cd326d9d..dabea48f 100644 --- a/src/item/weapon/weapon.ts +++ b/src/item/weapon/weapon.ts @@ -7,7 +7,8 @@ import { getGame } from "../../helpers"; import { createCheckRoll } from "../../rolls/check-factory"; import notifications from "../../ui/notifications"; import { DS4Item } from "../item"; -import { AttackType } from "./weapon-data-source"; + +import type { AttackType } from "./weapon-data-source"; export class DS4Weapon extends DS4Item { /** @override */ diff --git a/src/macros/helpers.ts b/src/macros/helpers.ts index 941ee947..5471a2e4 100644 --- a/src/macros/helpers.ts +++ b/src/macros/helpers.ts @@ -2,9 +2,10 @@ // // SPDX-License-Identifier: MIT -import { DS4Actor } from "../actor/actor"; import { getCanvas, getGame } from "../helpers"; +import type { DS4Actor } from "../actor/actor"; + /** * Gets the currently active actor and token based on how {@link ChatMessage} * determines the current speaker. diff --git a/src/macros/roll-check.ts b/src/macros/roll-check.ts index 1e37b7d4..ae93a039 100644 --- a/src/macros/roll-check.ts +++ b/src/macros/roll-check.ts @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: MIT -import { Check } from "../actor/actor-data-properties-base"; import { DS4 } from "../config"; import { getGame } from "../helpers"; import notifications from "../ui/notifications"; import { getActiveActorAndToken } from "./helpers"; +import type { Check } from "../actor/actor-data-properties-base"; /** * Creates a macro from a check drop. * Get an existing roll check macro if one exists, otherwise create a new one. diff --git a/tsconfig.json b/tsconfig.json index 7a7a51ce..9062a9a8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "forceConsistentCasingInFileNames": true, "strict": true, "noUncheckedIndexedAccess": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "importsNotUsedAsValues": "error" }, "include": ["src"] }