diff --git a/.eslintrc.js b/.eslintrc.js index 1bdca5790..adca9f333 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -60,6 +60,7 @@ module.exports = { 'no-prototype-builtins': 'error', 'no-useless-catch': 'error', 'no-useless-concat': 'error', + 'prefer-rest-params': 'error', 'prefer-spread': 'error', /* End v2 rules */ 'arrow-parens': 'error', diff --git a/app/scripts/lib/nodeify.js b/app/scripts/lib/nodeify.js index 5d4eb8c4d..074fba3bb 100644 --- a/app/scripts/lib/nodeify.js +++ b/app/scripts/lib/nodeify.js @@ -15,9 +15,7 @@ const callbackNoop = function (err) { * */ export default function nodeify (fn, context) { - return function () { - // parse arguments - const args = [].slice.call(arguments) + return function (...args) { const lastArg = args[args.length - 1] const lastArgIsCallback = typeof lastArg === 'function' let callback