From 6547e1d5ce9704a9b1afaf10465033a533c722d3 Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Sun, 22 Jun 2025 21:34:06 -0400 Subject: [PATCH] [Dev] Update depcruiser to enforce no non-type export in `src/@types/` https://github.com/pagefaultgames/pokerogue/pull/5949 * Add depcruiser rule to enforce no non-type export in `src/@types` * Add missing field in config * Fixed type import inside `move.ts` --- .dependency-cruiser.cjs | 13 +++++++++++++ src/data/moves/move.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjs index 84d01599727..141402a1239 100644 --- a/.dependency-cruiser.cjs +++ b/.dependency-cruiser.cjs @@ -1,6 +1,19 @@ /** @type {import('dependency-cruiser').IConfiguration} */ module.exports = { forbidden: [ + { + name: "no-non-type-@type-exports", + severity: "error", + comment: + "Files in @types should not export anything but types and interfaces. " + + "The folder is intended to house imports that are removed at runtime, " + + "and thus should not contain anything with a bearing on runtime code.", + from: {}, + to: { + path: "(^|/)src/@types", + dependencyTypesNot: ["type-only"], + }, + }, { name: "only-type-imports", severity: "error", diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index cf41d9d5522..f05c0c3014b 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -85,7 +85,7 @@ import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; import { MultiHitType } from "#enums/MultiHitType"; import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves, invalidSketchMoves } from "./invalid-moves"; import { isVirtual, MoveUseMode } from "#enums/move-use-mode"; -import { ChargingMove, MoveAttrMap, MoveAttrString, MoveKindString, MoveClassMap } from "#app/@types/move-types"; +import type { ChargingMove, MoveAttrMap, MoveAttrString, MoveKindString, MoveClassMap } from "#app/@types/move-types"; import { applyMoveAttrs } from "./apply-attrs"; import { frenzyMissFunc, getMoveTargets } from "./move-utils"; import { AbAttrBaseParams, AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "../abilities/ability";