diff --git a/eslint.config.mjs b/eslint.config.mjs index 1c496830f5957..c6cd888df9127 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -78,6 +78,12 @@ export default [ 'vue/multi-word-component-names': 'off', 'vuejs-accessibility/no-onchange': 'off', + // rule for Vue 3.x , FT is on 2.x + 'vue/no-v-for-template-key-on-child': 'off', + 'vue/no-v-for-template-key': 'error', + // To be fixed on Vue 3 migration + 'vue/no-deprecated-v-on-native-modifier': 'warn', + 'vuejs-accessibility/label-has-for': ['error', { required: { some: ['nesting', 'id'], diff --git a/src/main/index.js b/src/main/index.js index 92ce4f9ae01cc..e85945afe20b5 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -455,7 +455,7 @@ function runApp() { requestHeaders.Authorization = invidiousAuthorization.authorization } } - // eslint-disable-next-line n/no-callback-literal + callback({ requestHeaders }) }) @@ -466,7 +466,7 @@ function runApp() { if (responseHeaders) { delete responseHeaders['set-cookie'] } - // eslint-disable-next-line n/no-callback-literal + callback({ responseHeaders }) }) @@ -755,7 +755,7 @@ function runApp() { // If called multiple times // Duplicate menu items will be added if (replaceMainWindow) { - // eslint-disable-next-line + setMenu() } diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.js b/src/renderer/components/ft-icon-button/ft-icon-button.js index 6c12092874425..76f9bfe416ee2 100644 --- a/src/renderer/components/ft-icon-button/ft-icon-button.js +++ b/src/renderer/components/ft-icon-button/ft-icon-button.js @@ -79,7 +79,7 @@ export default defineComponent({ window.addEventListener('resize', this.handleResize) } }, - beforeDestroy: function () { + beforeUnmount: function () { if (this.dropdownModalOnMobile) { window.removeEventListener('resize', this.handleResize) } diff --git a/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js b/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js index 09fb1a20fcc95..600502d5fa8f8 100644 --- a/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js +++ b/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js @@ -240,7 +240,7 @@ export default defineComponent({ // User might want to search first if they have many playlists nextTick(() => this.$refs.searchBar.focus()) }, - beforeDestroy() { + beforeUnmount() { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/components/ft-prompt/ft-prompt.js b/src/renderer/components/ft-prompt/ft-prompt.js index c112cd786f198..cd42056a8e94b 100644 --- a/src/renderer/components/ft-prompt/ft-prompt.js +++ b/src/renderer/components/ft-prompt/ft-prompt.js @@ -66,7 +66,7 @@ export default defineComponent({ this.focusItem(0) }) }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.closeEventFunction, true) nextTick(() => this.lastActiveElement?.focus()) }, diff --git a/src/renderer/components/ft-toast/ft-toast.js b/src/renderer/components/ft-toast/ft-toast.js index 15697ca25061d..2e10dcfc6ea6d 100644 --- a/src/renderer/components/ft-toast/ft-toast.js +++ b/src/renderer/components/ft-toast/ft-toast.js @@ -13,7 +13,7 @@ export default defineComponent({ mounted: function () { FtToastEvents.addEventListener('toast-open', this.open) }, - beforeDestroy: function () { + beforeUnmount: function () { FtToastEvents.removeEventListener('toast-open', this.open) }, methods: { diff --git a/src/renderer/components/general-settings/general-settings.js b/src/renderer/components/general-settings/general-settings.js index b7d0f60bd7b10..176dfde0b1904 100644 --- a/src/renderer/components/general-settings/general-settings.js +++ b/src/renderer/components/general-settings/general-settings.js @@ -206,7 +206,7 @@ export default defineComponent({ this.setCurrentInvidiousInstanceBounce = debounce(this.setCurrentInvidiousInstance, 500) }, - beforeDestroy: function () { + beforeUnmount: function () { if (this.currentInvidiousInstance === '') { // FIXME: If we call an action from here, there's no guarantee it will finish // before the component is destroyed, which could bring up some problems diff --git a/src/renderer/components/playlist-info/playlist-info.js b/src/renderer/components/playlist-info/playlist-info.js index 6f9ff99bcfd99..243634bb805b1 100644 --- a/src/renderer/components/playlist-info/playlist-info.js +++ b/src/renderer/components/playlist-info/playlist-info.js @@ -339,7 +339,7 @@ export default defineComponent({ mounted: function () { document.addEventListener('keydown', this.keyboardShortcutHandler) }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/components/proxy-settings/proxy-settings.js b/src/renderer/components/proxy-settings/proxy-settings.js index 901ca21d88bf0..11403432ce711 100644 --- a/src/renderer/components/proxy-settings/proxy-settings.js +++ b/src/renderer/components/proxy-settings/proxy-settings.js @@ -83,7 +83,7 @@ export default defineComponent({ created: function () { this.debounceEnableProxy = debounce(this.enableProxy, 200) }, - beforeDestroy: function () { + beforeUnmount: function () { if (this.proxyHostname === '') { this.updateProxyHostname('127.0.0.1') } diff --git a/src/renderer/components/subscriptions-tab-ui/subscriptions-tab-ui.js b/src/renderer/components/subscriptions-tab-ui/subscriptions-tab-ui.js index 489d928f383e0..adcaa67f001df 100644 --- a/src/renderer/components/subscriptions-tab-ui/subscriptions-tab-ui.js +++ b/src/renderer/components/subscriptions-tab-ui/subscriptions-tab-ui.js @@ -92,7 +92,7 @@ export default defineComponent({ mounted: function () { document.addEventListener('keydown', this.keyboardShortcutHandler) }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js b/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js index 973eaddc551a9..6beede5272645 100644 --- a/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js +++ b/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js @@ -88,7 +88,7 @@ export default defineComponent({ return this.watchingCount !== null ? formatNumber(this.watchingCount) : '0' } }, - beforeDestroy: function () { + beforeUnmount: function () { this.hasEnded = true this.liveChatInstance?.stop() this.liveChatInstance = null diff --git a/src/renderer/components/watch-video-playlist/watch-video-playlist.js b/src/renderer/components/watch-video-playlist/watch-video-playlist.js index bfe449b6eb0ec..5cdc7ab4de7f0 100644 --- a/src/renderer/components/watch-video-playlist/watch-video-playlist.js +++ b/src/renderer/components/watch-video-playlist/watch-video-playlist.js @@ -218,7 +218,7 @@ export default defineComponent({ navigator.mediaSession.setActionHandler('nexttrack', this.playNextVideo) } }, - beforeDestroy: function () { + beforeUnmount: function () { if ('mediaSession' in navigator) { navigator.mediaSession.setActionHandler('previoustrack', null) navigator.mediaSession.setActionHandler('nexttrack', null) diff --git a/src/renderer/views/History/History.js b/src/renderer/views/History/History.js index 9432541a141de..a4b374155405c 100644 --- a/src/renderer/views/History/History.js +++ b/src/renderer/views/History/History.js @@ -88,7 +88,7 @@ export default defineComponent({ this.filterHistoryDebounce = debounce(this.filterHistory, 500) }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/views/Playlist/Playlist.js b/src/renderer/views/Playlist/Playlist.js index 8121a626f09b6..07e1f4dbab145 100644 --- a/src/renderer/views/Playlist/Playlist.js +++ b/src/renderer/views/Playlist/Playlist.js @@ -265,7 +265,7 @@ export default defineComponent({ this.handleResize() window.addEventListener('resize', this.handleResize) }, - beforeDestroy: function () { + beforeUnmount: function () { window.removeEventListener('resize', this.handleResize) }, methods: { diff --git a/src/renderer/views/Popular/Popular.js b/src/renderer/views/Popular/Popular.js index 2a35f9d8cb68d..0e87683febcfc 100644 --- a/src/renderer/views/Popular/Popular.js +++ b/src/renderer/views/Popular/Popular.js @@ -40,7 +40,7 @@ export default defineComponent({ this.fetchPopularInfo() } }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/views/SubscribedChannels/SubscribedChannels.js b/src/renderer/views/SubscribedChannels/SubscribedChannels.js index b4410831dd8cf..f9166504bb647 100644 --- a/src/renderer/views/SubscribedChannels/SubscribedChannels.js +++ b/src/renderer/views/SubscribedChannels/SubscribedChannels.js @@ -82,7 +82,7 @@ export default defineComponent({ document.addEventListener('keydown', this.keyboardShortcutHandler) this.getSubscription() }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/views/Trending/Trending.js b/src/renderer/views/Trending/Trending.js index 533f9cf8b56e5..8e7eabc4aa86c 100644 --- a/src/renderer/views/Trending/Trending.js +++ b/src/renderer/views/Trending/Trending.js @@ -55,7 +55,7 @@ export default defineComponent({ this.getTrendingInfo() } }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: { diff --git a/src/renderer/views/UserPlaylists/UserPlaylists.js b/src/renderer/views/UserPlaylists/UserPlaylists.js index 053d0b50421b2..28a870c5bb38a 100644 --- a/src/renderer/views/UserPlaylists/UserPlaylists.js +++ b/src/renderer/views/UserPlaylists/UserPlaylists.js @@ -201,7 +201,7 @@ export default defineComponent({ this.filterPlaylistDebounce = debounce(this.filterPlaylist, 500) }, - beforeDestroy: function () { + beforeUnmount: function () { document.removeEventListener('keydown', this.keyboardShortcutHandler) }, methods: {