diff --git a/.eslintrc.js b/.eslintrc.js index ea3a7524ff..d9570d1c6a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,8 +29,9 @@ const commonNoRestrictedSyntax = [ 'message': 'Use for-of instead of forEach', }, { - 'selector': 'CallExpression[callee.property.name=/^(bind|call|apply)$/]', - 'message': 'Don\'t use Function bind/call/apply.', + // NOTE: prefer-spread rule covers .apply() already. + 'selector': 'CallExpression[callee.property.name=/^(bind|call)$/]', + 'message': 'Don\'t use Function bind/call.', }, { 'selector': 'MemberExpression[property.name="prototype"]', @@ -79,7 +80,6 @@ module.exports = { // Temporary Google style overrides while we get in compliance with the // latest style guide {{{ - 'prefer-spread': 'off', 'require-jsdoc': 'off', // }}} diff --git a/lib/cast/cast_receiver.js b/lib/cast/cast_receiver.js index a87e19464f..da1d874ef6 100644 --- a/lib/cast/cast_receiver.js +++ b/lib/cast/cast_receiver.js @@ -656,7 +656,7 @@ shaka.cast.CastReceiver = class extends shaka.util.FakeEventTarget { const methodName = message['methodName']; const args = message['args']; const target = this.targets_[targetName]; - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line prefer-spread target[methodName].apply(target, args); break; } @@ -672,7 +672,7 @@ shaka.cast.CastReceiver = class extends shaka.util.FakeEventTarget { const id = message['id']; const senderId = event.senderId; const target = this.targets_[targetName]; - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line prefer-spread let p = target[methodName].apply(target, args); if (targetName == 'player' && methodName == 'load') { // Wait until the manifest has actually loaded to send another media diff --git a/test/player_integration.js b/test/player_integration.js index e32193a383..0063abc8f6 100644 --- a/test/player_integration.js +++ b/test/player_integration.js @@ -624,7 +624,7 @@ describe('Player', () => { if (arguments.length > 2000) { throw new RangeError('Synthetic Range Error'); } - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line prefer-spread return oldFromCharCode.apply(null, arguments); }; await player.load('/base/test/test/assets/large_file.mpd');