diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 46aa70ba547e..87eca3e338b9 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -4,7 +4,6 @@ import CONST from '../CONST'; import * as Localize from './Localize'; import * as OnyxTypes from '../types/onyx'; import ONYXKEYS, {OnyxValues} from '../ONYXKEYS'; -import _ from 'underscore'; let allCards: OnyxValues[typeof ONYXKEYS.CARD_LIST] = {}; Onyx.connect({ @@ -66,8 +65,9 @@ function getYearFromExpirationDateString(expirationDateString: string) { */ function getDomainCards(cardList: Record) { // Check for domainName to filter out personal credit cards. - const activeCards = _.filter(cardList, (card) => !!card.domainName && (CONST.EXPENSIFY_CARD.ACTIVE_STATES as ReadonlyArray).includes(card.state)); - return _.groupBy(activeCards, (card) => card.domainName); + // eslint-disable-next-line you-dont-need-lodash-underscore/filter + const activeCards = lodash.filter(cardList, (card) => !!card.domainName && (CONST.EXPENSIFY_CARD.ACTIVE_STATES as ReadonlyArray).includes(card.state)); + return lodash.groupBy(activeCards, (card) => card.domainName); } /** diff --git a/src/pages/settings/Wallet/PaymentMethodList.js b/src/pages/settings/Wallet/PaymentMethodList.js index 24b3e36b6805..b6d6cd564a8b 100644 --- a/src/pages/settings/Wallet/PaymentMethodList.js +++ b/src/pages/settings/Wallet/PaymentMethodList.js @@ -204,10 +204,10 @@ function PaymentMethodList({ const assignedCards = _.chain(cardList) // Filter by physical, active cards associated with a domain .filter((card) => !card.isVirtual && card.domainName && CONST.EXPENSIFY_CARD.ACTIVE_STATES.includes(card.state)) - .sortBy((card) => (!CardUtils.isExpensifyCard(card.cardID))) + .sortBy((card) => !CardUtils.isExpensifyCard(card.cardID)) .value(); - const numberPhysicalExpensifyCards = _.filter(cardList, card => CardUtils.isExpensifyCard(card.cardID)).length; + const numberPhysicalExpensifyCards = _.filter(cardList, (card) => CardUtils.isExpensifyCard(card.cardID)).length; return _.map(assignedCards, (card) => { const isExpensifyCard = CardUtils.isExpensifyCard(card.cardID);