Skip to content

Commit

Permalink
supress typescript error as the variable is an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
twilight2294 authored Nov 24, 2024
1 parent eda2c6b commit 33fa796
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function XeroBankAccountSelectPage({policy}: WithPolicyConnectionsProps) {

const {config} = policy?.connections?.xero ?? {};
const {bankAccounts} = policy?.connections?.xero?.data ?? {};

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing nonReimbursableAccount is an empty string so we cannot use `??`

Check failure on line 32 in src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Definition for rule '@typescript-eslint/prefer-nullish-coalescing nonReimbursableAccount is an empty string so we cannot use `??`' was not found
const xeroSelectorOptions = useMemo<SelectorType[]>(
() => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount || bankAccounts?.[0]?.id),

Check failure on line 34 in src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator
[config?.export?.nonReimbursableAccount, policy, bankAccounts],
Expand Down

0 comments on commit 33fa796

Please sign in to comment.