Fix eslint rule 'no-trailing-spaces'

eslint --no-config-lookup --fix --rule '"no-trailing-spaces": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-05-03 17:30:55 +02:00
parent 1da93a6d2f
commit 2b67499e05
No known key found for this signature in database
19 changed files with 28 additions and 28 deletions

View file

@ -1,14 +1,14 @@
var state_before;
var state_after;
function handleInputBeforeGui(ev)
function handleInputBeforeGui(ev)
{
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
state_before = Engine.HotkeyIsPressed("test");
return false;
}
function handleInputAfterGui(ev)
function handleInputAfterGui(ev)
{
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
state_after = Engine.HotkeyIsPressed("test");

View file

@ -10,7 +10,7 @@ TestScript1A.prototype.GetX = function() {
this.entity = -1;
Engine.TS_FAIL("Missed exception");
} catch (e) { }
// and return the value
return this.entity;
};

View file

@ -1,4 +1,4 @@
function AdditionHelper(a, b)
function AdditionHelper(a, b)
{
return a+b;
}

View file

@ -76,7 +76,7 @@ function parseCmdLineArgs(settings, cmdLineArgs)
settings.playerPlacement.setValue(cmdLineArgs['autostart-placement'] ?? "random");
if ('autostart-visibility' in cmdLineArgs)
{
switch (cmdLineArgs['autostart-visibility'])
switch (cmdLineArgs['autostart-visibility'])
{
case 'revealed':
settings.mapExploration.setAllied(true);

View file

@ -68,7 +68,7 @@ GameSettings.prototype.Attributes.VictoryConditions = class VictoryConditions ex
_add(currentActive, currentDisabled, names)
{
let active = clone(currentActive);
for (const name of names)
for (const name of names)
{
if (currentDisabled.has(name))
continue;

View file

@ -7,7 +7,7 @@ function init(initData)
this.settings.fromInitAttributes(initData.attribs);
this.settings.launchGame(initData.playerAssignments, initData.storeReplay);
Engine.SwitchGuiPage("page_loading.xml", {
"attribs": this.settings.finalizedAttributes,
"playerAssignments": initData.playerAssignments

View file

@ -9,7 +9,7 @@ class SavedGameLabel
const savedGameLabel = Engine.GetGUIObjectByName("savedGameLabel");
let labelWidth = Math.min(Engine.GetTextWidth(savedGameLabel.font, savedGameLabel.caption) + 10, maxWidth);
if (isSavedGame)
if (isSavedGame)
{
savedGameLabel.parent.size = new GUISize(
bottomRightPanel.size.left - labelWidth - marginRight,

View file

@ -87,7 +87,7 @@ class TipDisplay
const random = Math.random() * totalProbability;
let cumulative = 0;
for (const category of tipFiles)
for (const category of tipFiles)
{
cumulative += (isMultiplayer ? category.loadingScreenOccurrence_MP : category.loadingScreenOccurrence_SP);
if (random <= cumulative)

View file

@ -7,7 +7,7 @@ class TimeNotificationOverlay
constructor(playerViewControl)
{
this.notificationText = Engine.GetGUIObjectByName("notificationText");
registerSimulationUpdateHandler(this.rebuild.bind(this));
playerViewControl.registerViewedPlayerChangeHandler(this.rebuild.bind(this));
}

View file

@ -1093,7 +1093,7 @@ var g_UnitActions =
return false;
let actionInfo = getActionInfo("focus-fire", target, selection);
return actionInfo.possible && {
"type": "focus-fire",
"cursor": actionInfo.cursor,

View file

@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen");
Engine.LoadLibrary("rmgen-common");
Engine.LoadLibrary("rmbiome");
function* GenerateMap(mapSettings)
function* GenerateMap(mapSettings)
{
setBiome(mapSettings.Biome);
@ -73,7 +73,7 @@ function* GenerateMap(mapSettings)
let startAngle = 0;
if ((pattern === "stronghold") || (pattern === "river"))
{
if (teams.length != 2)
if (teams.length != 2)
{
throw new Error("Too many teams for " + pattern + ", use circle or make two teams.");
pattern = "circle";
@ -180,7 +180,7 @@ function* GenerateMap(mapSettings)
]);
g_Map.log("Creating Plateau");
for (let m = 0; m < randIntInclusive(120, 240); ++m)
for (let m = 0; m < randIntInclusive(120, 240); ++m)
{
let elevRand = randIntInclusive(18, 22);
createArea(
@ -199,7 +199,7 @@ function* GenerateMap(mapSettings)
],
[avoidClasses(clNotMountain, 2, clMountain, 3)]);
}
for (let m = 0; m < randIntInclusive(100, 180); ++m)
for (let m = 0; m < randIntInclusive(100, 180); ++m)
{
const elevRand = randIntInclusive(24, 38);
createArea(

View file

@ -108,7 +108,7 @@ function* GenerateMap(mapSettings)
yield 20;
for (let m = 0; m < randIntInclusive(40, 90); ++m)
for (let m = 0; m < randIntInclusive(40, 90); ++m)
{
let elevRand = randIntInclusive(6, 12);
createArea(
@ -127,7 +127,7 @@ function* GenerateMap(mapSettings)
],
[avoidClasses(clPlayer, 34, clHill, 8)]);
}
for (let m = 0; m < randIntInclusive(60, 100); ++m)
for (let m = 0; m < randIntInclusive(60, 100); ++m)
{
const elevRand = randIntInclusive(14, 36);
createArea(

View file

@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen");
Engine.LoadLibrary("rmgen-common");
Engine.LoadLibrary("rmbiome");
function* GenerateMap(mapSettings)
function* GenerateMap(mapSettings)
{
setBiome(mapSettings.Biome);
@ -93,7 +93,7 @@ function* GenerateMap(mapSettings)
undefined);
g_Map.log("Creating player islands");
for (let i = 0; i < numPlayers; ++i)
for (let i = 0; i < numPlayers; ++i)
{
createArea(
new ClumpPlacer(diskArea(defaultPlayerBaseRadius() * 1.75), 0.8, 0.1, Infinity, playerPosition[i]),
@ -319,7 +319,7 @@ function* GenerateMap(mapSettings)
3 * numPlayers, 50
);
if (currentBiome() == "generic/savanna")
if (currentBiome() == "generic/savanna")
{
g_Map.log("Creating Island Fauna");
group = new SimpleGroup(

View file

@ -161,7 +161,7 @@ function createAreas(centeredPlacer, painter, constraints, amount, retryFactor =
function createAreasInAreas(centeredPlacer, painter, constraints, amount, retryFactor, areas)
{
areas = areas.filter(area => area.getPoints().length);
if (!areas.length)
if (!areas.length)
{
log("createAreasInAreas: 'areas' was either empty or only contained empty areas thus returning an empty array.\n" + new Error().stack);
return [];
@ -196,7 +196,7 @@ function createObjectGroups(group, player, constraints, amount, retryFactor = 10
function createObjectGroupsByAreas(group, player, constraints, amount, retryFactor, areas, behaveDeprecated = false)
{
areas = areas.filter(area => area.getPoints().length);
if (!areas.length)
if (!areas.length)
{
log("createObjectGroupsByAreas: 'areas' was either empty or only contained empty areas.\n" + new Error().stack);
return [];

View file

@ -2,7 +2,7 @@ Trigger.prototype.CounterMessage = function(data)
{
var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
cmpGUIInterface.PushNotification({
"players": [1, 2],
"players": [1, 2],
"message": markForTranslation("Cutscene starts after 5 seconds"),
"translateMessage": true
});

View file

@ -305,7 +305,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater)
y = 0;
let loop = false;
// vertical iteration
do
do
{
--y;
loop = false;
@ -323,7 +323,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater)
let reachLeft = false;
let reachRight = false;
let index;
do
do
{
index = newIndex + w*y;

View file

@ -578,7 +578,7 @@ PETRA.DefenseManager.prototype.checkEvents = function(gameState, events)
}
continue;
}
// TODO integrate other ships later, need to be sure it is accessible.
if (target.hasClass("Ship"))
continue;

View file

@ -368,7 +368,7 @@ BuildingAI.prototype.FireArrows = function()
const yOrigin = cmpAttack.GetAttackYOrigin(attackType);
let firedArrows = 0;
let targetIndex = 0;
let targetIndex = 0;
while (firedArrows < arrowsToFire && targetIndex < targets.length)
{

View file

@ -3980,7 +3980,7 @@ UnitAI.prototype.PushOrder = function(type, data)
"data": this.order.data
});
// Check if the order appears to have been rejected
if (wasIdle && !this.order)
if (wasIdle && !this.order)
{
this.UnitFsm.ProcessMessage(this, {
"type": "ReenterIdle",