Skip to content

Commit

Permalink
maint: Fix eslint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Feb 13, 2025
1 parent 2114ffb commit 26fc612
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/core/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const i18n = function () {
) {
self.storage = window.localStorage;
}
} catch (e) {
} catch {
console.log("Failed to set local storage");
}

Expand Down
2 changes: 1 addition & 1 deletion src/pat/contentloader/contentloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default Base.extend({
}
try {
$el = $(_.template(that.options.template)(data));
} catch (e) {
} catch {
that.$el.removeClass("loading-content");
that.$el.addClass("content-load-error");
log.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default class Contentrules {
/**********************************************************************
* Delete a single comment.
**********************************************************************/
// eslint-disable-next-line no-unused-vars
$("button[name='form.button.moderation.DeleteComment']").on("click", function (e) {
e.preventDefault();
var row = $(this).closest("tr");
Expand Down
2 changes: 1 addition & 1 deletion src/pat/markspeciallinks/markspeciallinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default Base.extend({
let link_url;
try {
link_url = new URL(link.getAttribute("href"));
} catch (e) {
} catch {
// Not a valid URL.
// Ignore and continue.
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/pat/querystring/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ export default Base.extend({
self.options.indexes = data.indexes;
self.options["sortable_indexes"] = data["sortable_indexes"];
self._init();
} catch (e) {
} catch {
// XXX handle this...
}
}
Expand Down
1 change: 0 additions & 1 deletion src/pat/recurrence/recurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function format(date, fmt, conf) {
return result;
}

// eslint-disable-next-line no-unused-vars
function widgetSaveToRfc5545(form, RDATE, EXDATE, conf, tz) {
var value = form.find("select[name=rirtemplate]").val();
var rtemplate = conf.rtemplate[value];
Expand Down
2 changes: 1 addition & 1 deletion src/pat/relateditems/relateditems.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export default Base.extend({
.map((uid) => results[uid])
.filter((item) => item !== undefined)
);
} catch (e) {
} catch {
// Select2 3.5.4 throws an error in some cases in
// updateSelection, ``this.selection.find(".select2-search-choice").remove();``
// No idea why, hard to track.
Expand Down
2 changes: 1 addition & 1 deletion src/pat/relateditems/relateditems.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe("Related Items", function () {
if (pair[0] === variable) {
try {
return JSON.parse(pair[1]);
} catch (e) {
} catch {
return pair[1];
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/pat/structure/js/views/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export default BaseView.extend({
toBeRemoved.forEach(function (statusItem) {
try {
statusContainer.removeChild(statusItem.el);
} catch (e) {
} catch {
// just ignore.
}
});
Expand All @@ -548,7 +548,7 @@ export default BaseView.extend({
try {
statusContainer.removeChild(statusItem.el);
toBeRemoved.push(statusItem);
} catch (e) {
} catch {
// just ignore.
}
}
Expand Down Expand Up @@ -656,7 +656,7 @@ export default BaseView.extend({
try {
val = Cookies.get(this.cookieSettingPrefix + name);
val = JSON.parse(val).value;
} catch (e) {
} catch {
/* error parsing json, load default here now */
return _default;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pat/structure/js/views/textfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default BaseView.extend({
query_string = JSON.stringify(query);
query_obj = query;
}
} catch (e) {
} catch {
query_obj = [];
query_string = "[]";
}
Expand Down
6 changes: 3 additions & 3 deletions src/pat/tinymce/tinymce--implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class TinyMCE {
if (lang !== "en" && self.options.tiny.language !== "en") {
try {
await import(`tinymce-i18n/langs6/${lang}`);
} catch (e) {
} catch {
log.debug("Could not load TinyMCE language: ", lang);
try {
// expected lang not available, let's fallback to closest one
Expand All @@ -137,7 +137,7 @@ export default class TinyMCE {
log.debug("Trying with: ", lang);
await import(`tinymce-i18n/langs6/${lang}`);
self.options.tiny.language = lang;
} catch (e) {
} catch {
log.debug("Could not load TinyMCE language. Fallback to English");
self.options.tiny.language = "en";
}
Expand Down Expand Up @@ -174,7 +174,7 @@ export default class TinyMCE {
try {
await import("tinymce/plugins/" + plugin);
valid_plugins.push(plugin);
} catch (e) {
} catch {
log.debug("Could not load TinyMCE plugin: ", plugin);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pat/upload/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default Base.extend({
var data;
try {
data = $.parseJSON(response);
} catch (ex) {
} catch {
data = response;
}
self.$el.trigger("uploadAllCompleted", {
Expand Down

0 comments on commit 26fc612

Please sign in to comment.