Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable no-constant-binary-expression as it becames recommanded default in new ESLint #15241

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

peter-sanderson
Copy link
Contributor

https://eslint.org/docs/latest/rules/no-constant-binary-expression will became default in recommanded config

@@ -99,7 +99,7 @@ export const Pagination = ({
<PageItem
key={i}
data-testid={`@wallet/accounts/pagination/${i}`}
data-test-activated={i === currentPage ?? 'true'}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is always true|false and never result in 'true' (string).

The ?? works like this:
image

@@ -77,8 +77,8 @@ export const PortfolioCard = memo(() => {
}

const isWalletEmpty = !discoveryStatus && isDeviceEmpty;
const isWalletLoading = discoveryStatus?.status === 'loading' ?? false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, even if discoveryStatus?.status is undefined, the === 'loading turns it into false and it never fallback to the ??

@@ -48,7 +48,7 @@ export const CoinmarketBalance = ({
});

if (showOnlyAmount) {
if (!balance ?? isNaN(Number(balance))) return null;
if (balance === undefined || isNaN(Number(balance))) return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @adderpositive

@peter-sanderson peter-sanderson enabled auto-merge (rebase) November 7, 2024 10:58
@peter-sanderson peter-sanderson merged commit 5e33e3a into develop Nov 7, 2024
24 checks passed
@peter-sanderson peter-sanderson deleted the no-constant-binary-expression branch November 7, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants