From 4d0324c5cc63baa41a503b1c88ae4d9ee073e60b Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 6 May 2026 21:43:03 -0600 Subject: [PATCH] run formatter --- CONTRIBUTING.md | 1 - README.md | 4 -- src/core/pathfinding/PathFinder.Parabola.ts | 4 +- src/core/worker/WorkerMessages.ts | 3 +- tests/client/clan/ClanModal.handlers.test.ts | 55 ++++++++----------- tests/client/clan/ClanModal.rendering.test.ts | 5 +- 6 files changed, 26 insertions(+), 46 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47092e78f..cf09be982 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,7 +101,6 @@ All new features and bug fixes should include relevant tests. We use **Vitest**. ## Submitting a Pull Request 1. **Commit your changes**: - - Write clear, concise commit messages. - Use the present tense ("Add feature" not "Added feature"). diff --git a/README.md b/README.md index aa43002a2..5d33f9c96 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,6 @@ Feel free to ask questions in the translation Discord server! To ensure code quality and project stability, we use a progressive contribution system: 1. **New Contributors**: Limited to UI improvements and small bug fixes only - - This helps you become familiar with the codebase - UI changes are easier to review and less likely to break core functionality - Small, focused PRs have a higher chance of being accepted @@ -193,20 +192,17 @@ To ensure code quality and project stability, we use a progressive contribution ### How to Contribute Successfully 1. **Before Starting Work**: - - Open an issue describing what you want to contribute - Wait for maintainer feedback before investing significant time - Small improvements can proceed directly to PR stage 2. **Code Quality Requirements**: - - All code must be well-commented and follow existing style patterns - New features should not break existing functionality - Code should be thoroughly tested before submission - All code changes in src/core _MUST_ be tested. 3. **Pull Request Process**: - - Keep PRs focused on a single feature or bug fix - Include screenshots for UI changes - Describe what testing you've performed diff --git a/src/core/pathfinding/PathFinder.Parabola.ts b/src/core/pathfinding/PathFinder.Parabola.ts index c58f49fbc..83a6de28a 100644 --- a/src/core/pathfinding/PathFinder.Parabola.ts +++ b/src/core/pathfinding/PathFinder.Parabola.ts @@ -11,9 +11,7 @@ export interface ParabolaOptions { const PARABOLA_MIN_HEIGHT = 50; -export class ParabolaUniversalPathFinder - implements SteppingPathFinder -{ +export class ParabolaUniversalPathFinder implements SteppingPathFinder { private curve: DistanceBasedBezierCurve | null = null; private lastTo: TileRef | null = null; diff --git a/src/core/worker/WorkerMessages.ts b/src/core/worker/WorkerMessages.ts index 5f4d3990f..c3d662995 100644 --- a/src/core/worker/WorkerMessages.ts +++ b/src/core/worker/WorkerMessages.ts @@ -121,8 +121,7 @@ export interface AttackClusteredPositionsMessage extends BaseWorkerMessage { attackID?: string; } -export interface AttackClusteredPositionsResultMessage - extends BaseWorkerMessage { +export interface AttackClusteredPositionsResultMessage extends BaseWorkerMessage { type: "attack_clustered_positions_result"; attacks: { id: string; positions: { x: number; y: number }[] }[]; } diff --git a/tests/client/clan/ClanModal.handlers.test.ts b/tests/client/clan/ClanModal.handlers.test.ts index 39753b8b6..ffcd97f79 100644 --- a/tests/client/clan/ClanModal.handlers.test.ts +++ b/tests/client/clan/ClanModal.handlers.test.ts @@ -53,9 +53,8 @@ describe("ClanModal — handlers", () => { describe("handleApprove increments selectedClan.memberCount", () => { it("increments memberCount by 1 after successful approveClanRequest", async () => { - const { approveClanRequest, fetchClanRequests } = await import( - "../../../src/client/ClanApi" - ); + const { approveClanRequest, fetchClanRequests } = + await import("../../../src/client/ClanApi"); (approveClanRequest as ReturnType).mockResolvedValue(true); (fetchClanRequests as ReturnType).mockResolvedValueOnce({ results: [ @@ -90,9 +89,8 @@ describe("ClanModal — handlers", () => { }); it("does not increment memberCount when approveClanRequest fails", async () => { - const { approveClanRequest, fetchClanRequests } = await import( - "../../../src/client/ClanApi" - ); + const { approveClanRequest, fetchClanRequests } = + await import("../../../src/client/ClanApi"); (approveClanRequest as ReturnType).mockResolvedValue({ error: "clan_modal.error_generic", }); @@ -125,9 +123,8 @@ describe("ClanModal — handlers", () => { }); it("treats undefined memberCount as 0 and increments to 1", async () => { - const { approveClanRequest, fetchClanRequests } = await import( - "../../../src/client/ClanApi" - ); + const { approveClanRequest, fetchClanRequests } = + await import("../../../src/client/ClanApi"); (approveClanRequest as ReturnType).mockResolvedValue(true); (fetchClanRequests as ReturnType).mockResolvedValueOnce({ results: [ @@ -271,9 +268,8 @@ describe("ClanModal — handlers", () => { }); it("handleBan syncs memberCount via clan-updated event on success", async () => { - const { banClanMember, fetchClanMembers } = await import( - "../../../src/client/ClanApi" - ); + const { banClanMember, fetchClanMembers } = + await import("../../../src/client/ClanApi"); (banClanMember as ReturnType).mockResolvedValue(true); // Server returns the post-ban member total (was 5, now 4). (fetchClanMembers as ReturnType).mockResolvedValueOnce({ @@ -310,9 +306,8 @@ describe("ClanModal — handlers", () => { describe("handleUnban", () => { it("removes ban from list and decrements total on success", async () => { - const { unbanClanMember, fetchClanBans } = await import( - "../../../src/client/ClanApi" - ); + const { unbanClanMember, fetchClanBans } = + await import("../../../src/client/ClanApi"); (unbanClanMember as ReturnType).mockResolvedValue(true); (fetchClanBans as ReturnType).mockResolvedValueOnce({ results: [ @@ -377,9 +372,8 @@ describe("ClanModal — handlers", () => { }); it("calls kickMember and syncs memberCount on success", async () => { - const { kickMember, fetchClanMembers } = await import( - "../../../src/client/ClanApi" - ); + const { kickMember, fetchClanMembers } = + await import("../../../src/client/ClanApi"); (kickMember as ReturnType).mockResolvedValue(true); (fetchClanMembers as ReturnType).mockResolvedValueOnce({ results: [], @@ -411,9 +405,8 @@ describe("ClanModal — handlers", () => { }); it("does not mutate state when kickMember fails", async () => { - const { kickMember, fetchClanMembers } = await import( - "../../../src/client/ClanApi" - ); + const { kickMember, fetchClanMembers } = + await import("../../../src/client/ClanApi"); (kickMember as ReturnType).mockResolvedValue({ error: "clan_modal.error_generic", }); @@ -600,9 +593,8 @@ describe("ClanModal — handlers", () => { describe("handleJoin", () => { beforeEach(async () => { - const { fetchClanDetail, fetchClanStats } = await import( - "../../../src/client/ClanApi" - ); + const { fetchClanDetail, fetchClanStats } = + await import("../../../src/client/ClanApi"); (fetchClanDetail as ReturnType).mockResolvedValueOnce( makeClan({ isOpen: true, memberCount: 5 }), ); @@ -615,9 +607,8 @@ describe("ClanModal — handlers", () => { }); it("switches detail view into member mode immediately after open-clan join", async () => { - const { joinClan, fetchClanMembers } = await import( - "../../../src/client/ClanApi" - ); + const { joinClan, fetchClanMembers } = + await import("../../../src/client/ClanApi"); (joinClan as ReturnType).mockResolvedValueOnce({ status: "joined", }); @@ -781,9 +772,8 @@ describe("ClanModal — handlers", () => { }); it("clears confirmAction and removes the dialog after confirming", async () => { - const { transferLeadership } = await import( - "../../../src/client/ClanApi" - ); + const { transferLeadership } = + await import("../../../src/client/ClanApi"); (transferLeadership as ReturnType).mockResolvedValue(true); const dialog = modal.querySelector("confirm-dialog"); @@ -802,9 +792,8 @@ describe("ClanModal — handlers", () => { }); it("clears confirmAction when cancel is clicked, without calling the API", async () => { - const { transferLeadership } = await import( - "../../../src/client/ClanApi" - ); + const { transferLeadership } = + await import("../../../src/client/ClanApi"); const dialog = modal.querySelector("confirm-dialog"); expect(dialog).toBeTruthy(); diff --git a/tests/client/clan/ClanModal.rendering.test.ts b/tests/client/clan/ClanModal.rendering.test.ts index a80c7693b..a94d18585 100644 --- a/tests/client/clan/ClanModal.rendering.test.ts +++ b/tests/client/clan/ClanModal.rendering.test.ts @@ -241,9 +241,8 @@ describe("ClanModal — rendering", () => { }); it("shows 0 in the stats row of the detail view when memberCount is undefined", async () => { - const { fetchClanDetail, fetchClanStats } = await import( - "../../../src/client/ClanApi" - ); + const { fetchClanDetail, fetchClanStats } = + await import("../../../src/client/ClanApi"); (fetchClanDetail as ReturnType).mockResolvedValueOnce( makeClan({ memberCount: undefined }), );