Skip to content

Commit

Permalink
fix unicorn/no-typeof-undefined todo
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 4, 2022
1 parent ffbc3d6 commit 8f35b33
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 29 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ module.exports = {
'unicorn/no-console-spaces': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-hex-escape': 'off',
'unicorn/no-typeof-undefined': 'off', // TODO
'unicorn/no-useless-undefined': 'off', // TODO
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-date-now': 'off',
Expand Down
6 changes: 3 additions & 3 deletions src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down Expand Up @@ -437,8 +437,8 @@

if (useFormDataApi) {
formData = new FormData($form[0]);
settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
settings.processData = settings.processData !== undefined ? settings.processData : false;
settings.contentType = settings.contentType !== undefined ? settings.contentType : false;
} else {
let
formArray = $form.serializeArray(),
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/globals/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
module.verbose('Console not available, normalizing events');
module.disable.console();
}
if (typeof console.group == 'undefined' || typeof console.groupEnd == 'undefined' || typeof console.groupCollapsed == 'undefined') {
if (console.group === undefined || console.groupEnd === undefined || console.groupCollapsed === undefined) {
module.verbose('Console group not available, normalizing events');
window.console.group = function () {};
window.console.groupEnd = function () {};
window.console.groupCollapsed = function () {};
}
if (typeof console.markTimeline == 'undefined') {
if (console.markTimeline === undefined) {
module.verbose('Mark timeline not available, normalizing events');
window.console.markTimeline = function () {};
}
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/dimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/nag.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
}

window = (typeof window != 'undefined' && window.Math == Math)
window = (window !== undefined && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
Expand Down

0 comments on commit 8f35b33

Please sign in to comment.