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 695c5b3 commit 1881f4b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions react/components/SKUSelector/components/SKUSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,17 @@ interface AvailableVariationParams {
sortVariationsByLabel: boolean
}

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

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

View workflow job for this annotation

GitHub Actions / Lint

Replace `·item2:·SelectorProductItem)·=>·{⏎` with `⏎··item2:·SelectorProductItem⏎)·=>·{`

const isAvailableItem1 = isSkuAvailable(item1)
const isAvailableItem2 = isSkuAvailable(item2)
const isAvailableItem2 = isSkuAvailable(item2)

if(isAvailableItem1 && !isAvailableItem2){
if (isAvailableItem1 && !isAvailableItem2) {
return -1
}

if(!isAvailableItem1 && isAvailableItem2){
if (!isAvailableItem1 && isAvailableItem2) {
return 1
}

Expand Down Expand Up @@ -181,11 +182,13 @@ const parseOptionNameToDisplayOption =
const possibleItems = findListItemsWithSelectedVariations(
skuItems,
newSelectedVariation
)
)

if (possibleItems.length > 0) {
// This is a valid combination option
const possibleItemsOrderedByAvailability = (possibleItems.length > 1) ? possibleItems.sort(orderItemsByAvailability) : possibleItems
const possibleItemsOrderedByAvailability =
possibleItems.length > 1
? possibleItems.sort(orderItemsByAvailability) : possibleItems
const [item] = possibleItemsOrderedByAvailability

Check warning on line 192 in react/components/SKUSelector/components/SKUSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint

Expected blank line before this statement

const callbackFn = onSelectItemMemo({
Expand Down

0 comments on commit 1881f4b

Please sign in to comment.