mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:40:44 +00:00
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:
+1
-1
@@ -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",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user