Conditional Code Adjustments Re:Biome

When multiple falsey conditions are being checked Biome recommends to check for all the truthy conditions negated. Logic remains untouched, while only using one negation. Apparently easier to comprehend.
This commit is contained in:
Refringe 2023-11-13 12:00:49 -05:00
parent 11b5c76512
commit 2b826f8b1e
No known key found for this signature in database
GPG Key ID: 64E03E5F892C6F9E
4 changed files with 6 additions and 8 deletions

View File

@ -199,11 +199,9 @@ export class BotEquipmentModGenerator
const compatibleModsPool = modPool[parentTemplate._id];
// Null guard against bad input weapon
// biome-ignore lint/complexity/useSimplifiedLogicExpression: <explanation>
if (
!parentTemplate._props.Slots.length &&
!parentTemplate._props.Cartridges?.length &&
!parentTemplate._props.Chambers?.length
!((parentTemplate._props.Slots.length || parentTemplate._props.Cartridges?.length) ||
parentTemplate._props.Chambers?.length)
)
{
this.logger.error(

View File

@ -133,8 +133,8 @@ export class LocationGenerator
// randomisation is turned off globally or just turned off for this map
if (
!this.locationConfig.containerRandomisationSettings.enabled ||
!this.locationConfig.containerRandomisationSettings.maps[locationId]
!(this.locationConfig.containerRandomisationSettings.enabled &&
this.locationConfig.containerRandomisationSettings.maps[locationId])
)
{
this.logger.debug(

View File

@ -410,7 +410,7 @@ export class LootGenerator
x._parent === rewardTypeId &&
x._type.toLowerCase() === "item" &&
!this.itemFilterService.isItemBlacklisted(x._id) &&
(!containerSettings.allowBossItems && !this.itemFilterService.isBossItem(x._id)) &&
(!(containerSettings.allowBossItems || this.itemFilterService.isBossItem(x._id))) &&
!x._props.QuestItem
);

View File

@ -424,7 +424,7 @@ export class ProfileFixerService
const existsInQuests = pmcProfile.Quests.some((q) => q.qid === backendCounter.qid);
// if BackendCounter's quest is neither in activeQuests nor Quests it's stale
if (!existsInActiveRepeatableQuests && !existsInQuests)
if (!(existsInActiveRepeatableQuests || existsInQuests))
{
counterKeysToRemove.push(key);
}