From 896bac5f833e10c455acfa47220e0403af6756d5 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Wed, 7 May 2025 13:37:23 +0200 Subject: [PATCH] Changed defineEmits to be more legible --- components/calendar/category/TableRow.vue | 2 +- components/calendar/form/Create.vue | 8 +++----- components/calendar/form/Update.vue | 8 +++----- components/calendar/search/lists/CharacterCallout.vue | 2 +- components/calendar/search/lists/EventCallout.vue | 2 +- components/calendar/state/monthly/DayTile.vue | 2 +- components/ui/input/Input.vue | 2 +- components/world/form/Create.vue | 6 ++---- components/world/form/Update.vue | 6 ++---- 9 files changed, 15 insertions(+), 23 deletions(-) diff --git a/components/calendar/category/TableRow.vue b/components/calendar/category/TableRow.vue index 2ab81fa..12fb129 100644 --- a/components/calendar/category/TableRow.vue +++ b/components/calendar/category/TableRow.vue @@ -13,7 +13,7 @@ const { category } = defineProps<{ }>() const emit = defineEmits<{ - (e: "on-delete-category", payload: Category): void + "on-delete-category": [payload: Category] }>() type RowMode = "edit" | "view" diff --git a/components/calendar/form/Create.vue b/components/calendar/form/Create.vue index cd1056a..ed19f90 100644 --- a/components/calendar/form/Create.vue +++ b/components/calendar/form/Create.vue @@ -57,13 +57,11 @@ async function handleSubmit() { } /** - * === Watch for name changes to display above === + * Watch for name changes to display above */ const emit = defineEmits<{ - // eslint-disable-next-line no-unused-vars - (e: "on-changed-name", calendarName: string): void - // eslint-disable-next-line no-unused-vars - (e: "on-close"): void + "on-changed-name": [calendarName: string] + "on-close": [] }>() /** Hook to emit a debounced event for the changed skeleton name */ diff --git a/components/calendar/form/Update.vue b/components/calendar/form/Update.vue index dd8f2c1..cbec70b 100644 --- a/components/calendar/form/Update.vue +++ b/components/calendar/form/Update.vue @@ -53,13 +53,11 @@ async function handleSubmit() { } /** - * === Watch for name changes to display above === + * Watch for name changes to display above */ const emit = defineEmits<{ - // eslint-disable-next-line no-unused-vars - (e: "on-changed-name", calendarName: string): void - // eslint-disable-next-line no-unused-vars - (e: "on-close"): void + "on-changed-name": [calendarName: string] + "on-close": [] }>() /** Hook to emit a debounced event for the changed skeleton name */ diff --git a/components/calendar/search/lists/CharacterCallout.vue b/components/calendar/search/lists/CharacterCallout.vue index 06561ad..838b3d4 100644 --- a/components/calendar/search/lists/CharacterCallout.vue +++ b/components/calendar/search/lists/CharacterCallout.vue @@ -12,7 +12,7 @@ const props = defineProps<{ }>() defineEmits<{ - (e: "query:date-jump", payload: RPGDate): void + "query:date-jump": [payload: RPGDate] }>() const { getFormattedDateTitle } = useCalendar() diff --git a/components/calendar/search/lists/EventCallout.vue b/components/calendar/search/lists/EventCallout.vue index 3655f48..1783bbe 100644 --- a/components/calendar/search/lists/EventCallout.vue +++ b/components/calendar/search/lists/EventCallout.vue @@ -10,7 +10,7 @@ const props = defineProps<{ }>() defineEmits<{ - (e: "query:date-jump", payload: RPGDate): void + "query:date-jump": [payload: RPGDate] }>() const { getRelativeString, defaultDate, getFormattedDateTitle } = useCalendar() diff --git a/components/calendar/state/monthly/DayTile.vue b/components/calendar/state/monthly/DayTile.vue index 147e29e..15f423b 100644 --- a/components/calendar/state/monthly/DayTile.vue +++ b/components/calendar/state/monthly/DayTile.vue @@ -13,7 +13,7 @@ const props = defineProps<{ }>() const emit = defineEmits<{ - (e: "on-open-create-dialog", date: RPGDate): void + "on-open-create-dialog": [date: RPGDate] }>() const calendarTile = ref() diff --git a/components/ui/input/Input.vue b/components/ui/input/Input.vue index 6cfe727..02b58aa 100644 --- a/components/ui/input/Input.vue +++ b/components/ui/input/Input.vue @@ -10,7 +10,7 @@ const props = defineProps<{ }>() const emits = defineEmits<{ - (e: "update:modelValue", payload: string | number): void + "update:modelValue": [payload: string | number] }>() const modelValue = useVModel(props, "modelValue", emits, { diff --git a/components/world/form/Create.vue b/components/world/form/Create.vue index 84ba3af..9d28710 100644 --- a/components/world/form/Create.vue +++ b/components/world/form/Create.vue @@ -42,10 +42,8 @@ async function handleSubmit() { * === Watch for name changes to display above === */ const emit = defineEmits<{ - // eslint-disable-next-line no-unused-vars - (e: "on-changed-name", calendarName: string): void - // eslint-disable-next-line no-unused-vars - (e: "on-close"): void + "on-changed-name": [calendarName: string] + "on-close": [] }>() /** Hook to emit a debounced event for the changed skeleton name */ diff --git a/components/world/form/Update.vue b/components/world/form/Update.vue index 7050c31..0218652 100644 --- a/components/world/form/Update.vue +++ b/components/world/form/Update.vue @@ -54,10 +54,8 @@ async function handleSubmit() { * === Watch for name changes to display above === */ const emit = defineEmits<{ - // eslint-disable-next-line no-unused-vars - (e: "on-changed-name", calendarName: string): void - // eslint-disable-next-line no-unused-vars - (e: "on-close"): void + "on-changed-name": [calendarName: string] + "on-close": [] }>() /** Hook to emit a debounced event for the changed skeleton name */