From 73261646fc49a81e418791bb38a6401e43a5a1e2 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Sun, 30 Oct 2016 17:23:39 -0400 Subject: [PATCH] Fix ESLint warnings --- .eslintrc.json | 2 ++ package.json | 4 ++-- src/client/voice/dispatcher/StreamDispatcher.js | 2 +- src/structures/GuildChannel.js | 2 +- src/structures/GuildMember.js | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 90f35dc06..2e3021ca0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -80,6 +80,7 @@ "consistent-this": ["error", "$this"], "eol-last": "error", "func-names": "error", + "func-name-matching": "error", "func-style": ["error", "declaration", { "allowArrowFunctions": true }], "indent": ["error", 2, { "SwitchCase": 1 }], "key-spacing": "error", @@ -122,6 +123,7 @@ "no-useless-computed-key": "error", "no-useless-constructor": "error", "prefer-arrow-callback": "error", + "prefer-numeric-literals": "error", "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", diff --git a/package.json b/package.json index 6e92756f8..978a47b96 100644 --- a/package.json +++ b/package.json @@ -31,11 +31,11 @@ "ws": "^1.1.1" }, "peerDependencies": { - "node-opus": "^0.2.1", + "node-opus": "^0.2.2", "opusscript": "^0.0.1" }, "devDependencies": { - "eslint": "^3.8.0", + "eslint": "^3.9.0", "fs-extra": "^0.30.0", "jsdoc-to-markdown": "^2.0.0" }, diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index 0a4dbe493..f69fa0436 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -223,7 +223,7 @@ class StreamDispatcher extends EventEmitter { buffer = this._applyVolume(buffer); data.count++; - data.sequence = (data.sequence + 1) < (65536) ? data.sequence + 1 : 0; + data.sequence = (data.sequence + 1) < 65536 ? data.sequence + 1 : 0; data.timestamp = data.timestamp + 4294967295 ? data.timestamp + 960 : 0; this._sendBuffer(buffer, data.sequence, data.timestamp); diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 7d220cf6c..59b9879f4 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -70,7 +70,7 @@ class GuildChannel extends Channel { permissions |= overwrite.allowData; } - const admin = Boolean(permissions & (Constants.PermissionFlags.ADMINISTRATOR)); + const admin = Boolean(permissions & Constants.PermissionFlags.ADMINISTRATOR); if (admin) permissions = Constants.ALL_PERMISSIONS; return new EvaluatedPermissions(member, permissions); diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 408efedc8..e972df1c8 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -187,7 +187,7 @@ class GuildMember { const roles = this.roles; for (const role of roles.values()) permissions |= role.permissions; - const admin = Boolean(permissions & (Constants.PermissionFlags.ADMINISTRATOR)); + const admin = Boolean(permissions & Constants.PermissionFlags.ADMINISTRATOR); if (admin) permissions = Constants.ALL_PERMISSIONS; return new EvaluatedPermissions(this, permissions);