mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-14 13:49:18 +00:00
Enable the @stylistic/ts/quotes eslint rule (#1850)
## Description: Enable the `@stylistic/ts/quotes` eslint rule. Fixes #1788 ## 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:
@@ -50,13 +50,13 @@ export class DeleteUnitExecution implements Execution {
|
||||
}
|
||||
|
||||
if (mg.inSpawnPhase()) {
|
||||
console.warn(`SECURITY: cannot delete units during spawn phase`);
|
||||
console.warn("SECURITY: cannot delete units during spawn phase");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.player.canDeleteUnit()) {
|
||||
console.warn(`SECURITY: delete unit cooldown not expired`);
|
||||
console.warn("SECURITY: delete unit cooldown not expired");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export class DeleteUnitExecution implements Execution {
|
||||
this.player.recordDeleteUnit();
|
||||
|
||||
this.mg.displayMessage(
|
||||
`events_display.unit_voluntarily_deleted`,
|
||||
"events_display.unit_voluntarily_deleted",
|
||||
MessageType.UNIT_DESTROYED,
|
||||
this.player.id(),
|
||||
);
|
||||
|
||||
@@ -64,7 +64,7 @@ export class MirvExecution implements Execution {
|
||||
if (this.nuke === null) {
|
||||
const spawn = this.player.canBuild(UnitType.MIRV, this.dst);
|
||||
if (spawn === false) {
|
||||
console.warn(`cannot build MIRV`);
|
||||
console.warn("cannot build MIRV");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export class NukeExecution implements Execution {
|
||||
if (this.nuke === null) {
|
||||
const spawn = this.src ?? this.player.canBuild(this.nukeType, this.dst);
|
||||
if (spawn === false) {
|
||||
console.warn(`cannot build Nuke`);
|
||||
console.warn("cannot build Nuke");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export class NukeExecution implements Execution {
|
||||
|
||||
// make the nuke unactive if it was intercepted
|
||||
if (!this.nuke.isActive()) {
|
||||
console.log(`Nuke destroyed before reaching target`);
|
||||
console.log("Nuke destroyed before reaching target");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class TradeShipExecution implements Execution {
|
||||
this.srcPort.tile(),
|
||||
);
|
||||
if (spawn === false) {
|
||||
console.warn(`cannot build trade ship`);
|
||||
console.warn("cannot build trade ship");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class TrainExecution implements Execution {
|
||||
|
||||
const spawn = this.player.canBuild(UnitType.Train, this.stations[0].tile());
|
||||
if (spawn === false) {
|
||||
console.warn(`cannot build train`);
|
||||
console.warn("cannot build train");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export class TransportShipExecution implements Execution {
|
||||
this.dst,
|
||||
);
|
||||
if (closestTileSrc === false) {
|
||||
console.warn(`can't build transport ship`);
|
||||
console.warn("can't build transport ship");
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ export class TransportShipExecution implements Execution {
|
||||
break;
|
||||
case PathFindResultType.PathNotFound:
|
||||
// TODO: add to poisoned port list
|
||||
console.warn(`path not found to dst`);
|
||||
console.warn("path not found to dst");
|
||||
this.attacker.addTroops(this.boat.troops());
|
||||
this.boat.delete(false);
|
||||
this.active = false;
|
||||
|
||||
@@ -15,7 +15,7 @@ export class UpgradeStructureExecution implements Execution {
|
||||
.find((unit) => unit.id() === this.unitId);
|
||||
|
||||
if (this.structure === undefined) {
|
||||
console.warn(`structure is undefined`);
|
||||
console.warn("structure is undefined");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ export class WarshipExecution implements Execution {
|
||||
this.warship.touch();
|
||||
break;
|
||||
case PathFindResultType.PathNotFound:
|
||||
console.log(`path not found to target`);
|
||||
console.log("path not found to target");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ export class WarshipExecution implements Execution {
|
||||
this.warship.touch();
|
||||
return;
|
||||
case PathFindResultType.PathNotFound:
|
||||
console.warn(`path not found to target tile`);
|
||||
console.warn("path not found to target tile");
|
||||
this.warship.setTargetTile(undefined);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ export class GameImpl implements Game {
|
||||
.incomingAllianceRequests()
|
||||
.find((ar) => ar.requestor() === recipient);
|
||||
if (correspondingReq !== undefined) {
|
||||
console.log(`got corresponding alliance requests, accepting`);
|
||||
console.log("got corresponding alliance requests, accepting");
|
||||
correspondingReq.accept();
|
||||
return null;
|
||||
}
|
||||
@@ -502,7 +502,7 @@ export class GameImpl implements Game {
|
||||
|
||||
conquer(owner: PlayerImpl, tile: TileRef): void {
|
||||
if (!this.isLand(tile)) {
|
||||
throw Error(`cannot conquer water`);
|
||||
throw Error("cannot conquer water");
|
||||
}
|
||||
const previousOwner = this.owner(tile) as TerraNullius | PlayerImpl;
|
||||
if (previousOwner.isPlayer()) {
|
||||
@@ -523,7 +523,7 @@ export class GameImpl implements Game {
|
||||
|
||||
relinquish(tile: TileRef) {
|
||||
if (!this.hasOwner(tile)) {
|
||||
throw new Error(`Cannot relinquish tile because it is unowned`);
|
||||
throw new Error("Cannot relinquish tile because it is unowned");
|
||||
}
|
||||
if (this.isWater(tile)) {
|
||||
throw new Error("Cannot relinquish water");
|
||||
|
||||
@@ -330,7 +330,7 @@ export class PlayerImpl implements Player {
|
||||
}
|
||||
relinquish(tile: TileRef) {
|
||||
if (this.mg.owner(tile) !== this) {
|
||||
throw new Error(`Cannot relinquish tile not owned by this player`);
|
||||
throw new Error("Cannot relinquish tile not owned by this player");
|
||||
}
|
||||
this.mg.relinquish(tile);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ export class PlayerImpl implements Player {
|
||||
|
||||
createAllianceRequest(recipient: Player): AllianceRequest | null {
|
||||
if (this.isAlliedWith(recipient)) {
|
||||
throw new Error(`cannot create alliance request, already allies`);
|
||||
throw new Error("cannot create alliance request, already allies");
|
||||
}
|
||||
return this.mg.createAllianceRequest(this, recipient satisfies Player);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import version from "../../../resources/version.txt";
|
||||
|
||||
const ctx: Worker = self as unknown as Worker;
|
||||
let gameRunner: Promise<GameRunner> | null = null;
|
||||
const mapLoader = new FetchGameMapLoader(`/maps`, version);
|
||||
const mapLoader = new FetchGameMapLoader("/maps", version);
|
||||
|
||||
function gameUpdate(gu: GameUpdateViewData | ErrorUpdate) {
|
||||
// skip if ErrorUpdate
|
||||
|
||||
Reference in New Issue
Block a user