diff --git a/.eslintrc.json b/.eslintrc.json index 6d59a51..5606883 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -51,6 +51,7 @@ "no-unused-vars": "off", "no-use-before-define": ["error", {"functions": false}], "no-useless-rename": "warn", + "no-useless-return": "warn", "no-var": "error", "quotes": ["error", "double"], "require-atomic-updates": "off", diff --git a/.tools/findUnusedMessages.js b/.tools/findUnusedMessages.js index 4d10781..9281b8c 100644 --- a/.tools/findUnusedMessages.js +++ b/.tools/findUnusedMessages.js @@ -29,7 +29,6 @@ async function getMessagesInFile(path){ return getMessagesInContent(content); } else { - // eslint-disable-next-line no-console console.log("file does not exist:", path); return []; } diff --git a/lib/frame.js b/lib/frame.js index ea7e13c..f4b6443 100644 --- a/lib/frame.js +++ b/lib/frame.js @@ -130,7 +130,6 @@ function interceptWindow(window){ let wrappedTry; try { - // eslint-disable-next-line no-unused-vars const href = window.location.href; wrappedTry = extension.getWrapped(window); } diff --git a/lib/modifiedAudioAPI.js b/lib/modifiedAudioAPI.js index d85a3da..21ebea7 100644 --- a/lib/modifiedAudioAPI.js +++ b/lib/modifiedAudioAPI.js @@ -218,7 +218,6 @@ getChannelData: { object: ["AudioBuffer"], fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function getChannelData(channel){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -236,7 +235,6 @@ copyFromChannel: { object: ["AudioBuffer"], fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function copyFromChannel(destination, channelNumber, startInChannel){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -255,7 +253,6 @@ getFrequencyResponse: { object: ["BiquadFilterNode", "IIRFilterNode"], fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; diff --git a/lib/modifiedCanvasAPI.js b/lib/modifiedCanvasAPI.js index 04f43b1..267bba3 100644 --- a/lib/modifiedCanvasAPI.js +++ b/lib/modifiedCanvasAPI.js @@ -302,7 +302,6 @@ }, object: "HTMLCanvasElement", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function(context, contextAttributes){ return checkerWrapper(checker, this, arguments, function(args, check){ const {window, original} = check; @@ -357,7 +356,6 @@ }, object: "HTMLCanvasElement", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function toBlob(callback){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -390,7 +388,6 @@ }, object: "HTMLCanvasElement", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function mozGetAsFile(callback){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -418,7 +415,6 @@ }, object: "CanvasRenderingContext2D", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function getImageData(sx, sy, sw, sh){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -517,7 +513,6 @@ }, object: "CanvasRenderingContext2D", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function fillText(str, x, y){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -554,7 +549,6 @@ }, object: "CanvasRenderingContext2D", fakeGenerator: function(checker){ - // eslint-disable-next-line no-unused-vars return function strokeText(str, x, y){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; @@ -591,7 +585,7 @@ }, object: ["WebGLRenderingContext", "WebGL2RenderingContext"], fakeGenerator: function(checker){ - // eslint-disable-next-line max-params, no-unused-vars + // eslint-disable-next-line max-params return function readPixels(x, y, width, height, format, type, pixels){ return checkerWrapper(checker, this, arguments, function(args, check){ const {prefs, notify, window, original} = check; diff --git a/lib/randomSupplies.js b/lib/randomSupplies.js index e8e5570..51697da 100644 --- a/lib/randomSupplies.js +++ b/lib/randomSupplies.js @@ -200,7 +200,7 @@ return function getConstantPixelRng(length, window, ignoredColors){ const rng = scope.nonPersistent.getValueRng(1024, window); - // eslint-disable-next-line max-params, no-unused-vars + // eslint-disable-next-line max-params return function(r, g, b, a, i){ const index = String.fromCharCode(r, g, b, a); if (ignoredColors[index]){