Skip to content

Commit

Permalink
Update NPC dependencies
Browse files Browse the repository at this point in the history
New prettier standards, so ran lint:fix
  • Loading branch information
stwlam committed Feb 13, 2023
1 parent 8a1dc7d commit a463423
Show file tree
Hide file tree
Showing 31 changed files with 583 additions and 547 deletions.
1,016 changes: 526 additions & 490 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,53 +26,53 @@
"@betterer/typescript": "^5.4.0",
"@pixi/graphics-smooth": "^0.0.30",
"@pixi/particle-emitter": "5.0.7",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^8.0.0",
"@types/jest": "^29.2.5",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.0.1",
"@types/jest": "^29.4.0",
"@types/jquery": "^3.5.16",
"@types/jsdom": "^20.0.1",
"@types/jsdom": "^21.1.0",
"@types/luxon": "^3.2.0",
"@types/node": "^18.11.18",
"@types/node": "^18.13.0",
"@types/sortablejs": "^1.15.0",
"@types/tooltipster": "^0.0.31",
"@types/webpack-env": "^1.18.0",
"@types/yaireo__tagify": "^4.16.0",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@types/yaireo__tagify": "^4.16.1",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"css-minimizer-webpack-plugin": "^4.2.2",
"eslint": "^8.31.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^4.2.1",
"fork-ts-checker-webpack-plugin": "^7.2.14",
"fork-ts-checker-webpack-plugin": "^7.3.0",
"fs-extra": "^11.1.0",
"glob": "^8.0.3",
"glob": "^8.1.0",
"handlebars": "4.7.7",
"jest": "^29.3.1",
"jest-each": "^29.3.1",
"jest": "^29.4.2",
"jest-each": "^29.4.2",
"mini-css-extract-plugin": "^2.7.2",
"null-loader": "^4.0.1",
"pixi.js": "6.5.2",
"prettier": "^2.8.1",
"prettier": "^2.8.4",
"raw-loader": "^4.0.2",
"sass": "^1.57.1",
"sass": "^1.58.0",
"sass-loader": "^13.2.0",
"simple-progress-webpack-plugin": "^2.0.0",
"socket.io": "4.5.1",
"socket.io-client": "4.5.1",
"string-replace-loader": "^3.1.0",
"thread-loader": "^3.0.4",
"tinymce": "6.1.2",
"ts-jest": "^29.0.3",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.2",
"typescript": "^4.9.4",
"typescript": "^4.9.5",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
Expand All @@ -85,13 +85,13 @@
"@yaireo/tagify": "4.16.4",
"codemirror": "^6.0.1",
"jquery": "^3.6.3",
"jsdom": "^20.0.3",
"ky": "^0.33.1",
"jsdom": "^21.1.0",
"ky": "^0.33.2",
"ky-universal": "^0.11.0",
"luxon": "^3.2.1",
"minisearch": "^5.1.0",
"nedb-promises": "^6.2.1",
"nouislider": "^15.6.1",
"nouislider": "^15.7.0",
"peggy": "^2.0.1",
"sortablejs": "^1.15.0",
"yargs": "^17.6.2"
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/character/data/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface CraftingSheetData {
entries: CraftingEntriesSheetData;
}

type CharacterSheetTabVisibility = Record<typeof CHARACTER_SHEET_TABS[number], boolean>;
type CharacterSheetTabVisibility = Record<(typeof CHARACTER_SHEET_TABS)[number], boolean>;

interface CharacterSheetData extends CreatureSheetData<CharacterPF2e> {
abpEnabled: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/character/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class CharacterPF2e extends CreaturePF2e {

result[level] = allowed;
return result;
}, {} as Record<typeof boostLevels[number], number>);
}, {} as Record<(typeof boostLevels)[number], number>);
const existingBoosts = systemData.build?.abilities?.boosts;
systemData.build = {
abilities: {
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/creature/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ interface CreatureSystemData extends CreatureSystemSource, ActorSystemData {
actions?: StrikeData[];
}

type CreatureType = typeof CREATURE_ACTOR_TYPES[number];
type CreatureType = (typeof CREATURE_ACTOR_TYPES)[number];

interface SenseData {
type: SenseType;
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/creature/sense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class CreatureSensePF2e implements SenseData {
}
}

export type SenseAcuity = typeof SENSE_ACUITIES[number];
export type SenseAcuity = (typeof SENSE_ACUITIES)[number];
export type SenseType = SetElement<typeof SENSE_TYPES>;

export const SENSE_ACUITIES = ["precise", "imprecise", "vague"];
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheet/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ abstract class ActorSheetPF2e<TActor extends ActorPF2e> extends ActorSheet<TActo

// Alphabetize displayed IWR
const iwrKeys = ["immunities", "weaknesses", "resistances"] as const;
const attributes: Record<typeof iwrKeys[number], { label: string }[]> = actorData.system.attributes;
const attributes: Record<(typeof iwrKeys)[number], { label: string }[]> = actorData.system.attributes;
for (const key of iwrKeys) {
attributes[key] = [...attributes[key]].sort((a, b) => a.label.localeCompare(b.label));
}
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ActorAlliance = "party" | "opposition" | null;

type DCSlug = SetElement<typeof DC_SLUGS>;

type SaveType = typeof SAVE_TYPES[number];
type SaveType = (typeof SAVE_TYPES)[number];

interface AuraData {
slug: string;
Expand Down
2 changes: 1 addition & 1 deletion src/module/apps/compendium-browser/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface PackInfo {
name: string;
}
export type TabName = "action" | "bestiary" | "equipment" | "feat" | "hazard" | "spell" | "settings";
export type BrowserTab = InstanceType<typeof browserTabs[keyof typeof browserTabs]>;
export type BrowserTab = InstanceType<(typeof browserTabs)[keyof typeof browserTabs]>;
export type TabData<T> = Record<TabName, T | null>;

export type CommonSortByOption = "name" | "level";
Expand Down
4 changes: 2 additions & 2 deletions src/module/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { ItemPF2e } from "@item";
const SIZES = ["tiny", "sm", "med", "lg", "huge", "grg"] as const;
const SIZE_SLUGS = ["tiny", "small", "medium", "large", "huge", "gargantuan"] as const;

type Size = typeof SIZES[number];
type Size = (typeof SIZES)[number];

/** The rarity trait of creatures, equipment, spells, etc. */
const RARITIES = ["common", "uncommon", "rare", "unique"] as const;
type Rarity = typeof RARITIES[number];
type Rarity = (typeof RARITIES)[number];

interface ValuesList<T extends string = string> {
value: T[];
Expand Down
2 changes: 1 addition & 1 deletion src/module/item/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type { WeaponData, WeaponSource } from "@item/weapon/data";
import { PROFICIENCY_RANKS } from "@module/data";
import { PhysicalItemTraits } from "../physical/data";

export type ProficiencyRank = typeof PROFICIENCY_RANKS[number];
export type ProficiencyRank = (typeof PROFICIENCY_RANKS)[number];

export type NonPhysicalItemType =
| "action"
Expand Down
2 changes: 1 addition & 1 deletion src/module/item/deity/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import enJSON from "../../../../static/lang/en.json";

type DeityDomain = Lowercase<keyof typeof enJSON["PF2E"]["Item"]["Deity"]["Domain"]>;
type DeityDomain = Lowercase<keyof (typeof enJSON)["PF2E"]["Item"]["Deity"]["Domain"]>;

export { DeityDomain };
2 changes: 1 addition & 1 deletion src/module/item/spell/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MAGIC_SCHOOLS, MAGIC_TRADITIONS, SPELL_COMPONENTS } from "./values";

type MagicSchool = SetElement<typeof MAGIC_SCHOOLS>;
type MagicTradition = SetElement<typeof MAGIC_TRADITIONS>;
type SpellComponent = typeof SPELL_COMPONENTS[number];
type SpellComponent = (typeof SPELL_COMPONENTS)[number];
type SpellTrait = keyof ConfigPF2e["PF2E"]["spellTraits"] | MagicSchool | MagicTradition;

type EffectAreaSize = keyof ConfigPF2e["PF2E"]["areaSizes"];
Expand Down
2 changes: 1 addition & 1 deletion src/module/item/spellcasting-entry/trick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Statistic } from "@system/statistic";
import { BaseSpellcastingEntry, CastOptions } from "./data";

export const TRICK_MAGIC_SKILLS = ["arcana", "nature", "occultism", "religion"] as const;
export type TrickMagicItemSkill = typeof TRICK_MAGIC_SKILLS[number];
export type TrickMagicItemSkill = (typeof TRICK_MAGIC_SKILLS)[number];

const TrickMagicTradition = {
arcana: "arcane",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { MigrationBase } from "../base";
const LEGIT_TRADITIONS = ["arcane", "divine", "occult", "primal", "focus", "ritual", "halcyon", ""] as const;

interface HighestTradition {
name: typeof LEGIT_TRADITIONS[number];
name: (typeof LEGIT_TRADITIONS)[number];
value: number;
}

interface Tradition {
value: typeof LEGIT_TRADITIONS[number];
value: (typeof LEGIT_TRADITIONS)[number];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Migration644SpellcastingCategory extends MigrationBase {
if (!actor || item.type !== "spellcastingEntry") return;
interface SpellcastingOld extends Omit<SpellcastingEntrySystemData, "tradition"> {
tradition: {
value: typeof oldTraditions[number];
value: (typeof oldTraditions)[number];
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Migration674StableHomebrewTagIDs extends MigrationBase {

private homebrewTags = this.homebrewKeys.reduce(
(settings, key) => mergeObject(settings, { [key]: game.settings.get("pf2e", `homebrew.${key}`) }),
{} as Record<typeof this.homebrewKeys[number], HomebrewTag[]>
{} as Record<(typeof this.homebrewKeys)[number], HomebrewTag[]>
);

private updateDocumentTags(documentTags: string[] = []): void {
Expand Down
2 changes: 1 addition & 1 deletion src/module/migration/migrations/711-heritage-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Migration711HeritageItems extends MigrationBase {
}
}

type FeatKeys = typeof toDelete[number];
type FeatKeys = (typeof toDelete)[number];
type DeletionKeys = `-=${FeatKeys}`;
type FeatPropertyDeletions = DeepPartial<Omit<FeatSystemSource, "traits">> & {
[K in DeletionKeys | FeatKeys]?: unknown;
Expand Down
2 changes: 1 addition & 1 deletion src/module/rules/rule-element/adjust-strike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ type AdjustStrikeSchema = AELikeSchema & {
definition: PredicateField;
};

type AdjustStrikeProperty = SetElement<typeof AdjustStrikeRuleElement["VALID_PROPERTIES"]>;
type AdjustStrikeProperty = SetElement<(typeof AdjustStrikeRuleElement)["VALID_PROPERTIES"]>;

interface AdjustStrikeSource extends Exclude<AELikeSource, "path"> {
property?: unknown;
Expand Down
4 changes: 2 additions & 2 deletions src/module/rules/rule-element/ae-like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ type AELikeSchema = RuleElementSchema & {
phase: StringField<AELikeDataPrepPhase, AELikeDataPrepPhase, true, false, true>;
};

type AELikeChangeMode = keyof typeof AELikeRuleElement["CHANGE_MODES"];
type AELikeDataPrepPhase = typeof AELikeRuleElement["PHASES"][number];
type AELikeChangeMode = keyof (typeof AELikeRuleElement)["CHANGE_MODES"];
type AELikeDataPrepPhase = (typeof AELikeRuleElement)["PHASES"][number];

interface AELikeData extends RuleElementData {
path: string;
Expand Down
2 changes: 1 addition & 1 deletion src/module/system/damage/formula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AssembledFormula {
/** Convert the damage definition into a final formula, depending on whether the hit is a critical or not. */
function createDamageFormula(
damage: DamageFormulaData,
degree: typeof DEGREE_OF_SUCCESS["SUCCESS" | "CRITICAL_SUCCESS"]
degree: (typeof DEGREE_OF_SUCCESS)["SUCCESS" | "CRITICAL_SUCCESS"]
): AssembledFormula;
function createDamageFormula(damage: DamageFormulaData): AssembledFormula;
function createDamageFormula(damage: DamageFormulaData, degree: typeof DEGREE_OF_SUCCESS.CRITICAL_FAILURE): null;
Expand Down
2 changes: 1 addition & 1 deletion src/module/system/damage/weapon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ class WeaponDamagePF2e {
/** Apply damage dice overrides and create a damage formula */
static #finalizeDamage(
damage: DamageFormulaData,
degree: typeof DEGREE_OF_SUCCESS["SUCCESS" | "CRITICAL_SUCCESS"]
degree: (typeof DEGREE_OF_SUCCESS)["SUCCESS" | "CRITICAL_SUCCESS"]
): AssembledFormula;
static #finalizeDamage(damage: DamageFormulaData, degree: typeof DEGREE_OF_SUCCESS.CRITICAL_FAILURE): null;
static #finalizeDamage(damage: DamageFormulaData, degree?: DegreeOfSuccessIndex): AssembledFormula | null;
Expand Down
4 changes: 2 additions & 2 deletions src/module/system/degree-of-success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const DEGREE_ADJUSTMENT_AMOUNTS = {
INCREASE_BY_TWO: 2,
} as const;

type DegreeAdjustmentAmount = typeof DEGREE_ADJUSTMENT_AMOUNTS[keyof typeof DEGREE_ADJUSTMENT_AMOUNTS];
type DegreeAdjustmentAmount = (typeof DEGREE_ADJUSTMENT_AMOUNTS)[keyof typeof DEGREE_ADJUSTMENT_AMOUNTS];

type DegreeAdjustmentsRecord = {
[key in "all" | DegreeOfSuccessString]?: { label: string; amount: DegreeAdjustmentAmount };
Expand Down Expand Up @@ -150,7 +150,7 @@ const DEGREE_OF_SUCCESS = {
type DegreeOfSuccessIndex = ZeroToThree;

const DEGREE_OF_SUCCESS_STRINGS = ["criticalFailure", "failure", "success", "criticalSuccess"] as const;
type DegreeOfSuccessString = typeof DEGREE_OF_SUCCESS_STRINGS[number];
type DegreeOfSuccessString = (typeof DEGREE_OF_SUCCESS_STRINGS)[number];

export {
CheckDC,
Expand Down
4 changes: 2 additions & 2 deletions src/module/system/rolls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ interface BaseRollContext {
/** Any traits for the check. */
traits?: TraitViewData[];
/** The outcome a roll (usually relevant only to rerolls) */
outcome?: typeof DEGREE_OF_SUCCESS_STRINGS[number] | null;
outcome?: (typeof DEGREE_OF_SUCCESS_STRINGS)[number] | null;
/** The outcome prior to being changed by abilities raising or lowering degree of success */
unadjustedOutcome?: typeof DEGREE_OF_SUCCESS_STRINGS[number] | null;
unadjustedOutcome?: (typeof DEGREE_OF_SUCCESS_STRINGS)[number] | null;
/** Should the roll be immediately created as a chat message? */
createMessage?: boolean;
/** Skip the roll dialog regardless of user setting */
Expand Down
2 changes: 1 addition & 1 deletion src/module/system/settings/automation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PartialSettingsData, SettingsMenuPF2e } from "./menu";

type ConfigPF2eListName = typeof AutomationSettings.SETTINGS[number];
type ConfigPF2eListName = (typeof AutomationSettings.SETTINGS)[number];

export class AutomationSettings extends SettingsMenuPF2e {
static override readonly namespace = "automation";
Expand Down
2 changes: 1 addition & 1 deletion src/module/system/settings/homebrew/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const SECONDARY_TRAIT_RECORDS = {
weaponTraits: ["npcAttackTraits"],
} as const;

type HomebrewTraitKey = typeof HOMEBREW_TRAIT_KEYS[number];
type HomebrewTraitKey = (typeof HOMEBREW_TRAIT_KEYS)[number];
type HomebrewKey = HomebrewTraitKey | "damageTypes";
type HomebrewTraitSettingsKey = `homebrew.${HomebrewTraitKey}`;

Expand Down
4 changes: 2 additions & 2 deletions src/module/system/tag-selector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export { SpeedSelector } from "./speeds";
export { TagSelectorOptions } from "./base";

const TAG_SELECTOR_TYPES = ["basic", "senses", "speed-types"] as const;
type TagSelectorType = typeof TAG_SELECTOR_TYPES[number];
type TagSelectorType = (typeof TAG_SELECTOR_TYPES)[number];

// CONFIG properties that can be used in a tag selector
const SELECTABLE_TAG_FIELDS = [
Expand Down Expand Up @@ -82,6 +82,6 @@ const SELECTABLE_TAG_FIELDS = [
"weaponTraits",
] as const;

type SelectableTagField = typeof SELECTABLE_TAG_FIELDS[number];
type SelectableTagField = (typeof SELECTABLE_TAG_FIELDS)[number];

export { SELECTABLE_TAG_FIELDS, SelectableTagField, TAG_SELECTOR_TYPES, TagSelectorType };
2 changes: 1 addition & 1 deletion src/scripts/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const equivalentWeapons = {

const rangeDescriptions = RANGE_TRAITS.reduce(
(descriptions, trait) => mergeObject(descriptions, { [trait]: "PF2E.TraitDescriptionRange" }),
{} as Record<typeof RANGE_TRAITS[number], string>
{} as Record<(typeof RANGE_TRAITS)[number], string>
);

const preciousMaterialDescriptions = {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/config/traits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ const otherWeaponTags: Record<OtherWeaponTag, string> = {

const rangeTraits = RANGE_TRAITS.reduce(
(descriptions, trait) => ({ ...descriptions, [trait]: `PF2E.Trait${sluggify(trait, { camel: "bactrian" })}` }),
{} as Record<typeof RANGE_TRAITS[number], string>
{} as Record<(typeof RANGE_TRAITS)[number], string>
);

const npcAttackTraits = {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/macros/rest-for-the-night.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function restForTheNight(options: ActionDefaultOptions): Promise<Ch

// Conditions
const RECOVERABLE_CONDITIONS = ["doomed", "drained", "fatigued", "wounded"] as const;
const conditionChanges: Record<typeof RECOVERABLE_CONDITIONS[number], "removed" | "reduced" | null> = {
const conditionChanges: Record<(typeof RECOVERABLE_CONDITIONS)[number], "removed" | "reduced" | null> = {
doomed: null,
drained: null,
fatigued: null,
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/set-game-pf2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SetGamePF2e = {
...ActionMacros,
};

const initSafe: Partial<typeof game["pf2e"]> = {
const initSafe: Partial<(typeof game)["pf2e"]> = {
Check: CheckPF2e,
CheckModifier: CheckModifier,
Coins: CoinsPF2e,
Expand Down

0 comments on commit a463423

Please sign in to comment.