From 39182a76e4070d3b92af10bf609fef8151bce6e4 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sun, 12 Oct 2025 21:02:39 +0000 Subject: Address ESLint rule 'eqeqeq'. https://eslint.org/docs/latest/rules/eqeqeq --- js/common.js | 66 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'js/common.js') diff --git a/js/common.js b/js/common.js index 99cf52fa1..cdc6cd6cc 100755 --- a/js/common.js +++ b/js/common.js @@ -5,7 +5,7 @@ /* exported __ */ function __(msg) { - if (typeof App != "undefined") { + if (typeof App !== "undefined") { return App.l10n.__(msg); } else { return msg; @@ -106,7 +106,7 @@ Element.prototype.fadeOut = function() { Element.prototype.fadeIn = function(display = undefined){ this.style.opacity = 0; - this.style.display = display == undefined ? "block" : display; + this.style.display = display === undefined ? "block" : display; const self = this; (function fade() { @@ -119,39 +119,39 @@ Element.prototype.fadeIn = function(display = undefined){ }; Element.prototype.visible = function() { - return window.getComputedStyle(this).display != "none"; //&& this.offsetHeight != 0 && this.offsetWidth != 0; + return window.getComputedStyle(this).display !== "none"; //&& this.offsetHeight !== 0 && this.offsetWidth !== 0; } Element.visible = function(elem) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); return elem.visible(); } Element.show = function(elem) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); return elem.show(); } Element.hide = function(elem) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); return elem.hide(); } Element.toggle = function(elem) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); return elem.toggle(); } Element.hasClassName = function (elem, className) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); return elem.hasClassName(className); @@ -159,7 +159,7 @@ Element.hasClassName = function (elem, className) { Array.prototype.remove = function(s) { for (let i=0; i < this.length; i++) { - if (s == this[i]) this.splice(i, 1); + if (s === this[i]) this.splice(i, 1); } }; @@ -176,14 +176,14 @@ const xhr = { console.log('xhr.post', '>>>', params); return new Promise((resolve, reject) => { - if (typeof __csrf_token != "undefined") + if (typeof __csrf_token !== "undefined") params = {...params, ...{csrf_token: __csrf_token}}; dojo.xhrPost({url: url, postData: dojo.objectToQuery(params), handleAs: "text", error: function(error) { - if (failed != undefined) + if (failed !== undefined) failed(error); reject(error); @@ -191,7 +191,7 @@ const xhr = { load: function(data, ioargs) { console.log('xhr.post', '<<<', ioargs.xhr, (new Date().getTime() - xhr._ts) + " ms"); - if (complete != undefined) + if (typeof complete === 'function') complete(data, ioargs.xhr); resolve(data) @@ -209,7 +209,7 @@ const xhr = { } catch (e) { console.error("xhr.json", e, xhr); - if (failed != undefined) + if (typeof failed === 'function') failed(e); reject(e); @@ -218,21 +218,21 @@ const xhr = { console.log('xhr.json', '<<<', obj, (new Date().getTime() - xhr._ts) + " ms"); - if (obj && typeof App != "undefined") - if (!App.handleRpcJson(obj)) { + if (obj && typeof App !== "undefined") + if (!App.handleRpcJson(obj)) { - if (failed != undefined) - failed(obj); + if (typeof failed === 'function') + failed(obj); - reject(obj); - return; - } + reject(obj); + return; + } - if (complete != undefined) complete(obj); + if (typeof complete === 'function') + complete(obj); - resolve(obj); - } - )); + resolve(obj); + })); } }; @@ -241,7 +241,7 @@ function xhrPost(url, params = {}, complete = undefined) { console.log("xhrPost:", params); return new Promise((resolve, reject) => { - if (typeof __csrf_token != "undefined") + if (typeof __csrf_token !== "undefined") params = {...params, ...{csrf_token: __csrf_token}}; dojo.xhrPost({url: url, @@ -251,7 +251,7 @@ function xhrPost(url, params = {}, complete = undefined) { reject(error); }, load: function(data, ioargs) { - if (complete != undefined) + if (complete !== undefined) complete(ioargs.xhr); resolve(ioargs.xhr) @@ -279,7 +279,7 @@ const Lists = { checked ? row.addClassName("Selected") : row.removeClassName("Selected"); }, select: function(elem, selected) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); elem.querySelectorAll("li").forEach((row) => { @@ -300,7 +300,7 @@ const Lists = { getSelected: function(elem) { const rv = []; - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); elem.querySelectorAll("li").forEach((row) => { @@ -337,7 +337,7 @@ const Tables = { }, select: function(elem, selected) { - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); elem.querySelectorAll("tr").forEach((row) => { @@ -358,7 +358,7 @@ const Tables = { getSelected: function(elem) { const rv = []; - if (typeof elem == "string") + if (typeof elem === "string") elem = document.getElementById(elem); elem.querySelectorAll("tr").forEach((row) => { @@ -394,8 +394,8 @@ const Cookie = { const ca = document.cookie.split(';'); for (let i=0; i < ca.length; i++) { let c = ca[i]; - while (c.charAt(0) == ' ') c = c.substring(1); - if (c.indexOf(name) == 0) return decodeURIComponent(c.substring(name.length, c.length)); + while (c.charAt(0) === ' ') c = c.substring(1); + if (c.indexOf(name) === 0) return decodeURIComponent(c.substring(name.length, c.length)); } return ""; }, @@ -455,7 +455,7 @@ const Notify = { } if (icon) - if (icon.indexOf("data:image") != -1) + if (icon.indexOf("data:image") !== -1) msgfmt = "".replace("%s", icon) + msgfmt; else msgfmt = "%s".replace("%s", icon) + msgfmt; -- cgit v1.2.3-54-g00ecf From 360c552da41b08d92c8d5e0d01968ffe1e8e6323 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sun, 12 Oct 2025 21:48:10 +0000 Subject: Address rule 'no-redeclare' for 'dojo' and 'dijit' (defined as globals in 'eslint.config.js'). Also take care of 2 'no-prototype-builtins' and a 'no-useless-escape'. * https://eslint.org/docs/latest/rules/no-redeclare * https://eslint.org/docs/latest/rules/no-prototype-builtins * https://eslint.org/docs/latest/rules/no-useless-escape --- js/App.js | 2 +- js/Article.js | 2 +- js/CommonDialogs.js | 2 +- js/CommonFilters.js | 2 +- js/FeedStoreModel.js | 2 +- js/FeedTree.js | 2 +- js/Feeds.js | 2 +- js/Headlines.js | 2 +- js/PrefFeedStore.js | 2 +- js/PrefFeedTree.js | 2 +- js/PrefFilterStore.js | 2 +- js/PrefFilterTree.js | 2 +- js/PrefHelpers.js | 2 +- js/PrefLabelTree.js | 2 +- js/PrefUsers.js | 2 +- js/SingleUseDialog.js | 2 +- js/Toolbar.js | 2 +- js/common.js | 2 +- js/form/ComboButton.js | 2 +- js/form/DropDownButton.js | 2 +- js/tt-rss.js | 2 +- plugins/af_psql_trgm/init.js | 2 +- plugins/share/share.js | 2 +- plugins/shorten_expanded/init.js | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) (limited to 'js/common.js') diff --git a/js/App.js b/js/App.js index 97323a9bc..80fbabe82 100644 --- a/js/App.js +++ b/js/App.js @@ -423,7 +423,7 @@ const App = { '/': '/', }; - return p.replace(/[&<>"'\/]/g, m => map[m]); + return p.replace(/[&<>"'/]/g, m => map[m]); }, unescapeHtml: function(p) { if (typeof p !== 'string' || p.indexOf('&') === -1) diff --git a/js/Article.js b/js/Article.js index b38cb50c6..1f4cf931e 100644 --- a/js/Article.js +++ b/js/Article.js @@ -1,7 +1,7 @@ 'use strict' /* eslint-disable no-new */ -/* global __, ngettext, App, Headlines, xhr, dojo, dijit, PluginHost, Notify, fox */ +/* global __, ngettext, App, Headlines, xhr, PluginHost, Notify, fox */ const Article = { _scroll_reset_timeout: false, diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index 9c6d1338b..43c22b5f6 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -3,7 +3,7 @@ /* eslint-disable new-cap */ /* eslint-disable no-new */ -/* global __, dojo, dijit, Notify, App, Feeds, xhr, Tables, fox */ +/* global __, Notify, App, Feeds, xhr, Tables, fox */ /* exported CommonDialogs */ const CommonDialogs = { diff --git a/js/CommonFilters.js b/js/CommonFilters.js index e27d3c40c..3e68168fe 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -3,7 +3,7 @@ /* eslint-disable no-new */ /* global __, App, Article, Lists, fox */ -/* global xhr, dojo, dijit, Notify, Feeds */ +/* global xhr, Notify, Feeds */ /* exported Filters */ const Filters = { diff --git a/js/FeedStoreModel.js b/js/FeedStoreModel.js index fa8f730d6..ef43357d0 100644 --- a/js/FeedStoreModel.js +++ b/js/FeedStoreModel.js @@ -1,4 +1,4 @@ -/* global define, dijit */ +/* global define */ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare) { diff --git a/js/FeedTree.js b/js/FeedTree.js index cd7e1f311..09288845c 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, dojo, dijit, define, App, Feeds, CommonDialogs */ +/* global __, define, App, Feeds, CommonDialogs */ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/cookie", "dijit/Tree", "dijit/Menu"], function (declare, domConstruct, array, cookie) { diff --git a/js/Feeds.js b/js/Feeds.js index 825f6f8ef..38e87b384 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -1,6 +1,6 @@ 'use strict' -/* global __, App, Headlines, xhr, dojo, dijit, fox, PluginHost, Notify, fox */ +/* global __, App, Headlines, xhr, fox, PluginHost, Notify, fox */ const Feeds = { FEED_ARCHIVED: 0, diff --git a/js/Headlines.js b/js/Headlines.js index 1547781c4..1a59ffda0 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -1,7 +1,7 @@ 'use strict'; /* global __, ngettext, Article, App */ -/* global dojo, dijit, PluginHost, Notify, xhr, Feeds */ +/* global PluginHost, Notify, xhr, Feeds */ /* global CommonDialogs */ const Headlines = { diff --git a/js/PrefFeedStore.js b/js/PrefFeedStore.js index 348cbd995..d03169acb 100644 --- a/js/PrefFeedStore.js +++ b/js/PrefFeedStore.js @@ -1,4 +1,4 @@ -/* global define, dojo */ +/* global define */ define(["dojo/_base/declare", "dojo/data/ItemFileWriteStore"], function (declare) { diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 7a7c5b551..92e748903 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhr, fox, App */ +/* global __, lib, define, CommonDialogs, Notify, Tables, xhr, fox, App */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_base/array", "dojo/cookie"], function (declare, domConstruct, checkBoxTree, array, cookie) { diff --git a/js/PrefFilterStore.js b/js/PrefFilterStore.js index f1192374a..f4cb8d0dd 100644 --- a/js/PrefFilterStore.js +++ b/js/PrefFilterStore.js @@ -1,4 +1,4 @@ -/* global define, dojo */ +/* global define */ define(["dojo/_base/declare", "dojo/data/ItemFileWriteStore"], function (declare) { diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 9a9728c08..64984b107 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, define, lib, dijit, dojo, xhr, App, Notify, Filters */ +/* global __, define, lib, xhr, App, Notify, Filters */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) { diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index b0b0d9c97..38fa7e243 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -1,7 +1,7 @@ 'use strict'; /* eslint-disable no-new */ -/* global __, dijit, dojo, Tables, Notify, xhr, App, fox */ +/* global __, Tables, Notify, xhr, App, fox */ const Helpers = { AppPasswords: { diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index c73a3ac46..1859906ee 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, define, lib, dijit, dojo, xhr, Notify, fox, App */ +/* global __, define, lib, xhr, Notify, fox, App */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare, domConstruct) { diff --git a/js/PrefUsers.js b/js/PrefUsers.js index 362e62662..73e48b52f 100644 --- a/js/PrefUsers.js +++ b/js/PrefUsers.js @@ -1,6 +1,6 @@ 'use strict' -/* global __, xhr, dijit, Notify, Tables, App, fox */ +/* global __, xhr, Notify, Tables, App, fox */ const Users = { reload: function(sort) { diff --git a/js/SingleUseDialog.js b/js/SingleUseDialog.js index 2de6f83ff..b38b3f969 100644 --- a/js/SingleUseDialog.js +++ b/js/SingleUseDialog.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/Dialog"], function (declare) { return declare("fox.SingleUseDialog", dijit.Dialog, { create: function(params) { diff --git a/js/Toolbar.js b/js/Toolbar.js index d4993e713..b7c2a0898 100755 --- a/js/Toolbar.js +++ b/js/Toolbar.js @@ -1,4 +1,4 @@ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/Toolbar"], function (declare) { return declare("fox.Toolbar", dijit.Toolbar, { diff --git a/js/common.js b/js/common.js index cdc6cd6cc..bccd0dcbb 100755 --- a/js/common.js +++ b/js/common.js @@ -1,6 +1,6 @@ 'use strict'; -/* global dijit, App, dojo, __csrf_token */ +/* global App, __csrf_token */ /* eslint-disable no-new */ /* exported __ */ diff --git a/js/form/ComboButton.js b/js/form/ComboButton.js index 2ad4bf123..4c97809e4 100755 --- a/js/form/ComboButton.js +++ b/js/form/ComboButton.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/form/ComboButton"], function (declare) { return declare("fox.form.ComboButton", dijit.form.ComboButton, { startup: function() { diff --git a/js/form/DropDownButton.js b/js/form/DropDownButton.js index d5ea39726..357d5de91 100755 --- a/js/form/DropDownButton.js +++ b/js/form/DropDownButton.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/form/DropDownButton"], function (declare) { return declare("fox.form.DropDownButton", dijit.form.DropDownButton, { startup: function() { diff --git a/js/tt-rss.js b/js/tt-rss.js index 8e0401d80..2af9d32ff 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -1,6 +1,6 @@ 'use strict' -/* global require, App, dojo */ +/* global require, App */ /* exported Plugins */ const Plugins = {}; diff --git a/plugins/af_psql_trgm/init.js b/plugins/af_psql_trgm/init.js index f3662a389..e57f11564 100644 --- a/plugins/af_psql_trgm/init.js +++ b/plugins/af_psql_trgm/init.js @@ -1,4 +1,4 @@ -/* global dijit, dojo, Plugins, xhr, __ */ +/* global Plugins, xhr, __ */ Plugins.Psql_Trgm = { showRelated: function (id) { diff --git a/plugins/share/share.js b/plugins/share/share.js index 1be9db682..f27e06678 100644 --- a/plugins/share/share.js +++ b/plugins/share/share.js @@ -1,4 +1,4 @@ -/* global dojo, Plugins, App, Notify, fox, xhr, __ */ +/* global Plugins, App, Notify, fox, xhr, __ */ Plugins.Share = { shareArticle: function(id) { diff --git a/plugins/shorten_expanded/init.js b/plugins/shorten_expanded/init.js index bc3e35ff6..a89fe8e92 100644 --- a/plugins/shorten_expanded/init.js +++ b/plugins/shorten_expanded/init.js @@ -1,4 +1,4 @@ -/* global Plugins, __, require, PluginHost, App, dojo */ +/* global Plugins, __, require, PluginHost, App */ Plugins.Shorten_Expanded = { threshold: 1.5, // of window height -- cgit v1.2.3-54-g00ecf From cde120b3d730dfb56fa59759bb9a7369584f551c Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sun, 12 Oct 2025 22:26:51 +0000 Subject: Clean up unnecessary eslint-disable directives (per ESLint). --- js/App.js | 1 - js/Article.js | 1 - js/CommonDialogs.js | 3 --- js/CommonFilters.js | 2 -- js/FeedTree.js | 2 -- js/Headlines.js | 2 -- js/PrefFeedTree.js | 2 -- js/PrefFilterTree.js | 2 -- js/PrefHelpers.js | 1 - js/PrefLabelTree.js | 2 -- js/SingleUseDialog.js | 1 - js/common.js | 1 - js/form/ComboButton.js | 1 - js/form/DropDownButton.js | 1 - js/form/Select.js | 1 - js/form/ValidationTextArea.js | 2 -- 16 files changed, 25 deletions(-) (limited to 'js/common.js') diff --git a/js/App.js b/js/App.js index 80fbabe82..0adf291c2 100644 --- a/js/App.js +++ b/js/App.js @@ -1,6 +1,5 @@ 'use strict'; -/* eslint-disable new-cap */ /* global __, Article, Headlines, Filters, fox */ /* global xhr, PluginHost, Notify, Feeds, Cookie */ /* global CommonDialogs, Plugins */ diff --git a/js/Article.js b/js/Article.js index 1f4cf931e..f7672033c 100644 --- a/js/Article.js +++ b/js/Article.js @@ -1,6 +1,5 @@ 'use strict' -/* eslint-disable no-new */ /* global __, ngettext, App, Headlines, xhr, PluginHost, Notify, fox */ const Article = { diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index 43c22b5f6..16c1f5f46 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -1,8 +1,5 @@ 'use strict' -/* eslint-disable new-cap */ -/* eslint-disable no-new */ - /* global __, Notify, App, Feeds, xhr, Tables, fox */ /* exported CommonDialogs */ diff --git a/js/CommonFilters.js b/js/CommonFilters.js index 3e68168fe..54df70266 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -1,7 +1,5 @@ 'use strict' -/* eslint-disable no-new */ - /* global __, App, Article, Lists, fox */ /* global xhr, Notify, Feeds */ diff --git a/js/FeedTree.js b/js/FeedTree.js index 86a396068..f0041640d 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global __, define, App, Feeds, CommonDialogs */ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/cookie", "dijit/Tree", "dijit/Menu"], function (declare, domConstruct, array, cookie) { @@ -208,7 +207,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co return [item.updated, item.error].filter((x) => x && x !== "").join(" - "); }, getIconClass: function (item, opened) { - // eslint-disable-next-line no-nested-ternary return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feed-icon"; }, getLabelClass: function (item/* , opened */) { diff --git a/js/Headlines.js b/js/Headlines.js index 1a59ffda0..1725998bc 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -228,7 +228,6 @@ const Headlines = { } else if (event.ctrlKey) { Headlines.select('invert', id); } else { - // eslint-disable-next-line no-lonely-if if (App.isCombinedMode()) { if (event.altKey && !in_body) { @@ -268,7 +267,6 @@ const Headlines = { return in_body; } else { - // eslint-disable-next-line no-lonely-if if (event.altKey) { Article.openInNewWindow(id); Headlines.toggleUnread(id, 0); diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 92e748903..142060488 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global __, lib, define, CommonDialogs, Notify, Tables, xhr, fox, App */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_base/array", "dojo/cookie"], @@ -143,7 +142,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b return rc; }, getIconClass: function (item, opened) { - // eslint-disable-next-line no-nested-ternary return (!item || this.model.store.getValue(item, 'type') === 'category') ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feed-icon"; }, reload: function() { diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 64984b107..1f20da581 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global __, define, lib, xhr, App, Notify, Filters */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) { @@ -71,7 +70,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio return label; }, getIconClass: function (item, opened) { - // eslint-disable-next-line no-nested-ternary return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; }, getRowClass: function (item, opened) { diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index 38fa7e243..fbe1d37f5 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -1,6 +1,5 @@ 'use strict'; -/* eslint-disable no-new */ /* global __, Tables, Notify, xhr, App, fox */ const Helpers = { diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 1859906ee..a4540deec 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global __, define, lib, xhr, Notify, fox, App */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare, domConstruct) { @@ -40,7 +39,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return tnode; }, getIconClass: function (item, opened) { - // eslint-disable-next-line no-nested-ternary return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; }, getSelectedLabels: function() { diff --git a/js/SingleUseDialog.js b/js/SingleUseDialog.js index b38b3f969..a207c0c44 100644 --- a/js/SingleUseDialog.js +++ b/js/SingleUseDialog.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global define */ define(["dojo/_base/declare", "dijit/Dialog"], function (declare) { return declare("fox.SingleUseDialog", dijit.Dialog, { diff --git a/js/common.js b/js/common.js index bccd0dcbb..3e8a66e5b 100755 --- a/js/common.js +++ b/js/common.js @@ -1,7 +1,6 @@ 'use strict'; /* global App, __csrf_token */ -/* eslint-disable no-new */ /* exported __ */ function __(msg) { diff --git a/js/form/ComboButton.js b/js/form/ComboButton.js index 4c97809e4..98386eead 100755 --- a/js/form/ComboButton.js +++ b/js/form/ComboButton.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global define */ define(["dojo/_base/declare", "dijit/form/ComboButton"], function (declare) { return declare("fox.form.ComboButton", dijit.form.ComboButton, { diff --git a/js/form/DropDownButton.js b/js/form/DropDownButton.js index 357d5de91..60d8e86ef 100755 --- a/js/form/DropDownButton.js +++ b/js/form/DropDownButton.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global define */ define(["dojo/_base/declare", "dijit/form/DropDownButton"], function (declare) { return declare("fox.form.DropDownButton", dijit.form.DropDownButton, { diff --git a/js/form/Select.js b/js/form/Select.js index 2259fd762..bc352e612 100755 --- a/js/form/Select.js +++ b/js/form/Select.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global define */ // FIXME: there probably is a better, more dojo-like notation for custom data- properties define(["dojo/_base/declare", diff --git a/js/form/ValidationTextArea.js b/js/form/ValidationTextArea.js index c53260f40..ced4f8fe7 100644 --- a/js/form/ValidationTextArea.js +++ b/js/form/ValidationTextArea.js @@ -1,5 +1,4 @@ // https://stackoverflow.com/questions/19317258/how-to-use-dijit-textarea-validation-dojo-1-9 -/* eslint-disable no-new */ /* global define */ define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/SimpleTextarea", "dijit/form/ValidationTextBox"], @@ -10,7 +9,6 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/SimpleTextarea", "d this.constraints = {}; this.baseClass += ' dijitValidationTextArea'; }, - // eslint-disable-next-line no-template-curly-in-string templateString: "", validator: function(value, constraints) { //console.log(this, value, constraints); -- cgit v1.2.3-54-g00ecf From 47848d0198cb13a718fd507bed98b03b13846b15 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sun, 12 Oct 2025 22:32:55 +0000 Subject: Fix various ESLint 'no-undef' rule instances. https://eslint.org/docs/latest/rules/no-undef --- eslint.config.js | 3 +++ js/common.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'js/common.js') diff --git a/eslint.config.js b/eslint.config.js index a42b6d0e3..9b54e36af 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -30,6 +30,9 @@ export default [ navigator: 'readonly', Event: 'readonly', CustomEvent: 'readonly', + Element: 'readonly', + IntersectionObserver: 'readonly', + MutationObserver: 'readonly', // Dojo dojo: 'readonly', diff --git a/js/common.js b/js/common.js index 3e8a66e5b..60b2f4c9c 100755 --- a/js/common.js +++ b/js/common.js @@ -98,7 +98,7 @@ Element.prototype.fadeOut = function() { if ((self.style.opacity -= 0.1) < 0) { self.style.display = "none"; } else { - requestAnimationFrame(fade); + window.requestAnimationFrame(fade); } }()); }; @@ -112,7 +112,7 @@ Element.prototype.fadeIn = function(display = undefined){ let val = parseFloat(self.style.opacity); if (!((val += 0.1) > 1)) { self.style.opacity = val; - requestAnimationFrame(fade); + window.requestAnimationFrame(fade); } }()); }; -- cgit v1.2.3-54-g00ecf From 8b46ab31a96b6b6129f624719ac33ddf761805f1 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Tue, 14 Oct 2025 04:36:36 +0000 Subject: Fix some more issues related to ESLint 'eqeqeq' changes (again). --- js/App.js | 2 +- js/PrefHelpers.js | 2 +- js/common.js | 21 +++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'js/common.js') diff --git a/js/App.js b/js/App.js index 571e3373f..e305ce998 100644 --- a/js/App.js +++ b/js/App.js @@ -912,7 +912,7 @@ const App = { if (action_name) { const action_func = this.hotkey_actions[action_name]; - if (action_func !== null) { + if (typeof action_func === 'function') { action_func(event); event.stopPropagation(); return false; diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index fbe1d37f5..cf3f03bf2 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -455,7 +455,7 @@ const Helpers = { Notify.progress("Loading, please wait..."); xhr.json("backend.php", {op: "Pref_Prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { - if (reply && reply.status === 1) + if (reply?.status === true) Helpers.Plugins.reload(); else { Notify.error("Plugin uninstallation failed."); diff --git a/js/common.js b/js/common.js index 60b2f4c9c..48a42b95a 100755 --- a/js/common.js +++ b/js/common.js @@ -217,21 +217,22 @@ const xhr = { console.log('xhr.json', '<<<', obj, (new Date().getTime() - xhr._ts) + " ms"); - if (obj && typeof App !== "undefined") - if (!App.handleRpcJson(obj)) { + if (obj && typeof App !== 'undefined') { + if (!App.handleRpcJson(obj)) { - if (typeof failed === 'function') - failed(obj); + if (typeof failed === 'function') + failed(obj); - reject(obj); - return; + reject(obj); + return; + } } - if (typeof complete === 'function') - complete(obj); + if (typeof complete === 'function') + complete(obj); - resolve(obj); - })); + resolve(obj); + })); } }; -- cgit v1.2.3-54-g00ecf