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.
feature/default_network_editable
Whymarrh Whitby 4 years ago committed by GitHub
parent 76bd7f98b6
commit c0f05ccae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .eslintrc.js
  2. 4
      app/scripts/controllers/transactions/pending-tx-tracker.js
  3. 6
      ui/app/store/actions.js

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

@ -239,11 +239,11 @@ export default class PendingTransactionTracker extends EventEmitter {
async _checkIfNonceIsTaken (txMeta) { async _checkIfNonceIsTaken (txMeta) {
const address = txMeta.txParams.from const address = txMeta.txParams.from
const completed = this.getCompletedTransactions(address) 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 // 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 // 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 // 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,
) )
} }
} }

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

Loading…
Cancel
Save