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:
Scott Anderson
2025-08-07 19:13:42 -04:00
committed by GitHub
parent 63cb51a4f9
commit b56e380107
48 changed files with 320 additions and 254 deletions
+2 -1
View File
@@ -184,9 +184,10 @@ export class NukeExecution implements Execution {
this.mg.config().defaultNukeTargetableRange() ** 2;
const allTiles: TileRef[] = this.pathFinder.allTiles();
for (const tile of allTiles) {
const targetable = this.isTargetable(target, tile, targetRangeSquared);
trajectoryTiles.push({
targetable,
tile,
targetable: this.isTargetable(target, tile, targetRangeSquared),
});
}
+3 -1
View File
@@ -18,6 +18,7 @@ export class RailroadExecution implements Execution {
return this.active;
}
/* eslint-disable sort-keys */
init(mg: Game, ticks: number): void {
this.mg = mg;
const tiles = this.railRoad.tiles;
@@ -48,6 +49,7 @@ export class RailroadExecution implements Execution {
: RailType.VERTICAL,
});
}
/* eslint-enable sort-keys */
private computeExtremityDirection(tile: TileRef, next: TileRef): RailType {
const x = this.mg.x(tile);
@@ -143,9 +145,9 @@ export class RailroadExecution implements Execution {
}
if (updatedRailTiles) {
this.mg.addUpdate({
type: GameUpdateType.RailroadEvent,
isActive: true,
railTiles: updatedRailTiles,
type: GameUpdateType.RailroadEvent,
});
}
}
@@ -98,6 +98,7 @@ class SAMTargetingSystem {
}
const interceptionTile = this.computeInterceptionTile(nuke.unit);
if (interceptionTile !== undefined) {
// eslint-disable-next-line sort-keys
targets.push({ unit: nuke.unit, tile: interceptionTile });
} else {
// Store unreachable nukes in order to prevent useless interception computation
+1 -1
View File
@@ -43,8 +43,8 @@ export class TradeShipExecution implements Execution {
return;
}
this.tradeShip = this.origOwner.buildUnit(UnitType.TradeShip, spawn, {
targetUnit: this._dstPort,
lastSetSafeFromPirates: ticks,
targetUnit: this._dstPort,
});
this.mg.stats().boatSendTrade(this.origOwner, this._dstPort.owner());
}
+1 -1
View File
@@ -119,8 +119,8 @@ export class TrainExecution implements Execution {
for (let i = 0; i < this.numCars; i++) {
this.cars.push(
this.player.buildUnit(UnitType.Train, tile, {
trainType: TrainType.Carriage,
loaded: this.hasCargo,
trainType: TrainType.Carriage,
}),
);
}
+1 -1
View File
@@ -113,7 +113,7 @@ export class WarshipExecution implements Execution {
continue;
}
}
potentialTargets.push({ unit: unit, distSquared });
potentialTargets.push({ distSquared, unit });
}
return potentialTargets.sort((a, b) => {