From a69832e3a3cba8414dd63ea318f286b407b67d49 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 16:09:55 -0600 Subject: [PATCH 01/54] eslint: run pnpm eslint --fix --- src/entry_ext.js | 2 +- src/esbridge.js | 28 +- src/modules/chat/actions/actions.jsx | 2 +- .../chat/actions/components/edit-chat.vue | 1 - .../chat/actions/components/edit-profile.vue | 4 +- src/modules/chat/actions/types.jsx | 2 +- src/modules/chat/badges.jsx | 14 +- src/modules/chat/components/chat-line.vue | 1 - src/modules/chat/emotes.js | 18 +- src/modules/chat/index.js | 20 +- src/modules/chat/link_providers.js | 6 +- src/modules/chat/room.js | 2 +- src/modules/chat/tokenizers.jsx | 22 +- src/modules/emote_card/components/card.vue | 24 +- .../components/manage-ffz-collection.vue | 12 +- .../emote_card/components/manage-ffz.vue | 4 +- .../emote_card/components/modifiers.vue | 6 +- .../emote_card/components/report-form.vue | 11 +- .../emote_card/components/twitch-body.vue | 3 +- src/modules/emote_card/index.jsx | 16 +- src/modules/link_card/components/card.vue | 10 +- src/modules/link_card/index.jsx | 6 +- .../main_menu/components/action-editor.vue | 2 +- .../main_menu/components/changelog.vue | 10 +- .../main_menu/components/chat-actions.vue | 4 +- .../main_menu/components/chat-tester.vue | 36 +- .../main_menu/components/emote-priorities.vue | 16 +- .../components/filter-rule-editor.vue | 2 +- .../main_menu/components/link-tester.vue | 2 +- .../main_menu/components/profile-editor.vue | 6 +- .../main_menu/components/profile-manager.vue | 2 +- .../components/setting-filter-editor.vue | 2 - .../main_menu/components/socket-info.vue | 16 +- .../main_menu/components/tooltip-tos.vue | 4 +- .../translation_ui/components/i18n-entry.vue | 12 +- .../components/translation-ui.vue | 4 +- src/modules/viewer_cards/card.vue | 2 +- src/modules/viewer_cards/components/stats.vue | 4 +- src/settings/components/monitor.vue | 8 +- src/sites/base.js | 2 +- src/sites/player/metadata.jsx | 2 +- src/sites/shared/player.jsx | 2 +- .../modules/chat/emote_menu.jsx | 6 +- .../twitch-twilight/modules/chat/index.js | 58 +- .../twitch-twilight/modules/chat/input.jsx | 2 +- .../twitch-twilight/modules/chat/line.js | 26 +- .../modules/directory/index.jsx | 6 +- .../twitch-twilight/modules/mod-view.jsx | 2 +- .../modules/video_chat/index.jsx | 2 +- src/std-components/emote-picker.vue | 6 +- src/std-components/tab-container.vue | 2 +- src/utilities/custom_denoflare_mqtt.js | 772 +++++++++--------- src/utilities/rich_tokens.js | 14 +- 53 files changed, 633 insertions(+), 615 deletions(-) diff --git a/src/entry_ext.js b/src/entry_ext.js index 586f3f75..4e401c0c 100644 --- a/src/entry_ext.js +++ b/src/entry_ext.js @@ -97,7 +97,7 @@ // Now, inject our script into the page context. const HOST = location.hostname, - SERVER = browser.runtime.getURL("web"), + SERVER = browser.runtime.getURL('web'), script = document.createElement('script'); let FLAVOR = diff --git a/src/esbridge.js b/src/esbridge.js index 922f2a67..3fc34318 100644 --- a/src/esbridge.js +++ b/src/esbridge.js @@ -55,7 +55,7 @@ class FFZESBridge { msg, location.origin, transfer ? (Array.isArray(transfer) ? transfer : [transfer]) : undefined - ); + ); } catch(err) { this.log.error('Error sending message to window.', err, msg, transfer); } @@ -63,21 +63,21 @@ class FFZESBridge { onWindowMessage(event) { if ( event.origin !== location.origin ) - return; + return; const msg = event.data, - id = msg?.id, - type = msg?.ffz_esb_type; + id = msg?.id, + type = msg?.ffz_esb_type; if ( ! type ) - return; + return; this.log.info('Received Message from Page', type, id, msg); if ( type === 'init' ) { this.received_init = true; if ( this.active ) - this.runtimeHeartbeat(); + this.runtimeHeartbeat(); } this.runtimeSend(msg); @@ -89,7 +89,7 @@ class FFZESBridge { runtimeOpen() { if ( this.active ) - return Promise.resolve(); + return Promise.resolve(); this.log.info('Connecting to worker.'); @@ -99,7 +99,7 @@ class FFZESBridge { this.port.onDisconnect.addListener(this.onRuntimeDisconnect); if ( this.received_init ) - this.runtimeHeartbeat(); + this.runtimeHeartbeat(); } onRuntimeMessage(msg) { @@ -118,27 +118,27 @@ class FFZESBridge { runtimeHeartbeat() { if ( this._heartbeat ) - return; + return; this._heartbeat = setInterval(() => { if ( this.active ) - this.runtimeSend('heartbeat'); + this.runtimeSend('heartbeat'); }, 30000); } runtimeSend(msg) { if ( typeof msg === 'string' ) - msg = {ffz_esb_type: msg}; + msg = {ffz_esb_type: msg}; if ( ! this.active ) // We need to create our port. - this.runtimeOpen(); + this.runtimeOpen(); // Send the message, knowing we have an open port. this.port.postMessage(msg); } -}; +} FFZESBridge.Logger = Logger; @@ -151,7 +151,7 @@ const VER = FFZESBridge.version_info = Object.freeze({ build: __version_build__, hash: __webpack_hash__, toString: () => - `${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${VER.build ? `+${VER.build}` : ''}` + `${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${VER.build ? `+${VER.build}` : ''}` }); window.FFZESBridge = FFZESBridge; diff --git a/src/modules/chat/actions/actions.jsx b/src/modules/chat/actions/actions.jsx index 4e0012ee..9adcfa87 100644 --- a/src/modules/chat/actions/actions.jsx +++ b/src/modules/chat/actions/actions.jsx @@ -27,7 +27,7 @@ export default class Actions extends Module { this.actions = {}; this.renderers = {}; - this.filterAction = (x) => x.appearance && + this.filterAction = x => x.appearance && this.renderers[x.appearance.type] && (! this.renderers[x.appearance.type].load || this.renderers[x.appearance.type].load(x.appearance)) && (! x.action || this.actions[x.action]); diff --git a/src/modules/chat/actions/components/edit-chat.vue b/src/modules/chat/actions/components/edit-chat.vue index da13a63c..c2beedda 100644 --- a/src/modules/chat/actions/components/edit-chat.vue +++ b/src/modules/chat/actions/components/edit-chat.vue @@ -61,7 +61,6 @@ {{ t('setting.actions.chat.target-incompatible', 'Note: This is not compatible with pasting a message into chat, and will not function if that is enabled.') }} - diff --git a/src/modules/chat/actions/components/edit-profile.vue b/src/modules/chat/actions/components/edit-profile.vue index e2e7bf4c..1c3f7dac 100644 --- a/src/modules/chat/actions/components/edit-profile.vue +++ b/src/modules/chat/actions/components/edit-profile.vue @@ -15,7 +15,9 @@ v-for="profile in profiles" :key="profile.value" :value="profile.value" - >{{ profile.i18n_key ? t(profile.i18n_key, profile.name) : profile.name }} + > + {{ profile.i18n_key ? t(profile.i18n_key, profile.name) : profile.name }} + diff --git a/src/modules/chat/actions/types.jsx b/src/modules/chat/actions/types.jsx index c50ad17e..d9d19dd0 100644 --- a/src/modules/chat/actions/types.jsx +++ b/src/modules/chat/actions/types.jsx @@ -40,7 +40,7 @@ export const pin = { }, hidden(data, message, current_room, current_user, mod_icons, instance) { - let line = instance; + const line = instance; if ( ! line ) return true; diff --git a/src/modules/chat/badges.jsx b/src/modules/chat/badges.jsx index 4f0dc3b6..12779e3d 100644 --- a/src/modules/chat/badges.jsx +++ b/src/modules/chat/badges.jsx @@ -739,10 +739,10 @@ export default class Badges extends Module { } return { - room_id: room_id, - room_login: room_login, - user_id: user_id, - user_login: user_login, + room_id, + room_login, + user_id, + user_login, data }; } @@ -1279,11 +1279,11 @@ export default class Badges extends Module { return; if ( d.lifetime ) - return '\n' + this.i18n.t('badges.subwoofer.lifetime', 'Lifetime Subwoofer'); + return `\n${ this.i18n.t('badges.subwoofer.lifetime', 'Lifetime Subwoofer')}`; - return '\n' + this.i18n.t('badges.subwoofer.months', '({count, plural, one {# Month} other {# Months}})', { + return `\n${ this.i18n.t('badges.subwoofer.months', '({count, plural, one {# Month} other {# Months}})', { count: d.months - }); + })}`; }) }; } diff --git a/src/modules/chat/components/chat-line.vue b/src/modules/chat/components/chat-line.vue index c46b4584..615cf393 100644 --- a/src/modules/chat/components/chat-line.vue +++ b/src/modules/chat/components/chat-line.vue @@ -1,5 +1,4 @@ \ No newline at end of file + From 45fb6e963a097f5d0c934715d7b484d92af7756f Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:12:05 -0600 Subject: [PATCH 21/54] eslint: oopsy comma operator --- src/std-components/emote-picker.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/std-components/emote-picker.vue b/src/std-components/emote-picker.vue index 0abf1440..773f215b 100644 --- a/src/std-components/emote-picker.vue +++ b/src/std-components/emote-picker.vue @@ -232,7 +232,7 @@ export default { id: val.id, name: val.name, src: val.src - }, + }; this.$emit('input', this.val); if ( close ) this.open = false; @@ -256,4 +256,4 @@ export default { } } - \ No newline at end of file + From 5c11a0fcba9c214a4af3b76df280a3a9ed5a2d7c Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:19:30 -0600 Subject: [PATCH 22/54] eslint: comment out empty onEnable method --- src/socket.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/socket.js b/src/socket.js index cf4f9c6b..90fbc3f2 100644 --- a/src/socket.js +++ b/src/socket.js @@ -125,14 +125,14 @@ export default class SocketClient extends Module { } - onEnable() { - // We don't connect anymore. - // For now, stop connecting to the sockets for people using the - // API links experiment. - //if ( this.experiments.getAssignment('api_links') ) - // return; - //this.connect(); - } + // onEnable() { + // We don't connect anymore. + // For now, stop connecting to the sockets for people using the + // API links experiment. + // if ( this.experiments.getAssignment('api_links') ) + // return; + // this.connect(); + // } onDisable() { this.disconnect() } From bc91824beb9d11a8ad7b3f9ca3d780c9a4b52513 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:21:55 -0600 Subject: [PATCH 23/54] eslint: comment out empty render() method --- .../modules/video_chat/index.jsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sites/twitch-twilight/modules/video_chat/index.jsx b/src/sites/twitch-twilight/modules/video_chat/index.jsx index 1b0ed31b..c5349f50 100644 --- a/src/sites/twitch-twilight/modules/video_chat/index.jsx +++ b/src/sites/twitch-twilight/modules/video_chat/index.jsx @@ -4,7 +4,7 @@ // Video Chat Hooks // ============================================================================ -import {get, has} from 'utilities/object'; +import {get} from 'utilities/object'; import {print_duration} from 'utilities/time'; //import {ClickOutside} from 'utilities/dom'; import {formatBitsConfig} from '../chat'; @@ -183,23 +183,23 @@ export default class VideoChatHook extends Module { } } - render() { - //if ( ! t.VideoChatMenu._class ) - return null; - - /*return (
- -
);*/ - } + // render() { + // //if ( ! t.VideoChatMenu._class ) + // return null; + // + // /*return (
+ // + //
);*/ + // } } this.VideoChatLine.ready(cls => { From c9dd3853706626765a019601c5f298501fd35324 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:28:17 -0600 Subject: [PATCH 24/54] eslint: comment out some empty methods that don't appear to be used --- src/sites/twitch-twilight/modules/player.jsx | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/sites/twitch-twilight/modules/player.jsx b/src/sites/twitch-twilight/modules/player.jsx index b2a6c2d2..9e9df309 100644 --- a/src/sites/twitch-twilight/modules/player.jsx +++ b/src/sites/twitch-twilight/modules/player.jsx @@ -202,8 +202,8 @@ export default class Player extends PlayerBase { } }); - this.PlayerSource.on('mount', this.checkCarousel, this); - this.PlayerSource.on('update', this.checkCarousel, this); + // this.PlayerSource.on('mount', this.checkCarousel, this); + // this.PlayerSource.on('update', this.checkCarousel, this); } maybeOpenChat() { @@ -220,24 +220,24 @@ export default class Player extends PlayerBase { } - checkCarousel(inst) { - /*if ( this.settings.get('channel.hosting.enable') ) - return; - - if ( inst.props?.playerType === 'channel_home_carousel' ) { - if ( inst.props.content?.hostChannel === inst._ffz_cached_login ) - return; - - inst._ffz_cached_login = inst.props.content?.hostChannel; - if ( ! inst._ffz_cached_login ) - return; - - const player = inst.props.mediaPlayerInstance, - events = inst.props.playerEvents; - - this.stopPlayer(player, events, inst); - }*/ - } + // checkCarousel(inst) { + // /*if ( this.settings.get('channel.hosting.enable') ) + // return; + // + // if ( inst.props?.playerType === 'channel_home_carousel' ) { + // if ( inst.props.content?.hostChannel === inst._ffz_cached_login ) + // return; + // + // inst._ffz_cached_login = inst.props.content?.hostChannel; + // if ( ! inst._ffz_cached_login ) + // return; + // + // const player = inst.props.mediaPlayerInstance, + // events = inst.props.playerEvents; + // + // this.stopPlayer(player, events, inst); + // }*/ + // } getData() { @@ -275,18 +275,18 @@ export default class Player extends PlayerBase { * @memberof Player * @returns {void} */ - repositionPlayer() { - // TODO: New implementation that works. - } - - updateSquadContext() { - this.settings.updateContext({ - squad_bar: this.hasSquadBar - }); - } - - get hasSquadBar() { - // TODO: New implementation that works. - return false; - } + // repositionPlayer() { + // // TODO: New implementation that works. + // } + // + // updateSquadContext() { + // this.settings.updateContext({ + // squad_bar: this.hasSquadBar + // }); + // } + // + // get hasSquadBar() { + // // TODO: New implementation that works. + // return false; + // } } From a7fcff6744ee70f194b9b6ed0dfb37a06898fca7 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:44:02 -0600 Subject: [PATCH 25/54] eslint: unused var --- src/sites/twitch-twilight/modules/mod-view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sites/twitch-twilight/modules/mod-view.jsx b/src/sites/twitch-twilight/modules/mod-view.jsx index 58ecfdd9..a933cb8d 100644 --- a/src/sites/twitch-twilight/modules/mod-view.jsx +++ b/src/sites/twitch-twilight/modules/mod-view.jsx @@ -105,7 +105,7 @@ export default class ModView extends Module { const root = this.fine.getReactInstance(el); let channel = null; - const node = this.fine.searchNode(root, n => { + this.fine.searchNode(root, n => { let i = 0; let state = n.memoizedState; while(state != null && channel == null && i < 50) { From a633495f9e19508b6578ecc95525c34a12e52265 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:46:35 -0600 Subject: [PATCH 26/54] eslint: comment out unused methods --- src/sites/twitch-twilight/modules/layout.js | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sites/twitch-twilight/modules/layout.js b/src/sites/twitch-twilight/modules/layout.js index 77325f43..0f854bb3 100644 --- a/src/sites/twitch-twilight/modules/layout.js +++ b/src/sites/twitch-twilight/modules/layout.js @@ -6,7 +6,7 @@ import { IS_FIREFOX } from 'src/utilities/constants'; // ============================================================================ import Module from 'utilities/module'; -import {debounce, has} from 'utilities/object'; +import {debounce} from 'utilities/object'; const PORTRAIT_ROUTES = ['user', 'video', 'user-video', 'user-clip', 'user-videos', 'user-clips', 'user-collections', 'user-events', 'user-followers', 'user-following']; const MINIMAL_ROUTES = ['popout', 'embed-chat', 'dash-chat']; @@ -127,7 +127,7 @@ export default class Layout extends Module { const ratio = size.width / size.height; return ratio <= ctx.get('layout.portrait-threshold'); }, - changed: () => this.updatePortraitMode() + // changed: () => this.updatePortraitMode() }); this.settings.add('layout.inject-portrait', { @@ -184,7 +184,7 @@ export default class Layout extends Module { // TODO: Calculate this based on the expected player height. return true; }, - changed: () => this.updatePortraitMode() + // changed: () => this.updatePortraitMode() }); this.settings.add('layout.portrait-extra-height', { @@ -241,7 +241,7 @@ export default class Layout extends Module { onEnable() { document.body.classList.toggle('ffz--portrait-invert', this.settings.get('layout.portrait-invert')); - this.on(':update-nav', this.updateNavLinks, this); + // this.on(':update-nav', this.updateNavLinks, this); this.on(':resize', this.handleResize, this); this.settings.getChanges('layout.portrait-min-chat', val => this.css_tweaks.toggle('portrait-chat', val)); @@ -440,11 +440,11 @@ export default class Layout extends Module { } }*/ - updateNavLinks() { - - } - - updatePortraitMode() { - - } + // updateNavLinks() { + // + // } + // + // updatePortraitMode() { + // + // } } From 0b22b084e61055bd2764e3388945a52176e378c3 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:50:24 -0600 Subject: [PATCH 27/54] eslint: mixed tabs/spaces; make 2 methods static & update callsites --- .../modules/directory/index.jsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx index e7767d85..2f39d6ba 100644 --- a/src/sites/twitch-twilight/modules/directory/index.jsx +++ b/src/sites/twitch-twilight/modules/directory/index.jsx @@ -671,9 +671,9 @@ export default class Directory extends Module { clearCard(el, for_exp = false) { this.clearUptime(el); - this.clearFlags(el); + this.constructor.clearFlags(el); - const cont = this._getTopRightContainer(el, for_exp); + const cont = this.constructor._getTopRightContainer(el, for_exp); if ( cont ) cont.remove(); @@ -851,16 +851,16 @@ export default class Directory extends Module { updateFlags(el, for_exp = false) { if ( ! document.contains(el) ) - return this.clearFlags(el); + return this.constructor.clearFlags(el); const setting = this.settings.get('directory.show-flags'); if ( ! setting || ! el._ffz_flags?.length ) - return this.clearFlags(el); + return this.constructor.clearFlags(el); - const container = this._getTopRightContainer(el, true, for_exp); + const container = this.constructor._getTopRightContainer(el, true, for_exp); if ( ! container ) - return this.clearFlags(el); + return this.constructor.clearFlags(el); if ( ! el.ffz_flags_el ) container.appendChild(el.ffz_flags_el = (
@@ -874,11 +874,11 @@ export default class Directory extends Module { container.appendChild(el.ffz_flags_el); el.ffz_flags_tt.textContent = `${this.i18n.t('metadata.flags.tooltip', 'Intended for certain audiences. May contain:') - }\n\n${ - el._ffz_flags.map(x => x.localizedName).join('\n')}`; + }\n\n${ + el._ffz_flags.map(x => x.localizedName).join('\n')}`; } - clearFlags(el) { + static clearFlags(el) { if ( el.ffz_flags_el ) { el.ffz_flags_el.remove(); el.ffz_flags_tt = null; @@ -887,7 +887,7 @@ export default class Directory extends Module { } - _getTopRightContainer(el, should_create = true, for_exp = false) { + static _getTopRightContainer(el, should_create = true, for_exp = false) { let cont = el._ffz_top_right ?? el.querySelector('.ffz-top-right'); if ( cont || ! should_create ) return cont; @@ -916,7 +916,7 @@ export default class Directory extends Module { return this.clearUptime(el); const setting = this.settings.get('directory.uptime'), - container = this._getTopRightContainer(el, setting > 0, for_exp); + container = this.constructor._getTopRightContainer(el, setting > 0, for_exp); //const container = el.querySelector('a[data-a-target="preview-card-image-link"] > div'), // setting = this.settings.get('directory.uptime'); From 6c24c109d2e64c2b8ebd7dda7b13456a0b9ebe43 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:54:48 -0600 Subject: [PATCH 28/54] eslint: ref window.ffz instead of just ffz --- src/sites/twitch-twilight/modules/chat/scroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sites/twitch-twilight/modules/chat/scroller.js b/src/sites/twitch-twilight/modules/chat/scroller.js index 28baa649..da4968c5 100644 --- a/src/sites/twitch-twilight/modules/chat/scroller.js +++ b/src/sites/twitch-twilight/modules/chat/scroller.js @@ -729,7 +729,7 @@ export default class Scroller extends Module { cleanMessages(el) { - const react = ffz.site.fine.getReactInstance(el); + const react = window.ffz.site.fine.getReactInstance(el); // Make sure we have the right thing. if (!react || !Array.isArray(react.child?.memoizedProps)) From 42890758921faa21cddf3c29930ab1a4f7749765 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 22:55:49 -0600 Subject: [PATCH 29/54] eslint: unused vars --- src/sites/twitch-twilight/modules/chat/line.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/line.js b/src/sites/twitch-twilight/modules/chat/line.js index 9f0f12d6..6e4ba5e7 100644 --- a/src/sites/twitch-twilight/modules/chat/line.js +++ b/src/sites/twitch-twilight/modules/chat/line.js @@ -12,7 +12,7 @@ import { has } from 'utilities/object'; import { KEYS, RERENDER_SETTINGS, UPDATE_BADGE_SETTINGS, UPDATE_TOKEN_SETTINGS } from 'utilities/constants'; import { print_duration } from 'utilities/time'; -import { getRewardTitle, getRewardCost, isGiantEmoteReward, doesRewardCostBits, isMessageEffect } from './points'; +import { getRewardTitle, getRewardCost, isGiantEmoteReward, doesRewardCostBits } from './points'; import awaitMD, {getMD} from 'utilities/markdown'; const SUB_TIERS = { @@ -41,7 +41,7 @@ export default class ChatLine extends Module { this.line_types = {}; this.line_types.unknown = { - renderNotice: (msg, current_user, room, inst, e) => `Unknown message type: ${msg.ffz_type}` + renderNotice: msg => `Unknown message type: ${msg.ffz_type}` }; this.line_types.notice = { @@ -177,7 +177,7 @@ export default class ChatLine extends Module { }; this.line_types.cheer = { - renderNotice: (msg, current_user, room, inst, e) => this.i18n.tList( + renderNotice: msg => this.i18n.tList( 'chat.bits-message', 'Cheered {count, plural, one {# Bit} other {# Bits}}', { From 5ef600a4b989cef1fe0b279afb3a3ada9487ab3e Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sat, 7 Jun 2025 23:12:17 -0600 Subject: [PATCH 30/54] eslint: unused vars; this-less instance methods converted to class methods --- .../twitch-twilight/modules/chat/input.jsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index d717cc73..0617cf02 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -7,7 +7,7 @@ import Module from 'utilities/module'; import { findReactFragment } from 'utilities/dom'; -import { SourcedSet, getTwitchEmoteSrcSet } from 'utilities/object'; +import { getTwitchEmoteSrcSet } from 'utilities/object'; import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES, REPLACEMENTS, REPLACEMENT_BASE, KEYS } from 'utilities/constants'; import Twilight from 'site'; @@ -355,7 +355,7 @@ export default class Input extends Module { this.ChatInput.on('mount', this.overrideChatInput, this); this.ChatInput.on('mount', this.installPreviewObserver, this); - this.ChatInput.on('unmount', this.removePreviewObserver, this); + this.ChatInput.on('unmount', this.constructor.removePreviewObserver, this); this.EmoteSuggestions.on('mount', this.overrideEmoteMatcher, this); this.MentionSuggestions.on('mount', this.overrideMentionMatcher, this); @@ -461,9 +461,12 @@ export default class Input extends Module { this.updatePreview(inst, target); }*/ - for(const target of node.querySelectorAll?.('img.chat-line__message--emote')) { - if ( target && (target.dataset.ffzId || target.src.startsWith('https://static-cdn.jtvnw.net/emoticons/v2/__FFZ__')) ) - this.updatePreview(inst, target); + const img = node.querySelectorAll?.('img.chat-line__message--emote'); + if ( img !== undefined ) { + for(const target of img) { + if ( target && (target.dataset.ffzId || target.src.startsWith('https://static-cdn.jtvnw.net/emoticons/v2/__FFZ__')) ) + this.updatePreview(inst, target); + } } } @@ -539,7 +542,7 @@ export default class Input extends Module { evt.stopImmediatePropagation(); } - removePreviewObserver(inst) { + static removePreviewObserver(inst) { if ( inst._ffz_preview_observer ) { inst._ffz_preview_observer.disconnect(); inst._ffz_preview_observer = null; @@ -580,8 +583,8 @@ export default class Input extends Module { this.props.emotes.splice(idx, 1, data); else if ( idx !== -1 && ! data ) this.props.emotes.splice(idx, 1); - else - return; + // else + // return; // TODO: Somehow update other React state to deal with our // injected changes. Making a shallow copy of the array @@ -864,7 +867,7 @@ export default class Input extends Module { createElement = React?.createElement; if ( createElement ) - inst.renderCommandSuggestion = function(cmd, input) { + inst.renderCommandSuggestion = function(cmd) { const args = Array.isArray(cmd?.commandArgs) ? cmd.commandArgs.map(arg => (
[{arg.name}]
)) : null; @@ -911,8 +914,6 @@ export default class Input extends Module { if ( ! set || ! set.emotes ) continue; - const source = set.source || 'ffz'; - for(const emote of Object.values(set.emotes)) { if ( ! emote || ! emote.id || ! emote.name || added_emotes.has(emote.name) ) continue; From d6441a7bc5c4bd42bdf6c3d4966f13abe8fcc197 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:08:18 -0600 Subject: [PATCH 31/54] eslint: undeclared vars; unneeded escapes --- src/sites/twitch-twilight/modules/chat/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index 2e7ef426..9aa5e5b4 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -628,7 +628,7 @@ export default class ChatHook extends Module { default: true, ui: { path: 'Chat > Appearance >> Community', - title: 'Allow the \"Chat seems active.\" clip suggestion to be displayed in chat.', + title: 'Allow the "Chat seems active." clip suggestion to be displayed in chat.', component: 'setting-check-box' } }); @@ -1372,7 +1372,8 @@ export default class ChatHook extends Module { }); this.on('chat:pre-send-message', e => { - const msg = e.message, + const t = this, + msg = e.message, inst = e._inst; if ( ! /^\/reconnect ?/i.test(msg) ) @@ -1641,7 +1642,7 @@ export default class ChatHook extends Module { return; t.insertChannelPointMessage(msg); - + } catch(err) { t.log.error('Error handling reward event:', err); @@ -1849,7 +1850,7 @@ export default class ChatHook extends Module { let rewardID; if (isAutomaticReward) - rewardID = `${inst.props.channelID}:${data.reward.reward_type}`; + rewardID = `${service.props.channelID}:${data.reward.reward_type}`; else rewardID = data.reward.id; @@ -1910,7 +1911,7 @@ export default class ChatHook extends Module { return true; if ( type === 'megacheer_emote_recipient' && - ! t.chat.context.get('chat.bits.show-rewards') + ! this.chat.context.get('chat.bits.show-rewards') ) return true; @@ -3662,7 +3663,7 @@ export default class ChatHook extends Module { let count = 0; if (bd) { for(const entry of bd.values()) { - for(const _ of entry.values()) { + for(const _ of entry.values()) { // eslint-disable-line no-unused-vars count++; } } From 30dda9ef64dc31c3c9c710f3f5baa032a50939d2 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:15:43 -0600 Subject: [PATCH 32/54] eslint: unused vars; instance method => static method; mixed tabs/spaces --- .../modules/chat/emote_menu.jsx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx index e6acea32..a92339e9 100644 --- a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx +++ b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx @@ -462,9 +462,9 @@ export default class EmoteMenu extends Module { this._ffz_no_scan = false; if ( ! this.props || - this.props.emotePickerSource === 'bits-rewards' || - ! has(this.props, 'channelID') || - ! t.chat.context.get('chat.emote-menu.enabled') + this.props.emotePickerSource === 'bits-rewards' || + ! has(this.props, 'channelID') || + ! t.chat.context.get('chat.emote-menu.enabled') ) { return old_render.call(this); } @@ -980,8 +980,8 @@ export default class EmoteMenu extends Module { if ( ! data.all_locked || ! data.locks ) return null; - let lock = data.locks[this.state.unlocked], - locks = Object.values(data.locks).filter(x => x.id !== 'cheer'), + let lock = data.locks[this.state.unlocked]; + const locks = Object.values(data.locks).filter(x => x.id !== 'cheer'), has_ffz = locks.filter(x => x.is_ffz).length > 0; if ( ! lock && data.locks.length === 1 ) @@ -1792,11 +1792,11 @@ export default class EmoteMenu extends Module { const state = Object.assign({}, old_state), data = state.set_data || {}, - modifiers = state.emote_modifiers = {}, channel = state.channel_sets = [], all = state.all_sets = [], effects = state.effect_sets = [], favorites = state.favorites = []; + state.emote_modifiers = {}; // If we're still loading, don't set any data. if ( props.loading || props.error || state.loading ) @@ -2344,8 +2344,8 @@ export default class EmoteMenu extends Module { } let wants_resub_info = false, - wants_plan_info = false, has_new_effects = false; + const wants_plan_info = false; const unlocked_effects = [...t.settings.provider.get('unlocked-effects', [])]; @@ -2395,7 +2395,7 @@ export default class EmoteMenu extends Module { section.emotes.sort(sort_emotes); if ( use_effect_tab && ! effects.includes(section) && section.has_effects ) { - has_new_effects = this.checkNewEffects(section.emotes, unlocked_effects) || has_new_effects; + has_new_effects = this.constructor.checkNewEffects(section.emotes, unlocked_effects) || has_new_effects; effects.push(section); } else if ( ! all.includes(section) ) all.push(section); @@ -2414,7 +2414,7 @@ export default class EmoteMenu extends Module { section.emotes.sort(sort_emotes); if ( use_effect_tab && ! effects.includes(section) && section.has_effects ) { - has_new_effects = this.checkNewEffects(section.emotes, unlocked_effects) || has_new_effects; + has_new_effects = this.constructor.checkNewEffects(section.emotes, unlocked_effects) || has_new_effects; effects.push(section); } else if ( ! all.includes(section) ) @@ -2454,7 +2454,7 @@ export default class EmoteMenu extends Module { } - checkNewEffects(emotes, unlocked) { + static checkNewEffects(emotes, unlocked) { let added = false; for(const emote of emotes) { if ( emote && ! emote.locked && emote.id && emote.provider === 'ffz' && ! unlocked.includes(emote.id) ) { @@ -2696,7 +2696,7 @@ export default class EmoteMenu extends Module { if ( ! loading ) this.loadedOnce = true; - let tab, sets, is_emoji, is_favs, is_effect; + let tab, sets, is_emoji, is_favs; if ( no_tabs ) { sets = [ @@ -2714,7 +2714,6 @@ export default class EmoteMenu extends Module { is_emoji = tab === 'emoji'; is_favs = tab === 'fav'; - is_effect = tab === 'effect'; switch(tab) { case 'fav': From 165c29f9f8ab25a6b085203723aebb9a91735298 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:43:46 -0600 Subject: [PATCH 33/54] eslint: unnecessary escape --- src/sites/twitch-twilight/modules/channel.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sites/twitch-twilight/modules/channel.jsx b/src/sites/twitch-twilight/modules/channel.jsx index 1a3553cc..1768ef62 100644 --- a/src/sites/twitch-twilight/modules/channel.jsx +++ b/src/sites/twitch-twilight/modules/channel.jsx @@ -521,7 +521,7 @@ export default class Channel extends Module { // is actually a static string. if ( typeof c === 'string' && /^[0-9,.]+$/.test(c) ) { try { - const val = parseInt(c.replace(/[\.,]+/, ''), 10); + const val = parseInt(c.replace(/[.,]+/, ''), 10); if ( ! isNaN(val) && isFinite(val) && val > 0 ) return val; } catch(err) { /* no-op */ } From a04697b1d206f6be35b4f52e25937e3e8e86151a Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:43:54 -0600 Subject: [PATCH 34/54] eslint: unused var; undefined var; empty block --- src/sites/shared/player.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sites/shared/player.jsx b/src/sites/shared/player.jsx index 9d1fa415..fb2f4184 100644 --- a/src/sites/shared/player.jsx +++ b/src/sites/shared/player.jsx @@ -1418,7 +1418,6 @@ export default class PlayerBase extends Module { else { input = cont.querySelector('input'); fill = cont.querySelector('.ffz--gain-value'); - tipcont = cont.querySelector('.ffz-il-tooltip'); tip = cont.querySelector('.ffz-il-tooltip .ffz--p-tip'); extra = cont.querySelector('.ffz-il-tooltip .ffz--p-value'); } @@ -1550,7 +1549,7 @@ export default class PlayerBase extends Module { this.replaceVideoElement(player, video); } } catch(err) { - t.log.error('Error while handling player load.', err); + this.log.error('Error while handling player load.', err); } return player._ffz_load(...args); @@ -1769,7 +1768,7 @@ export default class PlayerBase extends Module { try { ctx.addEventListener('statechange', evt); ctx.resume(); - } catch(err) { } + } catch(err) { null } return; } From 91ce4a51005442e0a0a64b0639bfb938d640d38d Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:50:36 -0600 Subject: [PATCH 35/54] eslint: unused var --- src/modules/chat/link_providers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/chat/link_providers.js b/src/modules/chat/link_providers.js index ec6589f4..530d249d 100644 --- a/src/modules/chat/link_providers.js +++ b/src/modules/chat/link_providers.js @@ -359,8 +359,7 @@ export const Video = { if ( ! result || ! result.data || ! result.data.video || ! result.data.video.owner ) return null; - const video = result.data.video, - game = video.game; + const video = result.data.video; const fragments = { title: video.title, From a5cc8c06b5ffaa659f43685d0c68d4e65b84ba02 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 00:50:50 -0600 Subject: [PATCH 36/54] eslint: unnecessary escape --- src/modules/chat/tokenizers.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index 16a68fa6..ce4768f0 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -23,7 +23,7 @@ const SHRINK_X = MODIFIER_FLAGS.ShrinkX, const EMOTE_CLASS = 'chat-image chat-line__message--emote', //WHITESPACE = /^\s*$/, //LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g, - NEW_LINK_REGEX = /(?:(https?:\/\/)?((?:[\w#%\-+=:~]+\.)+[a-z]{2,10}(?:\/[\w./#%&@()\-+=:?~]*[^\s\.!,?])?))/g, + NEW_LINK_REGEX = /(?:(https?:\/\/)?((?:[\w#%\-+=:~]+\.)+[a-z]{2,10}(?:\/[\w./#%&@()\-+=:?~]*[^\s.!,?])?))/g, //OLD_NEW_LINK_REGEX = /(?:(https?:\/\/)?((?:[\w#%\-+=:~]+\.)+[a-z]{2,10}(?:\/[\w./#%&@()\-+=:?~]*)?))/g, //MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)(?:\b|$)/; // eslint-disable-line no-control-regex From ec6969aeb7833ecf35ace8aaccdf247325936384 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:11:01 -0600 Subject: [PATCH 37/54] eslint: unused import --- src/modules/link_card/index.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/link_card/index.jsx b/src/modules/link_card/index.jsx index f5de8f3e..45b2f460 100644 --- a/src/modules/link_card/index.jsx +++ b/src/modules/link_card/index.jsx @@ -6,7 +6,6 @@ import { createElement } from 'utilities/dom'; import { getDialogNextZ } from 'utilities/dialog'; -import { deep_copy } from 'utilities/object'; import Module from 'utilities/module'; @@ -197,4 +196,4 @@ export default class LinkCard extends Module { return child; } -} \ No newline at end of file +} From 0b21c72b30e4e8a766901091d688949424f3b5bf Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:11:50 -0600 Subject: [PATCH 38/54] eslint: unnecessary escape; prefer const --- src/modules/main_menu/components/changelog.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/main_menu/components/changelog.vue b/src/modules/main_menu/components/changelog.vue index 7833a54b..ac0eed85 100644 --- a/src/modules/main_menu/components/changelog.vue +++ b/src/modules/main_menu/components/changelog.vue @@ -149,7 +149,7 @@ import {get} from 'utilities/object'; -const TITLE_MATCH = /^(.+?)?\s*v?(\d+\.\d+\.\d+(?:\-[a-z0-9-]+)?)$/i, +const TITLE_MATCH = /^(.+?)?\s*v?(\d+\.\d+\.\d+(?:-[a-z0-9-]+)?)$/i, SETTING_REGEX = /\]\(~([^)]+)\)/g, CHANGE_REGEX = /^\*\s*([^:]+?):\s*(.+)$/i, ISSUE_REGEX = /(^|\s)#(\d+)\b/g; @@ -186,13 +186,13 @@ export default { old_commit = this.t('home.changelog.nonversioned', 'Non-Versioned Commit'); for(const commit of this.commits) { - const input = commit.commit.message; + const input = commit.commit.message, + sections = {}; let title = old_commit, title_nav = null, icon = null, version = null, author = null, - sections = {}, description = []; if ( /\bskiplog\b/i.test(input) && ! this.nonversion ) @@ -384,4 +384,4 @@ export default { } } } - \ No newline at end of file + From c9e04b78d4ab0a56f0f200c330b5125b2f4b3f3d Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:12:05 -0600 Subject: [PATCH 39/54] eslint: allow alert() from the chat tester --- src/modules/main_menu/components/chat-tester.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/main_menu/components/chat-tester.vue b/src/modules/main_menu/components/chat-tester.vue index d50d41ac..e5bf765f 100644 --- a/src/modules/main_menu/components/chat-tester.vue +++ b/src/modules/main_menu/components/chat-tester.vue @@ -597,7 +597,7 @@ export default { data = JSON.parse(this.message); } catch(err) { console.error(err); - alert('Unable to parse message.'); + alert('Unable to parse message.'); // eslint-disable-line no-alert -- this is a dev tool return; } @@ -620,7 +620,7 @@ export default { } catch (err) { console.error(err); - alert('Unable to parse message.'); + alert('Unable to parse message.'); // eslint-disable-line no-alert -- this is a dev tool return; } } From 52747bfee1003bc8fcbb57b9c31185c2ea883726 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:12:19 -0600 Subject: [PATCH 40/54] eslint: unused import; unused var --- src/modules/main_menu/components/emote-priorities.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modules/main_menu/components/emote-priorities.vue b/src/modules/main_menu/components/emote-priorities.vue index 069e4bae..3f391cb9 100644 --- a/src/modules/main_menu/components/emote-priorities.vue +++ b/src/modules/main_menu/components/emote-priorities.vue @@ -83,9 +83,6 @@ import settingMixin from '../setting-mixin'; import Sortable from 'sortablejs'; -import { deep_copy } from 'utilities/object'; - -const last_id = 0; export default { mixins: [settingMixin], From de5745c0c33dc6348c726b079d480a7cdb30f6c0 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:12:29 -0600 Subject: [PATCH 41/54] eslint: unused imports --- src/modules/main_menu/components/home-page.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modules/main_menu/components/home-page.vue b/src/modules/main_menu/components/home-page.vue index 4bf58fdb..e6972568 100644 --- a/src/modules/main_menu/components/home-page.vue +++ b/src/modules/main_menu/components/home-page.vue @@ -213,9 +213,6 @@ import HOME_MD from '../home.md'; -import {createElement as e} from 'utilities/dom'; -import { EXTENSION } from 'utilities/constants'; - export default { props: ['item', 'context'], From 9f532c3359841fb896983608fa9515a14852c029 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:12:35 -0600 Subject: [PATCH 42/54] eslint: unnecessary escape --- src/modules/main_menu/components/main-menu.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/main_menu/components/main-menu.vue b/src/modules/main_menu/components/main-menu.vue index 7c2b919b..d6ff0d6a 100644 --- a/src/modules/main_menu/components/main-menu.vue +++ b/src/modules/main_menu/components/main-menu.vue @@ -147,7 +147,7 @@ export default { let query = this.query.toLowerCase(); let flags = new Set; - query = query.replace(/(?<=^|\s)@(\S+)(?:\s+|$)/g, (match, flag, index) => { + query = query.replace(/(?<=^|\s)@(\S+)(?:\s+|$)/g, (match, flag) => { if ( VALID_FLAGS.includes(flag) ) { flags.add(flag); return ''; @@ -349,4 +349,4 @@ export default { } } } - \ No newline at end of file + From f609d72ea7388c1635843c176e34d305bfd14cfd Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:12:47 -0600 Subject: [PATCH 43/54] eslint: reference window.ffzSimplebar instead of ffzSimplebar --- src/modules/main_menu/components/profile-selector.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/main_menu/components/profile-selector.vue b/src/modules/main_menu/components/profile-selector.vue index d56ec0ff..aba5b815 100644 --- a/src/modules/main_menu/components/profile-selector.vue +++ b/src/modules/main_menu/components/profile-selector.vue @@ -132,7 +132,7 @@ export default { if (!scroller || ! window.ffzSimplebar || scroller.SimpleBar) return; - new ffzSimplebar(scroller, ffzSimplebar.getElOptions(scroller)); + new window.ffzSimplebar(scroller, window.ffzSimplebar.getElOptions(scroller)); }, openConfigure() { @@ -268,4 +268,4 @@ export default { } } - \ No newline at end of file + From 561af6ce223de5527da1231839443ea98e13946d Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:13:06 -0600 Subject: [PATCH 44/54] eslint: unused import --- src/modules/main_menu/components/rich-feed.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/main_menu/components/rich-feed.vue b/src/modules/main_menu/components/rich-feed.vue index 78f483db..6218fd5f 100644 --- a/src/modules/main_menu/components/rich-feed.vue +++ b/src/modules/main_menu/components/rich-feed.vue @@ -11,8 +11,6 @@ \ No newline at end of file + From 7e55133d2099dfcd6f8558cfeff141e3cdabdc45 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:13:34 -0600 Subject: [PATCH 46/54] eslint: unused import --- src/modules/main_menu/components/tooltip-tos.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/main_menu/components/tooltip-tos.vue b/src/modules/main_menu/components/tooltip-tos.vue index 1b01196e..86e57764 100644 --- a/src/modules/main_menu/components/tooltip-tos.vue +++ b/src/modules/main_menu/components/tooltip-tos.vue @@ -33,7 +33,6 @@ \ No newline at end of file + From fc19bc355430dd67b03a914f4543ca79a0f6d83f Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:13:54 -0600 Subject: [PATCH 48/54] eslint: unused import --- src/modules/translation_ui/components/translation-ui.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/translation_ui/components/translation-ui.vue b/src/modules/translation_ui/components/translation-ui.vue index c829bad8..ad5a45a4 100644 --- a/src/modules/translation_ui/components/translation-ui.vue +++ b/src/modules/translation_ui/components/translation-ui.vue @@ -232,7 +232,7 @@ import displace from 'displacejs'; import Parser from '@ffz/icu-msgparser'; import { saveAs } from 'file-saver'; -import { deep_equals, deep_copy, sleep } from 'utilities/object'; +import { deep_equals, deep_copy } from 'utilities/object'; const parser = new Parser(); const PER_PAGE = 20; @@ -551,4 +551,4 @@ export default { }, } } - \ No newline at end of file + From 4fc3c58536efaceb2d93ef1f07599a63196aacc5 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:14:13 -0600 Subject: [PATCH 49/54] eslint: redeclared / unused global in ravenjs --- src/raven.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/raven.js b/src/raven.js index c9a76cdc..057016c1 100644 --- a/src/raven.js +++ b/src/raven.js @@ -1,7 +1,5 @@ 'use strict'; -/* global FrankerFaceZ: false */ - // ============================================================================ // Raven Logging // ============================================================================ From 62cc376f9f7376704101d67620b8a98ab6ae6464 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:14:30 -0600 Subject: [PATCH 50/54] eslint: unused import --- src/sites/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sites/base.js b/src/sites/base.js index af5b3ced..b11de1df 100644 --- a/src/sites/base.js +++ b/src/sites/base.js @@ -1,6 +1,6 @@ 'use strict'; -import Module, { GenericModule } from 'utilities/module'; +import Module from 'utilities/module'; let last_site = 0; let last_call = 0; From b8eb8fdb0473130d3549ba0e5fdb6ed87a151c44 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:14:41 -0600 Subject: [PATCH 51/54] eslint: unused import; allow no-unused-vars in commented function --- src/sites/clips/theme.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sites/clips/theme.js b/src/sites/clips/theme.js index 423c87c7..661756fb 100644 --- a/src/sites/clips/theme.js +++ b/src/sites/clips/theme.js @@ -5,7 +5,6 @@ // ============================================================================ import Module from 'utilities/module'; -import {createElement} from 'utilities/dom'; import {Color} from 'utilities/color'; //import THEME_CSS from 'site/styles/theme.scss'; @@ -412,7 +411,7 @@ export default class ThemeEngine extends Module { this.css_tweaks.delete('accent-normal'); } - toggleNormalizer(enable) { // eslint-disable-line class-methods-use-this + toggleNormalizer(enable) { // eslint-disable-line class-methods-use-this, no-unused-vars // Intentionally disabled~ /*if ( ! this._normalizer ) { if ( ! enable ) @@ -461,4 +460,4 @@ export default class ThemeEngine extends Module { this.updateCSS(); this.updateFont(); } -} \ No newline at end of file +} From 16478b3e1d7e28cd45ab207ba224114d1fbae736 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 01:15:04 -0600 Subject: [PATCH 52/54] eslint: unused vars; undeclared t --- src/sites/shared/player.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sites/shared/player.jsx b/src/sites/shared/player.jsx index fb2f4184..9277d491 100644 --- a/src/sites/shared/player.jsx +++ b/src/sites/shared/player.jsx @@ -2057,7 +2057,7 @@ export default class PlayerBase extends Module { if ( ! cont ) { // We need the native clip button, so we can dispatch a click. - const on_click = e => { + const on_click = () => { const native = getNativeClipButton(container); if (native) native.click(); @@ -2187,7 +2187,8 @@ export default class PlayerBase extends Module { addErrorResetButton(inst, tries = 0) { const outer = inst.props.containerRef || this.fine.getChildNode(inst), container = outer && outer.querySelector('.content-overlay-gate'), - has_reset = this.settings.get('player.button.reset'); + has_reset = this.settings.get('player.button.reset'), + t = this; if ( ! container ) { if ( ! has_reset ) @@ -2383,7 +2384,7 @@ export default class PlayerBase extends Module { } - getUptime(inst) { + getUptime() { // TODO: Support multiple instances. const source = this.getData(), user = source?.props?.data?.user; From d7726f407229f1758c9b4da03112235e9d8a9fa4 Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 14:10:04 -0600 Subject: [PATCH 53/54] eslint: disable vue/prop-name-casing for now until i can learn more about vue & get more info on the future of vue in this project --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 1d367113..4d8c6e77 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -127,6 +127,7 @@ module.exports = { 'vue/require-prop-types': 'off', 'vue/require-default-prop': 'off', 'vue/no-mutating-props': 'off', // TODO: all these + 'vue/prop-name-casing': 'off', // TODO: do we need this? 'vue/html-closing-bracket-newline': [ 'error', { From 52ca7ecf424ec6e30ce06edcc2487e0d28dbf19c Mon Sep 17 00:00:00 2001 From: lemonslut Date: Sun, 8 Jun 2025 14:12:25 -0600 Subject: [PATCH 54/54] eslint: disable one line of no unused vars & leave TODO comment --- src/modules/main_menu/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/main_menu/index.js b/src/modules/main_menu/index.js index 42c64ff8..20d343f2 100644 --- a/src/modules/main_menu/index.js +++ b/src/modules/main_menu/index.js @@ -1186,7 +1186,9 @@ export default class MainMenu extends Module { key = params?.get('ffz-settings'); current = key && settings.keys[key]; if ( ! current ) - restored = false; + restored = false; // eslint-disable-line no-unused-vars + // TODO: `restored` isn't used after this, but we go through + // a lot of effort to set it; do we need to? } if ( ! current ) current = this.has_update ?