Define emits before using them (#4973)

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
This commit is contained in:
ChunkyProgrammer 2024-04-17 17:50:23 -04:00 committed by GitHub
parent 8483c8e3f8
commit 2bc44cd66b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 21 additions and 0 deletions

View File

@ -112,6 +112,8 @@ module.exports = {
ignoreText: ['-', '•', '/', 'YouTube', 'Invidious', 'FreeTube']
}
],
'vue/require-explicit-emits': 'error',
'vue/no-unused-emit-declarations': 'error',
},
settings: {
'vue-i18n': {

View File

@ -2,6 +2,7 @@ import { defineComponent } from 'vue'
export default defineComponent({
name: 'FtAutoLoadNextPageWrapper',
emits: ['load-next-page'],
computed: {
generalAutoLoadMorePaginatedItemsEnabled() {
return this.$store.getters.getGeneralAutoLoadMorePaginatedItemsEnabled

View File

@ -20,6 +20,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
selected: false

View File

@ -61,6 +61,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
dropdownShown: false,

View File

@ -53,6 +53,7 @@ export default defineComponent({
default: (_) => ({ preferredName: '', icon: '' }),
}
},
emits: ['already-exists', 'change', 'error-find-tag-info', 'invalid-name'],
methods: {
updateTags: async function (text, _e) {
if (this.areChannelTags) {

View File

@ -64,6 +64,7 @@ export default defineComponent({
default: ''
}
},
emits: ['clear', 'click', 'input'],
data: function () {
let actionIcon = ['fas', 'search']
if (this.forceActionButtonIconName !== null) {

View File

@ -84,6 +84,7 @@ export default defineComponent({
default: false,
},
},
emits: ['pause-player'],
data: function () {
return {
id: '',

View File

@ -8,6 +8,7 @@ export default defineComponent({
required: true
}
},
emits: ['click'],
methods: {
handleClick: function (response) {
this.$emit('click', response)

View File

@ -25,6 +25,7 @@ export default defineComponent({
required: true,
},
},
emits: ['selected'],
data: function () {
return {
title: '',

View File

@ -32,6 +32,7 @@ export default defineComponent({
required: true
}
},
emits: ['new-profile-created', 'profile-deleted'],
data: function () {
return {
showDeletePrompt: false,

View File

@ -38,6 +38,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
promptButtons: [],

View File

@ -8,6 +8,7 @@ export default defineComponent({
'ft-flex-box': FtFlexBox,
'ft-radio-button': FtRadioButton
},
emits: ['filterValueUpdated'],
data: function () {
return {
sortByValues: [

View File

@ -8,6 +8,7 @@ export default defineComponent({
default: ''
}
},
emits: ['timestamp-event'],
methods: {
catchTimestampClick: function (event) {
this.$emit('timestamp-event', event.detail)

View File

@ -117,6 +117,7 @@ export default defineComponent({
default: false
}
},
emits: ['ended', 'error', 'ready', 'store-caption-list', 'timeupdate', 'toggle-theatre-mode'],
data: function () {
return {
powerSaveBlocker: null,

View File

@ -96,6 +96,7 @@ export default defineComponent({
required: true,
},
},
emits: ['enter-edit-mode', 'exit-edit-mode', 'search-video-query-change'],
data: function () {
return {
searchVideoMode: false,

View File

@ -47,6 +47,7 @@ export default defineComponent({
default: 100
}
},
emits: ['refresh'],
data: function () {
return {
dataLimit: 100,

View File

@ -16,6 +16,7 @@ export default defineComponent({
required: true
}
},
emits: ['timestamp-event'],
data: function () {
return {
showChapters: false,

View File

@ -37,6 +37,7 @@ export default defineComponent({
default: null,
},
},
emits: ['timestamp-event'],
data: function () {
return {
isLoading: false,

View File

@ -19,6 +19,7 @@ export default defineComponent({
default: ''
}
},
emits: ['timestamp-event'],
data: function () {
return {
shownDescription: ''

View File

@ -104,6 +104,7 @@ export default defineComponent({
required: true
}
},
emits: ['set-info-area-sticky', 'scroll-to-info-area', 'pause-player'],
computed: {
hideSharingActions: function() {
return this.$store.getters.getHideSharingActions