From a8b39e6c0fa25d0708112ff7a740a625d709cfd1 Mon Sep 17 00:00:00 2001 From: lonerz Date: Mon, 5 Dec 2016 02:39:24 +0000 Subject: [PATCH] Switch yoda eslint rule from warning to error (in .eslintrc) --- .eslintrc.json | 2 +- static/js/hotkey.js | 2 +- static/js/stream_list.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index d85854ce1d..f635ae9c4d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -209,6 +209,6 @@ "valid-typeof": ["error", { "requireStringLiterals": true }], "wrap-iife": 2, "wrap-regex": 0, - "yoda": 1 + "yoda": 2 } } diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 69bacc966a..e312dbbd8b 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -377,7 +377,7 @@ function process_hotkey(e) { $(document).keydown(function (e) { // Restrict to non-alphanumeric keys // check if 27 (esc) because it doesn't register under .keypress() - if (48 > e.which || 90 < e.which || e.which === 27) { + if (e.which < 48 || e.which > 90 || e.which === 27) { if (process_hotkey(e)) { e.preventDefault(); } diff --git a/static/js/stream_list.js b/static/js/stream_list.js index a77dca0f2a..03a41581b6 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -526,7 +526,7 @@ function toggle_filter_displayed(e) { if (e.target.id === 'streams_inline_cog') { return; } - if (0 === $('.stream-list-filter.notdisplayed').length) { + if ($('.stream-list-filter.notdisplayed').length === 0) { exports.clear_and_hide_search(); } else { exports.initiate_search();