mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix no-eq-null issues (#9205)
See [`no-eq-null`](https://eslint.org/docs/rules/no-eq-null) for more information. This change enables `no-eq-null` and fixes the issues raised by the rule.
This commit is contained in:
parent
f8ebfc2f63
commit
548b0bbbd5
@ -49,6 +49,7 @@ module.exports = {
|
||||
'guard-for-in': 'error',
|
||||
'no-case-declarations': 'error',
|
||||
'no-empty': 'error',
|
||||
'no-eq-null': 'error',
|
||||
'no-loop-func': 'error',
|
||||
'no-useless-catch': 'error',
|
||||
'no-useless-concat': 'error',
|
||||
|
@ -60,7 +60,7 @@ const AssetListItem = ({
|
||||
: null
|
||||
|
||||
const sendTokenButton = useMemo(() => {
|
||||
if (tokenAddress == null) {
|
||||
if (tokenAddress === null || tokenAddress === undefined) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
|
@ -99,7 +99,7 @@ const converter = ({
|
||||
}
|
||||
|
||||
if (fromCurrency !== toCurrency) {
|
||||
if (conversionRate == null) {
|
||||
if (conversionRate === null || conversionRate === undefined) {
|
||||
throw new Error(`Converting from ${fromCurrency} to ${toCurrency} requires a conversionRate, but one was not provided`)
|
||||
}
|
||||
let rate = toBigNumber.dec(conversionRate)
|
||||
|
@ -56,7 +56,10 @@ export const getMessage = (localeCode, localeMessages, key, substitutions) => {
|
||||
return part
|
||||
}
|
||||
const substituteIndex = Number(subMatch[1]) - 1
|
||||
if (substitutions[substituteIndex] == null && !missingSubstitutionErrors[localeCode]?.[key]) {
|
||||
if (
|
||||
(substitutions[substituteIndex] === null || substitutions[substituteIndex] === undefined) &&
|
||||
!missingSubstitutionErrors[localeCode]?.[key]
|
||||
) {
|
||||
if (!missingSubstitutionErrors[localeCode]) {
|
||||
missingSubstitutionErrors[localeCode] = {}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ export function useTransactionDisplayData (transactionGroup) {
|
||||
// 3. Deposit
|
||||
// 4. Site interaction
|
||||
// 5. Approval
|
||||
if (transactionCategory == null) {
|
||||
if (transactionCategory === null || transactionCategory === undefined) {
|
||||
category = TRANSACTION_CATEGORY_SIGNATURE_REQUEST
|
||||
title = t('signatureRequest')
|
||||
subtitle = origin
|
||||
|
Loading…
Reference in New Issue
Block a user