Skip to content

Commit

Permalink
fix ci errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskedHawk committed Aug 9, 2023
1 parent 71f5b74 commit 75d70f4
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions packages/rhf-mui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@
"release": "^6.3.1",
"tsup": "^6.1.2",
"typescript": "latest"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
}
}
4 changes: 2 additions & 2 deletions packages/rhf-mui/src/AutocompleteElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type AutocompleteElementProps<
loading?: boolean
multiple?: M
matchId?: boolean
rules?: ControllerProps['rules']
rules?: ControllerProps<F>['rules']
parseError?: (error: FieldError) => ReactNode
required?: boolean
label?: TextFieldProps['label']
Expand Down Expand Up @@ -68,7 +68,7 @@ export default function AutocompleteElement<TFieldValues extends FieldValues>({
>) {
const errorMsgFn = useFormError()
const customErrorFn = parseError || errorMsgFn
const validationRules: ControllerProps['rules'] = {
const validationRules: ControllerProps<TFieldValues>['rules'] = {
...rules,
...(required && {
required: rules?.required || 'This field is required',
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/CheckboxButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type CheckboxButtonGroupProps<T extends FieldValues> = {
disabled?: boolean
row?: boolean
control?: Control<T>
rules?: ControllerProps['rules']
rules?: ControllerProps<T>['rules']
checkboxColor?: CheckboxProps['color']
labelProps?: Omit<FormControlLabelProps, 'label' | 'control'>
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/CheckboxElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type CheckboxElementProps<T extends FieldValues> = Omit<
CheckboxProps,
'name'
> & {
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
name: Path<T>
parseError?: (error: FieldError) => ReactNode
label?: FormControlLabelProps['label']
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/DatePickerElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type DatePickerElementProps<
required?: boolean
isDate?: boolean
parseError?: (error: FieldError) => ReactNode
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
control?: Control<T>
inputProps?: TextFieldProps
helperText?: TextFieldProps['helperText']
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/DateTimePickerElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type DateTimePickerElementProps<
required?: boolean
isDate?: boolean
parseError?: (error: FieldError) => ReactNode
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
control?: Control<T>
inputProps?: TextFieldProps
helperText?: TextFieldProps['helperText']
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/MobileDatePickerElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type MobileDatePickerElementProps<
required?: boolean
isDate?: boolean
parseError?: (error: FieldError) => ReactNode
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
control?: Control<T>
inputProps?: TextFieldProps
helperText?: TextFieldProps['helperText']
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/SelectElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type SelectElementProps<T extends FieldValues> = Omit<
TextFieldProps,
'name' | 'type' | 'onChange'
> & {
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
name: Path<T>
options?:
| readonly {
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/SliderElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type SliderElementProps<T extends FieldValues> = Omit<
name: Path<T>
control?: Control<T>
label?: string
rules?: ControllerProps['rules']
rules?: ControllerProps<T>['rules']
parseError?: (error: FieldError) => ReactNode
required?: boolean
formControlProps?: FormControlProps
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/TextFieldElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type TextFieldElementProps<T extends FieldValues = FieldValues> = Omit<
TextFieldProps,
'name'
> & {
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
name: Path<T>
parseError?: (error: FieldError) => ReactNode
control?: Control<T>
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/TextareaAutosizeElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useFormError} from './FormErrorProvider'

export type TextareaAutosizeElementProps<T extends FieldValues = FieldValues> =
Omit<TextFieldProps, 'name' | 'type'> & {
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
name: Path<T>
parseError?: (error: FieldError) => ReactNode
control?: Control<T>
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/TimePickerElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type TimePickerElementProps<
required?: boolean
isDate?: boolean
parseError?: (error: FieldError) => ReactNode
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
control?: Control<T>
inputProps?: TextFieldProps
helperText?: TextFieldProps['helperText']
Expand Down
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/ToggleButtonGroupElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type ToggleButtonGroupElementProps<T extends FieldValues> =
ToggleButtonGroupProps & {
required?: boolean
label?: string
validation?: ControllerProps['rules']
validation?: ControllerProps<T>['rules']
name: Path<T>
parseError?: (error: FieldError) => ReactNode
control?: Control<T>
Expand Down

0 comments on commit 75d70f4

Please sign in to comment.