mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 11:54:25 +00:00
Enable the sort-keys eslint rule (#1746)
## Description: Enable the `sort-keys` eslint rule. Fixes #1629 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [ ] I have read and accepted the CLA agreement (only required once).
This commit is contained in:
@@ -23,8 +23,8 @@ function gameUpdate(gu: GameUpdateViewData | ErrorUpdate) {
|
||||
return;
|
||||
}
|
||||
sendMessage({
|
||||
type: "game_update",
|
||||
gameUpdate: gu,
|
||||
type: "game_update",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
gameUpdate,
|
||||
).then((gr) => {
|
||||
sendMessage({
|
||||
type: "initialized",
|
||||
id: message.id,
|
||||
type: "initialized",
|
||||
} as InitializedMessage);
|
||||
return gr;
|
||||
});
|
||||
@@ -85,9 +85,9 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
message.y,
|
||||
);
|
||||
sendMessage({
|
||||
type: "player_actions_result",
|
||||
id: message.id,
|
||||
result: actions,
|
||||
type: "player_actions_result",
|
||||
} as PlayerActionsResultMessage);
|
||||
} catch (error) {
|
||||
console.error("Failed to check borders:", error);
|
||||
@@ -102,9 +102,9 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
try {
|
||||
const profile = (await gameRunner).playerProfile(message.playerID);
|
||||
sendMessage({
|
||||
type: "player_profile_result",
|
||||
id: message.id,
|
||||
result: profile,
|
||||
type: "player_profile_result",
|
||||
} as PlayerProfileResultMessage);
|
||||
} catch (error) {
|
||||
console.error("Failed to check borders:", error);
|
||||
@@ -121,9 +121,9 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
message.playerID,
|
||||
);
|
||||
sendMessage({
|
||||
type: "player_border_tiles_result",
|
||||
id: message.id,
|
||||
result: borderTiles,
|
||||
type: "player_border_tiles_result",
|
||||
} as PlayerBorderTilesResultMessage);
|
||||
} catch (error) {
|
||||
console.error("Failed to get border tiles:", error);
|
||||
@@ -141,8 +141,8 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
message.attackID,
|
||||
);
|
||||
sendMessage({
|
||||
type: "attack_average_position_result",
|
||||
id: message.id,
|
||||
type: "attack_average_position_result",
|
||||
x: averagePosition ? averagePosition.x : null,
|
||||
y: averagePosition ? averagePosition.y : null,
|
||||
} as AttackAveragePositionResultMessage);
|
||||
@@ -162,9 +162,9 @@ ctx.addEventListener("message", async (e: MessageEvent<MainThreadMessage>) => {
|
||||
message.targetTile,
|
||||
);
|
||||
sendMessage({
|
||||
type: "transport_ship_spawn_result",
|
||||
id: message.id,
|
||||
result: spawnTile,
|
||||
type: "transport_ship_spawn_result",
|
||||
} as TransportShipSpawnResultMessage);
|
||||
} catch (error) {
|
||||
console.error("Failed to spawn transport ship:", error);
|
||||
|
||||
@@ -66,10 +66,10 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "init",
|
||||
id: messageId,
|
||||
gameStartInfo: this.gameStartInfo,
|
||||
clientID: this.clientID,
|
||||
gameStartInfo: this.gameStartInfo,
|
||||
id: messageId,
|
||||
type: "init",
|
||||
});
|
||||
|
||||
// Add timeout for initialization
|
||||
@@ -95,8 +95,8 @@ export class WorkerClient {
|
||||
}
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "turn",
|
||||
turn,
|
||||
type: "turn",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "player_profile",
|
||||
id: messageId,
|
||||
playerID: playerID,
|
||||
playerID,
|
||||
type: "player_profile",
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -151,9 +151,9 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "player_border_tiles",
|
||||
id: messageId,
|
||||
playerID: playerID,
|
||||
playerID,
|
||||
type: "player_border_tiles",
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -181,9 +181,9 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "player_actions",
|
||||
id: messageId,
|
||||
playerID: playerID,
|
||||
playerID,
|
||||
type: "player_actions",
|
||||
x: x,
|
||||
y: y,
|
||||
});
|
||||
@@ -217,10 +217,10 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "attack_average_position",
|
||||
attackID,
|
||||
id: messageId,
|
||||
playerID: playerID,
|
||||
attackID: attackID,
|
||||
playerID,
|
||||
type: "attack_average_position",
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -247,10 +247,10 @@ export class WorkerClient {
|
||||
});
|
||||
|
||||
this.worker.postMessage({
|
||||
type: "transport_ship_spawn",
|
||||
id: messageId,
|
||||
playerID: playerID,
|
||||
targetTile: targetTile,
|
||||
playerID,
|
||||
targetTile,
|
||||
type: "transport_ship_spawn",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user