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

fix(chore): typos found by eslint #2591

Merged
merged 12 commits into from
Dec 10, 2022
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ module.exports = {
semi: ['error'],
'no-extra-semi': ['error'],
'no-trailing-spaces': ['error'],
'array-callback-return': ['error', { allowImplicit: true }],
},
reportUnusedDisableDirectives: true,
};
5 changes: 0 additions & 5 deletions src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@
},
write: {
cachedResponse: function (url, response) {
if (response && response === '') {
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
module.debug('Response empty, not caching', response);

return;
}
if (window.Storage === undefined) {
module.error(error.noStorage);

Expand Down
4 changes: 2 additions & 2 deletions src/definitions/behaviors/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@
;
while (imagesLength--) {
cacheImage = document.createElement('img');
cacheImage.onload = handleLoad;
cacheImage.onerror = handleLoad;
cacheImage.addEventListener('load', handleLoad);
cacheImage.addEventListener('error', handleLoad);
mvorisek marked this conversation as resolved.
Show resolved Hide resolved
cacheImage.src = images[imagesLength];
cache.push(cacheImage);
}
Expand Down
6 changes: 3 additions & 3 deletions src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
var endDate = module.get.endDate();
if (!!endDate && !!date && date > endDate) {
// selected date is greater than end date in range, so clear end date
module.set.endDate(undefined);
module.set.endDate();
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
}
module.set.dataKeyValue(metadata.date, date);

Expand Down Expand Up @@ -1022,7 +1022,7 @@
},

clear: function () {
module.set.date(undefined);
module.set.date();
},

popup: function () {
Expand Down Expand Up @@ -1721,7 +1721,7 @@
}
for (j = 0; j < settings.text.months.length; j++) {
monthString = settings.text.months[j];
monthString = monthString.substring(0, word.length).toLowerCase();
monthString = monthString.slice(0, word.length).toLowerCase();
if (monthString === word) {
month = j + 1;

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 @@ -2391,7 +2391,7 @@
$nextSelectedItem
.addClass(className.selected)
;
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
if (settings.selectOnKeydown && module.is.single() && !$nextSelectedItem.hasClass(className.actionable)) {
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
module.set.selectedItem($nextSelectedItem);
}
$menu
Expand Down
6 changes: 3 additions & 3 deletions src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1497,12 +1497,12 @@
html = '',
escape = $.fn.popup.settings.templates.escape
;
if (typeof text !== undefined) {
if (typeof text.title !== undefined && text.title) {
if (text !== undefined) {
if (text.title) {
text.title = escape(text.title);
html += '<div class="header">' + text.title + '</div>';
}
if (typeof text.content !== undefined && text.content) {
if (text.content) {
text.content = escape(text.content);
html += '<div class="content">' + text.content + '</div>';
}
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 @@ -606,7 +606,7 @@
}
},
barLabel: function (text) {
$progresses.map(function (index, element) {
$progresses.each(function (index, element) {
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
var $progress = $(element);
if (text !== undefined) {
$progress.text(module.get.text(text, index));
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 @@ -1356,7 +1356,7 @@

regExp: {
escape: /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
beginsWith: '(?:\s|^)',
beginsWith: '(?:\\s|^)',
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
},

// maps api response attributes to internal representation
Expand Down
4 changes: 2 additions & 2 deletions tasks/docs/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function parser(file, callback) {
/** @type {string} */
text = String(file.contents.toString('utf8')),
lines = text.split('\n'),
filename = file.path.substring(0, file.path.length - 4),
filename = file.path.slice(0, -4),
lubber-de marked this conversation as resolved.
Show resolved Hide resolved
key = 'server/documents',
position = filename.indexOf(key)
;
Expand All @@ -66,7 +66,7 @@ function parser(file, callback) {
return callback(null, file);
}

filename = filename.substring(position + key.length + 1, filename.length);
filename = filename.slice(position + key.length + 1, filename.length);

var
lineCount = lines.length,
Expand Down