diff --git a/.eslintrc.json b/.eslintrc.json index 6d5e7bdf8f..7421a4eadb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,13 @@ "allowImplicit": true } ], + "eqeqeq": [ + "error", + "always", + { + "null": "ignore" + } + ], "no-lonely-if": 2, "no-proto": 2, "curly": [2, "multi-line"], diff --git a/lib/api/attributes.js b/lib/api/attributes.js index d3f3f8f5fa..367e11d06c 100644 --- a/lib/api/attributes.js +++ b/lib/api/attributes.js @@ -383,10 +383,10 @@ exports.val = function (value) { var option = this.find('option:selected'); if (!option) return; if (!querying) { - if (this.attr('multiple') == null && typeof value == 'object') { + if (this.attr('multiple') == null && typeof value === 'object') { return this; } - if (typeof value != 'object') { + if (typeof value !== 'object') { value = [value]; } this.find('option').removeAttr('selected'); diff --git a/lib/api/css.js b/lib/api/css.js index d66409f094..3786b028ee 100644 --- a/lib/api/css.js +++ b/lib/api/css.js @@ -38,7 +38,7 @@ exports.css = function (prop, val) { * @param {number} [idx] - Optional index within the selection. */ function setCss(el, prop, val, idx) { - if (typeof prop == 'string') { + if (typeof prop === 'string') { var styles = getCss(el); if (typeof val === 'function') { val = val.call(el, idx, styles[prop]); @@ -51,7 +51,7 @@ function setCss(el, prop, val, idx) { } el.attribs.style = stringify(styles); - } else if (typeof prop == 'object') { + } else if (typeof prop === 'object') { Object.keys(prop).forEach(function (k) { setCss(el, k, prop[k]); });