mirror of
https://github.com/cheeriojs/cheerio.git
synced 2026-02-25 23:25:17 +00:00
refactor(lint):: enable eqeqeq rule except for null (#1638)
This commit is contained in:
@@ -12,6 +12,13 @@
|
||||
"allowImplicit": true
|
||||
}
|
||||
],
|
||||
"eqeqeq": [
|
||||
"error",
|
||||
"always",
|
||||
{
|
||||
"null": "ignore"
|
||||
}
|
||||
],
|
||||
"no-lonely-if": 2,
|
||||
"no-proto": 2,
|
||||
"curly": [2, "multi-line"],
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user