diff options
| author | Greg <supahgreg@users.noreply.github.com> | 2025-10-13 23:39:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-13 23:39:24 -0500 |
| commit | 6505cbb592b91556ca25a2bf72ad1d8cb0b3bc2a (patch) | |
| tree | 8ab133cc17a329ef7d99d152b3f6b4edc3830509 /js/CommonDialogs.js | |
| parent | 0d2b1d601294802286aa26e5486c1c4fee92c05a (diff) | |
| parent | 8b46ab31a96b6b6129f624719ac33ddf761805f1 (diff) | |
Merge pull request #42 from tt-rss/bugfix/eslint-config-and-findings
Get ESLint 9.x working, make the new config stricter, address findings
Diffstat (limited to 'js/CommonDialogs.js')
| -rw-r--r-- | js/CommonDialogs.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index f1be94c7c..16c1f5f46 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -1,9 +1,6 @@ 'use strict' -/* 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 = { @@ -184,7 +181,7 @@ const CommonDialogs = { select.addOption({value: '', label: __("Expand to select feed")}); for (const feedUrl in feeds) { - if (feeds.hasOwnProperty(feedUrl)) { + if (Object.prototype.hasOwnProperty.call(feeds, feedUrl)) { select.addOption({value: feedUrl, label: feeds[feedUrl]}); } } @@ -332,7 +329,7 @@ const CommonDialogs = { addLabel: function() { const caption = prompt(__("Please enter label caption:"), ""); - if (caption != undefined && caption.trim().length > 0) { + if (caption !== undefined && caption.trim().length > 0) { const query = {op: "Pref_Labels", method: "add", caption: caption.trim()}; @@ -351,7 +348,7 @@ const CommonDialogs = { const msg = __("Unsubscribe from %s?").replace("%s", title); - if (typeof title == "undefined" || confirm(msg)) { + if (typeof title === "undefined" || confirm(msg)) { Notify.progress("Removing feed..."); const query = {op: "Pref_Feeds", quiet: 1, method: "remove", ids: feed_id}; @@ -360,7 +357,7 @@ const CommonDialogs = { if (App.isPrefs()) { dijit.byId("feedTree").reload(); } else { - if (feed_id == Feeds.getActive()) + if (feed_id === Feeds.getActive()) setTimeout(() => { Feeds.openDefaultFeed(); }, @@ -396,10 +393,10 @@ const CommonDialogs = { } }, uploadIcon: function(input) { - if (input.files.length != 0) { + if (input.files.length !== 0) { const icon_file = input.files[0]; - if (icon_file.type.indexOf("image/") == -1) { + if (icon_file.type.indexOf("image/") === -1) { alert(__("Please select an image file.")); return; } @@ -501,7 +498,7 @@ const CommonDialogs = { xhr.json("backend.php", {op: "Pref_Feeds", method: "editfeed", id: feed_id}, (reply) => { const feed = reply.feed; - const is_readonly = reply.user.access_level == App.UserAccessLevels.ACCESS_LEVEL_READONLY; + const is_readonly = reply.user.access_level === App.UserAccessLevels.ACCESS_LEVEL_READONLY; // for unsub prompt dialog.feed_title = feed.title; |