From 76bd7f98b6a3e74a1bcc2014315e6aefa58faeaa Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 12 Aug 2020 20:42:07 -0230 Subject: [PATCH] Fix prefer-spread issues (#9203) See [`prefer-spread`](https://eslint.org/docs/rules/prefer-spread) for more information. This change enables `prefer-spread` and fixes the issues raised by the rule. --- .eslintrc.js | 1 + app/scripts/account-import-strategies/index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1d690ca3d..33a8b38f6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -54,6 +54,7 @@ module.exports = { 'no-plusplus': ['error', { 'allowForLoopAfterthoughts': true }], 'no-useless-catch': 'error', 'no-useless-concat': 'error', + 'prefer-spread': 'error', /* End v2 rules */ 'arrow-parens': 'error', 'no-tabs': 'error', diff --git a/app/scripts/account-import-strategies/index.js b/app/scripts/account-import-strategies/index.js index 7ff8c262f..9a7bc2f8e 100644 --- a/app/scripts/account-import-strategies/index.js +++ b/app/scripts/account-import-strategies/index.js @@ -8,7 +8,7 @@ const accountImporter = { importAccount (strategy, args) { try { const importer = this.strategies[strategy] - const privateKeyHex = importer.apply(null, args) + const privateKeyHex = importer(...args) return Promise.resolve(privateKeyHex) } catch (e) { return Promise.reject(e)