Enable ESLint rule no-case-declarations (#2113)

## Description:

This PR enables the ESLint rule `no-case-declarations`.
Fixes #1791 

The issue was already assigned, but since there hasn’t been any activity
for about a month, I decided to open this PR.

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

aotumuri
This commit is contained in:
Aotumuri
2025-10-01 03:11:44 +09:00
committed by GitHub
parent 9e9d689175
commit d48801d3d7
4 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -42,7 +42,6 @@ export default [
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-case-declarations": "off",
},
},
{
@@ -50,6 +49,7 @@ export default [
// Enable rules
"@typescript-eslint/prefer-nullish-coalescing": "error",
eqeqeq: "error",
"no-case-declarations": "error",
},
},
];
+2 -2
View File
@@ -312,7 +312,7 @@ export class UILayer implements Layer {
return 1;
}
switch (unit.type()) {
case UnitType.Construction:
case UnitType.Construction: {
const constructionType = unit.constructionType();
if (constructionType === undefined) {
return 1;
@@ -326,7 +326,7 @@ export class UILayer implements Layer {
(this.game.ticks() - unit.createdAt()) /
(constDuration === 0 ? 1 : constDuration)
);
}
case UnitType.MissileSilo:
case UnitType.SAMLauncher:
return unit.missileReadinesss();
+2 -2
View File
@@ -95,7 +95,7 @@ export class PastelTheme implements Theme {
}
switch (gm.terrainType(tile)) {
case TerrainType.Ocean:
case TerrainType.Lake:
case TerrainType.Lake: {
const w = this.water.rgba;
if (gm.isShoreline(tile) && gm.isWater(tile)) {
return this.shorelineWater;
@@ -105,7 +105,7 @@ export class PastelTheme implements Theme {
g: Math.max(w.g - 10 + (11 - Math.min(mag, 10)), 0),
b: Math.max(w.b - 10 + (11 - Math.min(mag, 10)), 0),
});
}
case TerrainType.Plains:
return colord({
r: 190,
+2 -1
View File
@@ -16,7 +16,7 @@ export class PastelThemeDark extends PastelTheme {
}
switch (gm.terrainType(tile)) {
case TerrainType.Ocean:
case TerrainType.Lake:
case TerrainType.Lake: {
const w = this.darkWater.rgba;
if (gm.isShoreline(tile) && gm.isWater(tile)) {
return this.darkShorelineWater;
@@ -29,6 +29,7 @@ export class PastelThemeDark extends PastelTheme {
});
}
return this.darkWater;
}
case TerrainType.Plains:
return colord({
r: 140,