Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: enable eqeqeq rule expect for null #1638

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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