Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Oct 18, 2023
1 parent f74d6d5 commit 62b73b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/libs/CardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -66,8 +65,9 @@ function getYearFromExpirationDateString(expirationDateString: string) {
*/
function getDomainCards(cardList: Record<string, OnyxTypes.Card>) {
// Check for domainName to filter out personal credit cards.
const activeCards = _.filter(cardList, (card) => !!card.domainName && (CONST.EXPENSIFY_CARD.ACTIVE_STATES as ReadonlyArray<OnyxTypes.Card['state']>).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<OnyxTypes.Card['state']>).includes(card.state));
return lodash.groupBy(activeCards, (card) => card.domainName);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Wallet/PaymentMethodList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 62b73b1

Please sign in to comment.