Skip to content

Commit

Permalink
Define emits before using them (#4973)
Browse files Browse the repository at this point in the history
Co-authored-by: absidue <[email protected]>
  • Loading branch information
ChunkyProgrammer and absidue authored Apr 17, 2024
1 parent 8483c8e commit 2bc44cd
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ module.exports = {
ignoreText: ['-', '•', '/', 'YouTube', 'Invidious', 'FreeTube']
}
],
'vue/require-explicit-emits': 'error',
'vue/no-unused-emit-declarations': 'error',
},
settings: {
'vue-i18n': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineComponent } from 'vue'

export default defineComponent({
name: 'FtAutoLoadNextPageWrapper',
emits: ['load-next-page'],
computed: {
generalAutoLoadMorePaginatedItemsEnabled() {
return this.$store.getters.getGeneralAutoLoadMorePaginatedItemsEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
selected: false
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-icon-button/ft-icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
dropdownShown: false,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-input-tags/ft-input-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-input/ft-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default defineComponent({
default: ''
}
},
emits: ['clear', 'click', 'input'],
data: function () {
let actionIcon = ['fas', 'search']
if (this.forceActionButtonIconName !== null) {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default defineComponent({
default: false,
},
},
emits: ['pause-player'],
data: function () {
return {
id: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineComponent({
required: true
}
},
emits: ['click'],
methods: {
handleClick: function (response) {
this.$emit('click', response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineComponent({
required: true,
},
},
emits: ['selected'],
data: function () {
return {
title: '',
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-profile-edit/ft-profile-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default defineComponent({
required: true
}
},
emits: ['new-profile-created', 'profile-deleted'],
data: function () {
return {
showDeletePrompt: false,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-prompt/ft-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default defineComponent({
default: false
}
},
emits: ['click'],
data: function () {
return {
promptButtons: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineComponent({
'ft-flex-box': FtFlexBox,
'ft-radio-button': FtRadioButton
},
emits: ['filterValueUpdated'],
data: function () {
return {
sortByValues: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineComponent({
default: ''
}
},
emits: ['timestamp-event'],
methods: {
catchTimestampClick: function (event) {
this.$emit('timestamp-event', event.detail)
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default defineComponent({
default: 100
}
},
emits: ['refresh'],
data: function () {
return {
dataLimit: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default defineComponent({
required: true
}
},
emits: ['timestamp-event'],
data: function () {
return {
showChapters: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default defineComponent({
default: null,
},
},
emits: ['timestamp-event'],
data: function () {
return {
isLoading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineComponent({
default: ''
}
},
emits: ['timestamp-event'],
data: function () {
return {
shownDescription: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bc44cd

Please sign in to comment.