Lint fixes

This commit is contained in:
Refringe 2024-03-30 14:25:46 -04:00
parent c05347279b
commit 740ab1e563
No known key found for this signature in database
GPG Key ID: 7715B85B4A6306ED
9 changed files with 13 additions and 13 deletions

View File

@ -340,8 +340,8 @@ export class InventoryController
): IItemEventRouterResponse
{
const inventoryItems = this.inventoryHelper.getOwnerInventoryItems(body, sessionID);
const sourceItem = inventoryItems.from.find((item) => item._id == body.item);
const destinationItem = inventoryItems.to.find((item) => item._id == body.with);
const sourceItem = inventoryItems.from.find((item) => item._id === body.item);
const destinationItem = inventoryItems.to.find((item) => item._id === body.with);
if (sourceItem === null)
{

View File

@ -9,11 +9,11 @@ import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IWildBody } from "@spt-aki/models/eft/common/IGlobals";
import {
Common,
Health as PmcHealth,
IBaseJsonSkills,
IBaseSkill,
IBotBase,
Info,
Health as PmcHealth,
Skills as botSkills,
} from "@spt-aki/models/eft/common/tables/IBotBase";
import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";

View File

@ -789,7 +789,7 @@ export class RagfairOfferGenerator
for (const armorItem of armorWithMods)
{
const itemDbDetails = this.itemHelper.getItem(armorItem._tpl)[1];
if ((parseInt(<string>itemDbDetails._props.armorClass)) > 1)
if ((Number.parseInt(<string>itemDbDetails._props.armorClass)) > 1)
{
this.itemHelper.addUpdObjectToItem(armorItem);

View File

@ -175,7 +175,7 @@ export class WeatherGenerator
protected getRandomFloat(node: string): number
{
return parseFloat(
return Number.parseFloat(
this.randomUtil.getFloat(this.weatherConfig.weather[node].min, this.weatherConfig.weather[node].max)
.toPrecision(3),
);

View File

@ -158,7 +158,7 @@ export class AssortHelper
{
if (assort.items[a]._id === idsToRemove[i])
{
assort.items.splice(parseInt(a), 1);
assort.items.splice(Number.parseInt(a), 1);
}
}
}

View File

@ -263,7 +263,7 @@ export class BotGeneratorHelper
{
let maxDurability: number;
let currentDurability: number;
if (parseInt(`${itemTemplate._props.armorClass}`) === 0)
if (Number.parseInt(`${itemTemplate._props.armorClass}`) === 0)
{
maxDurability = itemTemplate._props.MaxDurability;
currentDurability = itemTemplate._props.MaxDurability;

View File

@ -560,7 +560,7 @@ export class ProfileFixerService
continue;
}
if (quest.status && Number.isNaN(parseInt(<string><unknown>quest.status)))
if (quest.status && Number.isNaN(Number.parseInt(<string><unknown>quest.status)))
{
fixes[quest.status] = (fixes[quest.status] ?? 0) + 1;
@ -570,7 +570,7 @@ export class ProfileFixerService
for (const statusTimer in quest.statusTimers)
{
if (Number.isNaN(parseInt(statusTimer)))
if (Number.isNaN(Number.parseInt(statusTimer)))
{
timerFixes[statusTimer] = (timerFixes[statusTimer] ?? 0) + 1;

View File

@ -349,7 +349,7 @@ export class RepairService
const materialType = itemToRepairDetails._props.ArmorMaterial ?? "";
const armorMaterial = globals.config.ArmorMaterials[materialType] as IArmorType;
const destructability = 1 + armorMaterial.Destructibility;
const armorClass = parseInt(`${itemToRepairDetails._props.armorClass}`);
const armorClass = Number.parseInt(`${itemToRepairDetails._props.armorClass}`);
const armorClassDivisor = globals.config.RepairSettings.armorClassDivisor;
const armorClassMultiplier = 1.0 + armorClass / armorClassDivisor;

View File

@ -1,10 +1,10 @@
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { inject, injectable } from "tsyringe";
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
@injectable()
export class TraderServicesService
@ -47,7 +47,7 @@ export class TraderServicesService
for (const questId of service.requirements.completedQuests)
{
const quest = pmcData.Quests.find((x) => x.qid === questId);
if (!quest || quest.status != QuestStatus.Success)
if (!quest || quest.status !== QuestStatus.Success)
{
servicesToDelete.push(service.serviceType);
break;