refactor(lint):: enable eqeqeq rule except for null (#1638)

This commit is contained in:
XhmikosR
2021-01-04 05:23:40 +02:00
committed by GitHub
parent 4859684c97
commit 52f37a1ab7
3 changed files with 11 additions and 4 deletions

View File

@@ -12,6 +12,13 @@
"allowImplicit": true
}
],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-lonely-if": 2,
"no-proto": 2,
"curly": [2, "multi-line"],

View File

@@ -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');

View File

@@ -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]);
});