Skip to content

Commit

Permalink
refactor(lint):: enable eqeqeq rule except for null (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jan 4, 2021
1 parent 4859684 commit 52f37a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.json
Expand Up @@ -12,6 +12,13 @@
"allowImplicit": true
}
],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-lonely-if": 2,
"no-proto": 2,
"curly": [2, "multi-line"],
Expand Down
4 changes: 2 additions & 2 deletions lib/api/attributes.js
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions lib/api/css.js
Expand Up @@ -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]);
Expand All @@ -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]);
});
Expand Down

0 comments on commit 52f37a1

Please sign in to comment.