From 02d55b0edb34e097ec5abc6b56c45e2d9e0b4ddf Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 12 Apr 2024 14:00:00 +0200 Subject: [PATCH] playground: lint --- playground/app.vue | 2 +- playground/components/FormElementsExample.vue | 5 ++--- playground/components/FormNestedExample.vue | 4 ++-- playground/components/FormNestedListExample.vue | 8 ++++---- playground/pages/dropdown-menu.vue | 12 ++++++------ playground/pages/form.vue | 3 +-- playground/pages/navigation-menu.vue | 2 +- playground/pages/popover.vue | 2 +- playground/pages/toast.vue | 16 ++++++++-------- 9 files changed, 26 insertions(+), 28 deletions(-) diff --git a/playground/app.vue b/playground/app.vue index 700e3bed..ff53a8e0 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -39,7 +39,7 @@ const components = [ 'tooltip' ] -function upperName (name: string) { +function upperName(name: string) { return splitByCase(name).map(p => upperFirst(p)).join('') } diff --git a/playground/components/FormElementsExample.vue b/playground/components/FormElementsExample.vue index 26aa0a76..209b9803 100644 --- a/playground/components/FormElementsExample.vue +++ b/playground/components/FormElementsExample.vue @@ -2,7 +2,6 @@ import { z } from 'zod' import type { FormSubmitEvent, Form } from '#ui/types/form' - const schema = z.object({ input: z.string().min(10), // inputMenu: z.any().refine(option => option?.value === 'option-2', { @@ -38,7 +37,7 @@ const options = [ { label: 'Option 3', value: 'option-3' } ] -function onSubmit (event: FormSubmitEvent) { +function onSubmit(event: FormSubmitEvent) { console.log(event.data) } @@ -76,7 +75,7 @@ function onSubmit (event: FormSubmitEvent) { Submit - + Clear diff --git a/playground/components/FormNestedExample.vue b/playground/components/FormNestedExample.vue index 76399d44..8fc71b0a 100644 --- a/playground/components/FormNestedExample.vue +++ b/playground/components/FormNestedExample.vue @@ -21,11 +21,11 @@ const state = reactive }>>({ const checked = ref(false) -function onSubmit (event: FormSubmitEvent) { +function onSubmit(event: FormSubmitEvent) { console.log('Success', event.data) } -function onError (event: any) { +function onError(event: any) { console.log('Error', event) } diff --git a/playground/components/FormNestedListExample.vue b/playground/components/FormNestedListExample.vue index be9556c7..4cd77cce 100644 --- a/playground/components/FormNestedListExample.vue +++ b/playground/components/FormNestedListExample.vue @@ -18,25 +18,25 @@ type ItemSchema = z.output const state = reactive[] }>>({}) -function addItem () { +function addItem() { if (!state.items) { state.items = [] } state.items.push({}) } -function removeItem () { +function removeItem() { if (state.items) { state.items.pop() } } const formItemRef = ref() -function onSubmit (event: FormSubmitEvent) { +function onSubmit(event: FormSubmitEvent) { console.log('Success', event.data) } -function onError (event: any) { +function onError(event: any) { console.log('Error', event) } diff --git a/playground/pages/dropdown-menu.vue b/playground/pages/dropdown-menu.vue index fd7f735f..a890eb59 100644 --- a/playground/pages/dropdown-menu.vue +++ b/playground/pages/dropdown-menu.vue @@ -12,7 +12,7 @@ const items = computed(() => [ [{ label: 'Profile', icon: 'i-heroicons-user', - select (e: Event) { + select(e: Event) { e.preventDefault() console.log('Profile clicked') } @@ -37,7 +37,7 @@ const items = computed(() => [ label: 'Invite by link', icon: 'i-heroicons-link', shortcuts: [metaSymbol.value, 'I'], - select (e: Event) { + select(e: Event) { e.preventDefault() console.log('Invite by link clicked') } @@ -49,21 +49,21 @@ const items = computed(() => [ icon: 'i-simple-icons-slack', to: 'https://slack.com', target: '_blank', - select (e: Event) { + select(e: Event) { e.preventDefault() console.log('Import from Slack clicked') } }, { label: 'Import from Trello', icon: 'i-simple-icons-trello', - select (e: Event) { + select(e: Event) { e.preventDefault() console.log('Import from Trello clicked') } }, { label: 'Import from Asana', icon: 'i-simple-icons-asana', - select (e: Event) { + select(e: Event) { e.preventDefault() console.log('Import from Asana clicked') } @@ -78,7 +78,7 @@ const items = computed(() => [ icon: 'i-simple-icons-github', to: 'https://github.com/nuxt/ui', target: '_blank', - select (e: Event) { + select(e: Event) { e.preventDefault() } }, { diff --git a/playground/pages/form.vue b/playground/pages/form.vue index 2331e026..f483660d 100644 --- a/playground/pages/form.vue +++ b/playground/pages/form.vue @@ -13,8 +13,7 @@ type Schema = z.output const state = reactive>({}) const state2 = reactive>({}) - -function onSubmit (event: FormSubmitEvent) { +function onSubmit(event: FormSubmitEvent) { console.log(event.data) } diff --git a/playground/pages/navigation-menu.vue b/playground/pages/navigation-menu.vue index 4dd97f58..a227eafb 100644 --- a/playground/pages/navigation-menu.vue +++ b/playground/pages/navigation-menu.vue @@ -7,7 +7,7 @@ const links = [ src: 'https://avatars.githubusercontent.com/u/739984?v=4' }, badge: 100, - select () { + select() { console.log('Profile clicked') } }, { diff --git a/playground/pages/popover.vue b/playground/pages/popover.vue index a167cd1c..db094609 100644 --- a/playground/pages/popover.vue +++ b/playground/pages/popover.vue @@ -2,7 +2,7 @@ const open = ref(false) const loading = ref(false) -function send () { +function send() { loading.value = true setTimeout(() => { diff --git a/playground/pages/toast.vue b/playground/pages/toast.vue index 710ba846..43bbd4ea 100644 --- a/playground/pages/toast.vue +++ b/playground/pages/toast.vue @@ -40,7 +40,7 @@ const templates = (id: number) => [{ }, actions: [{ label: 'Action', - click () { + click() { console.log(`Toast ${id} action clicked`) } }] @@ -50,13 +50,13 @@ const templates = (id: number) => [{ actions: [{ label: 'Action 1', color: 'gray' as const, - click () { + click() { console.log(`Toast ${id} action 1 clicked`) } }, { label: 'Action 2', color: 'black' as const, - click () { + click() { console.log(`Toast ${id} action 2 clicked`) } }] @@ -67,13 +67,13 @@ const templates = (id: number) => [{ label: 'Action', color: 'primary' as const, variant: 'outline' as const, - click () { + click() { console.log(`Toast ${id} action clicked`) } }] }] -function addToast () { +function addToast() { const id = count.value++ const template = templates(id)[Math.floor(Math.random() * templates(id).length)] @@ -81,13 +81,13 @@ function addToast () { add({ id, ...template, - click (toast) { + click(toast) { console.log(`Toast ${toast.id} clicked`) } }) } -function updateToast () { +function updateToast() { if (!last.value) { return } @@ -98,7 +98,7 @@ function updateToast () { }) } -function removeToast () { +function removeToast() { if (!last.value) { return }