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) {