Enabled the @typescript-eslint/no-unused-expressions eslint rule (#2014)

## Description:

- Fixes #1790
- Fixed the codebase:
- expressions short-circuiting with `&&` changed to proper `if`
statements
  - `A instanceof B;` expressions now emit warnings

## 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

## Please put your Discord username so you can be contacted if a bug or
regression is found:
michal7952

---------

Co-authored-by: Evan <evanpelle@gmail.com>
This commit is contained in:
Michal Martínek
2025-10-14 11:10:52 -07:00
committed by GitHub
co-authored by Evan
parent b58d140f94
commit 522413678a
5 changed files with 48 additions and 18 deletions
+2 -2
View File
@@ -1051,7 +1051,7 @@ export class EventsDisplay extends LitElement implements Layer {
? this.renderButton({
content: this.getEventDescription(event),
onClick: () => {
event.focusID &&
if (event.focusID)
this.emitGoToPlayerEvent(event.focusID);
},
className: "text-left",
@@ -1060,7 +1060,7 @@ export class EventsDisplay extends LitElement implements Layer {
? this.renderButton({
content: this.getEventDescription(event),
onClick: () => {
event.unitView &&
if (event.unitView)
this.emitGoToUnitEvent(
event.unitView,
);
@@ -255,7 +255,9 @@ export class StructureIconsLayer implements Layer {
this.potentialUpgrade.iconContainer.filters = [];
this.potentialUpgrade.dotContainer.filters = [];
}
this.ghostUnit?.container && (this.ghostUnit.container.filters = []);
if (this.ghostUnit?.container) {
this.ghostUnit.container.filters = [];
}
if (!this.ghostUnit) return;