diff --git a/.eslintrc.json b/.eslintrc.json index 5548d3d577..a1c24b5158 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -178,7 +178,9 @@ "no-underscore-dangle": 1, "no-loop-func": 2, "no-labels": 2, - "no-unused-vars": 1, + "no-unused-vars": ["error", { "vars": "local", "args": "after-used", + "varsIgnorePattern": "print_elapsed_time" + }], "no-script-url": 2, "no-proto": 2, "no-iterator": 2, diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js index d2c78320bb..926eff6069 100644 --- a/static/js/click_handlers.js +++ b/static/js/click_handlers.js @@ -128,13 +128,13 @@ $(function () { e.stopPropagation(); popovers.hide_all(); }); - $("body").on("click", "a", function (e) { + $("body").on("click", "a", function () { if (document.activeElement === this) { ui.blur_active_element(); } }); - $(window).on("focus", function (e) { + $(window).on("focus", function () { meta.focusing = true; }); diff --git a/static/js/compose.js b/static/js/compose.js index de924f5bca..f07f42e996 100644 --- a/static/js/compose.js +++ b/static/js/compose.js @@ -1065,7 +1065,7 @@ $(function () { Dropbox.choose(options); }); - function uploadStarted(i, file, len) { + function uploadStarted() { $("#compose-send-button").attr("disabled", ""); $("#send-status").addClass("alert-info") .show(); @@ -1107,7 +1107,7 @@ $(function () { $("#error-msg").text(msg); } - function uploadFinished(i, file, response, time) { + function uploadFinished(i, file, response) { if (response.uri === undefined) { return; } diff --git a/static/js/muting_ui.js b/static/js/muting_ui.js index 7e02aff6f6..d040c8296e 100644 --- a/static/js/muting_ui.js +++ b/static/js/muting_ui.js @@ -36,7 +36,7 @@ exports.notify_with_undo_option = (function () { } } }; - var interval = setInterval(function () { + setInterval(function () { if (meta.hide_me_time < new Date().getTime() && !meta.alert_hover_state) { animate.fadeOut(); } diff --git a/static/js/narrow.js b/static/js/narrow.js index 525a4ad6ff..1d2a756d46 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -319,7 +319,7 @@ exports.activate = function (raw_operators, opts) { num_after: 50, msg_list: message_list.narrowed, use_first_unread_anchor: opts.first_unread_from_server, - cont: function (messages) { + cont: function () { ui.hide_loading_more_messages_indicator(); if (defer_selecting_closest) { maybe_select_closest(); diff --git a/static/js/settings.js b/static/js/settings.js index f6cbed4a8b..133df53acb 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -730,7 +730,7 @@ function _setup_page() { }); - $("#bots_list").on("click", "a.download_bot_zuliprc", function (e) { + $("#bots_list").on("click", "a.download_bot_zuliprc", function () { var bot_info = $(this).parent().parent(); var email = bot_info.find(".email .value").text(); var api_key = bot_info.find(".api_key .api-key-value-and-button .value").text(); @@ -740,7 +740,7 @@ function _setup_page() { )); }); - $("#download_zuliprc").on("click", function (e) { + $("#download_zuliprc").on("click", function () { $(this).attr("href", settings.generate_zuliprc_uri( page_params.email, $("#api_key_value").text() diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 13148ea971..90df0e6463 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -428,7 +428,7 @@ $(function () { } }); - $(document).on('narrow_deactivated.zulip', function (event) { + $(document).on('narrow_deactivated.zulip', function () { reset_to_unnarrowed(); $("#global_filters li[data-name='home']").addClass('active-filter'); }); diff --git a/static/js/subs.js b/static/js/subs.js index a4f504982e..a60e7a3781 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -545,7 +545,7 @@ exports.setup_page = function (callback) { { label: "Subscribed" }, { label: "All Streams" }, ], - callback: function (name) { + callback: function () { actually_filter_streams(); remove_temporarily_miscategorized_streams(); }