From b6df27fa6d82387a121e74964cbdddb5341d1b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 May 2019 19:39:44 -0300 Subject: [PATCH] Turn no-unsafe-negation ESLint rule to error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- .eslintrc.json | 1 + js/functions.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index efe793be93..e640ab56e8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,6 +26,7 @@ "no-trailing-spaces": "error", "no-underscore-dangle": "warn", "no-unneeded-ternary": "error", + "no-unsafe-negation": "error", "no-useless-escape": "error", "object-curly-spacing": ["error", "always"], "one-var": ["error", "never"], diff --git a/js/functions.js b/js/functions.js index a0f339a7f3..491c5968fe 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3980,7 +3980,7 @@ Functions.showIndexEditDialog = function ($outer) { * in the whole body **/ Functions.showHints = function ($div) { - if ($div === undefined || ! $div instanceof jQuery || $div.length === 0) { + if ($div === undefined || !($div instanceof jQuery) || $div.length === 0) { $div = $('body'); } $div.find('.pma_hint').each(function () { @@ -4332,7 +4332,7 @@ Functions.slidingMessage = function (msg, $obj) { // Don't show an empty message return false; } - if ($obj === undefined || ! $obj instanceof jQuery || $obj.length === 0) { + if ($obj === undefined || !($obj instanceof jQuery) || $obj.length === 0) { // If the second argument was not supplied, // we might have to create a new DOM node. if ($('#PMA_slidingMessage').length === 0) {