Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iago1501 committed Oct 31, 2024
1 parent 1881f4b commit ea3e9e8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions react/components/SKUSelector/components/SKUSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ interface AvailableVariationParams {
}

export const orderItemsByAvailability = (
item1: SelectorProductItem, item2: SelectorProductItem) => {
item1: SelectorProductItem,

Check failure on line 125 in react/components/SKUSelector/components/SKUSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `·`
item2: SelectorProductItem
) => {

Check failure on line 127 in react/components/SKUSelector/components/SKUSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `⏎`

const isAvailableItem1 = isSkuAvailable(item1)
const isAvailableItem2 = isSkuAvailable(item2)
Expand All @@ -138,8 +140,11 @@ export const orderItemsByAvailability = (
const defaultSellerItem1 = getDefaultSeller(item1.sellers)
const defaultSellerItem2 = getDefaultSeller(item2.sellers)

const availabilityItem1 = defaultSellerItem1 ? defaultSellerItem1.commertialOffer.AvailableQuantity : 0
const availabilityItem2 = defaultSellerItem2 ? defaultSellerItem2.commertialOffer.AvailableQuantity : 0
const availabilityItem1 = defaultSellerItem1

Check failure on line 143 in react/components/SKUSelector/components/SKUSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `·`
? defaultSellerItem1.commertialOffer.AvailableQuantity : 0

const availabilityItem2 = defaultSellerItem2
? defaultSellerItem2.commertialOffer.AvailableQuantity : 0

return availabilityItem2 - availabilityItem1

Expand Down Expand Up @@ -186,9 +191,12 @@ const parseOptionNameToDisplayOption =

if (possibleItems.length > 0) {
// This is a valid combination option

const possibleItemsOrderedByAvailability =
possibleItems.length > 1
? possibleItems.sort(orderItemsByAvailability) : possibleItems
? possibleItems.sort(orderItemsByAvailability)
: possibleItems

const [item] = possibleItemsOrderedByAvailability

const callbackFn = onSelectItemMemo({
Expand Down

0 comments on commit ea3e9e8

Please sign in to comment.