Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelodelain committed Jun 13, 2024
1 parent e1247be commit ada892f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions utils/form/create-form-children.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import LazyVFormFieldset from '~/components/organisms/VForm/VFormFieldset.vue'

export type ComponentsMap = Record<string, Component>

type EmitType = (event: 'update:modelValue', ...args: any[]) => void
type EmitType = (event: 'update:modelValue', ...args: unknown[]) => void

export const RECAPTCHA_INPUT = 'g-recaptcha-response'

Expand Down Expand Up @@ -63,7 +63,7 @@ export default function createFormChildren(
const parentModelValues = parentProps.modelValue || {}
const currentModelValue = parentModelValues?.[key] || null

const defaultProps: Record<string, any> = {
const defaultProps: Record<string, unknown> = {
id,
'label': schema.title,
errorMessage,
Expand All @@ -78,7 +78,7 @@ export default function createFormChildren(
'autocomplete': schema.attr?.autocomplete || null,
// Binds reactivity
'modelValue': currentModelValue,
'onUpdate:modelValue': (value: any): void => {
'onUpdate:modelValue': (value: unknown): void => {
// Make sure null is passed as null and not as string
if (value === 'null') {
value = null
Expand Down Expand Up @@ -196,7 +196,7 @@ export default function createFormChildren(
...defaultAttrs,
}
const type = schema.widget || schema.type
const props: Record<string, any> = {
const props: Record<string, unknown> = {
...defaultProps,
type,
required,
Expand All @@ -220,7 +220,7 @@ export default function createFormChildren(
}

if (schema.widget === 'joined') {
const props: Record<string, any> = {
const props: Record<string, unknown> = {
...defaultProps,
required,
modelValue: currentModelValue ? (currentModelValue as Array<string>).join(', ') : '',
Expand Down Expand Up @@ -263,7 +263,7 @@ export default function createFormChildren(
const attrs: Record<string, string> = {
...defaultAttrs,
}
const props: Record<string, any> = {
const props: Record<string, unknown> = {
...defaultProps,
type,
required,
Expand All @@ -275,12 +275,12 @@ export default function createFormChildren(
}
else if (type === 'number') {
props.type = 'string'
props['onUpdate:modelValue'] = (value: any) =>
props['onUpdate:modelValue'] = (value: unknown) =>
emit('update:modelValue', { ...parentModelValues, [key]: Number.parseFloat(value) })
}
else if (type === 'integer') {
props.type = 'number'
props['onUpdate:modelValue'] = (value: any) =>
props['onUpdate:modelValue'] = (value: unknown) =>
emit('update:modelValue', { ...parentModelValues, [key]: Number.parseInt(value) })
props.step = '1'
}
Expand All @@ -294,7 +294,7 @@ export default function createFormChildren(
else {
props.modelValue = ''
}
props.step = 'any'
props.step = 'unknown'
props.type = 'datetime-local'
}
else if (type === 'file') {
Expand Down

0 comments on commit ada892f

Please sign in to comment.