Fix prefer-rest-params issues (#9215)

See [`prefer-rest-params`](https://eslint.org/docs/rules/prefer-rest-params) for more information.

This change enables `prefer-rest-params` and fixes the issues raised by the rule.
feature/default_network_editable
Whymarrh Whitby 4 years ago committed by GitHub
parent 146127c474
commit 82a0ee27f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .eslintrc.js
  2. 4
      app/scripts/lib/nodeify.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',

@ -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

Loading…
Cancel
Save