1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Fix no-loop-func issues (#9199)

See [`no-loop-func`](https://eslint.org/docs/rules/no-loop-func) for more information.

This change enables `no-loop-func` and fixes the issues raised by the rule.
This commit is contained in:
Whymarrh Whitby 2020-08-12 17:29:14 -02:30 committed by GitHub
parent ef88d79fac
commit 3346c2fc07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ module.exports = {
'global-require': 'error', 'global-require': 'error',
'guard-for-in': 'error', 'guard-for-in': 'error',
'no-case-declarations': 'error', 'no-case-declarations': 'error',
'no-loop-func': 'error',
'no-useless-catch': 'error', 'no-useless-catch': 'error',
'no-useless-concat': 'error', 'no-useless-concat': 'error',
/* End v2 rules */ /* End v2 rules */

View File

@ -38,6 +38,8 @@ let nonDeletableCount = 0
let status let status
while (transactions.length <= 100) { while (transactions.length <= 100) {
status = txStates[Math.floor(Math.random() * Math.floor(txStates.length - 1))] status = txStates[Math.floor(Math.random() * Math.floor(txStates.length - 1))]
// This is an old migration, let's allow it
// eslint-disable-next-line no-loop-func
if (!deletableTxStates.find((s) => s === status)) { if (!deletableTxStates.find((s) => s === status)) {
nonDeletableCount++ nonDeletableCount++
} }