1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix implicit-arrow-linebreak issues (#9201)

See [`implicit-arrow-linebreak`](https://eslint.org/docs/rules/implicit-arrow-linebreak) for more information.

This change enables `implicit-arrow-linebreak` and fixes the issues raised by the rule.
This commit is contained in:
Whymarrh Whitby 2020-08-12 21:19:10 -02:30 committed by GitHub
parent 76bd7f98b6
commit c0f05ccae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 15 deletions

View File

@ -47,6 +47,7 @@ module.exports = {
'consistent-return': 'error',
'global-require': 'error',
'guard-for-in': 'error',
'implicit-arrow-linebreak': 'error',
'no-case-declarations': 'error',
'no-empty': 'error',
'no-eq-null': 'error',

View File

@ -239,11 +239,11 @@ export default class PendingTransactionTracker extends EventEmitter {
async _checkIfNonceIsTaken (txMeta) {
const address = txMeta.txParams.from
const completed = this.getCompletedTransactions(address)
return completed.some((other) =>
return completed.some(
// This is called while the transaction is in-flight, so it is possible that the
// list of completed transactions now includes the transaction we were looking at
// and if that is the case, don't consider the transaction to have taken its own nonce
!(other.id === txMeta.id) && other.txParams.nonce === txMeta.txParams.nonce,
(other) => !(other.id === txMeta.id) && other.txParams.nonce === txMeta.txParams.nonce,
)
}
}

View File

@ -1756,8 +1756,7 @@ export function exportAccounts (password, addresses) {
return
}
log.debug(`background.exportAccounts`)
const accountPromises = addresses.map((address) =>
new Promise(
const accountPromises = addresses.map((address) => new Promise(
(resolve, reject) => background.exportAccount(address, function (err, result) {
if (err) {
log.error(err)
@ -1768,8 +1767,7 @@ export function exportAccounts (password, addresses) {
resolve(result)
return
}),
),
)
))
resolve(Promise.all(accountPromises))
return
})