Enable the prefer-destructuring eslint rule (#1858)

## Description:

Enable the `prefer-destructuring` eslint rule.

## 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
This commit is contained in:
Scott Anderson
2025-08-18 20:45:21 -04:00
committed by GitHub
parent 42394d4476
commit 7bb319fcad
29 changed files with 43 additions and 40 deletions
+4 -4
View File
@@ -67,7 +67,7 @@ export class FakeHumanExecution implements Execution {
}
private updateRelationsFromEmbargos() {
const player = this.player;
const { player } = this;
if (player === null) return;
const others = this.mg.players().filter((p) => p.id() !== player.id());
@@ -90,7 +90,7 @@ export class FakeHumanExecution implements Execution {
}
private handleEmbargoesToHostileNations() {
const player = this.player;
const { player } = this;
if (player === null) return;
const others = this.mg.players().filter((p) => p.id() !== player.id());
@@ -248,7 +248,7 @@ export class FakeHumanExecution implements Execution {
if (other.isTraitor()) {
return false;
}
const difficulty = this.mg.config().gameConfig().difficulty;
const { difficulty } = this.mg.config().gameConfig();
if (
difficulty === Difficulty.Hard ||
difficulty === Difficulty.Impossible
@@ -491,7 +491,7 @@ export class FakeHumanExecution implements Execution {
private structureSpawnTileValue(type: UnitType): (tile: TileRef) => number {
if (this.player === null) throw new Error("not initialized");
const borderTiles = this.player.borderTiles();
const mg = this.mg;
const { mg } = this;
const otherUnits = this.player.units(type);
// Prefer spacing structures out of atom bomb range
const borderSpacing = this.mg.config().nukeMagnitudes(UnitType.AtomBomb).outer;