implemented initial eslintFixes

This commit is contained in:
PxlLoewe
2025-07-09 01:06:54 -07:00
parent f793f2623b
commit 98ed0cb5ca
20 changed files with 309 additions and 111 deletions

View File

@@ -24,7 +24,7 @@ export const DateInput = <T extends FieldValues>({
locale={"de"}
onChange={(date) => field.onChange(date)}
selected={field.value}
{...(props as any)}
{...props}
/>
)}
/>

View File

@@ -1,24 +1,18 @@
import { DetailedHTMLProps, InputHTMLAttributes, ReactNode } from 'react';
import { InputHTMLAttributes, ReactNode } from "react";
interface FormTextInputProps extends InputHTMLAttributes<HTMLInputElement> {
error: any;
Svg: ReactNode;
children?: ReactNode;
error: ReactNode;
children?: ReactNode;
}
export const FormTextInput = ({
error,
Svg,
children,
...props
}: FormTextInputProps) => {
return (
<>
<label className="input input-bordered flex items-center gap-2">
{children}
<input {...props} />
</label>
<p className="text-error">{error}</p>
</>
);
export const FormTextInput = ({ error, children, ...props }: FormTextInputProps) => {
return (
<>
<label className="input input-bordered flex items-center gap-2">
{children}
<input {...props} />
</label>
<p className="text-error">{error}</p>
</>
);
};

View File

@@ -1,5 +1,6 @@
import DatePicker, { DatePickerProps, registerLocale } from "react-datepicker";
import { Control, Controller, FieldValues, Path, PathValue } from "react-hook-form";
/* eslint-disable @typescript-eslint/no-explicit-any */
import { DatePickerProps, registerLocale } from "react-datepicker";
import { Control, Controller, FieldValues, Path } from "react-hook-form";
import { de } from "date-fns/locale";
import { useState } from "react";
import { cn } from "@repo/shared-components";
@@ -44,7 +45,7 @@ export const ListInput = <T extends FieldValues>({
setValue("");
}}
type="button"
onSubmit={(e) => false}
onSubmit={() => false}
>
Hinzufügen
</button>

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
"use client";
import MDEditor from "@uiw/react-md-editor";
import { FieldValues, Path, RegisterOptions, UseFormReturn } from "react-hook-form";
@@ -5,7 +6,7 @@ import { cn } from "@repo/shared-components";
interface MarkdownEditorProps<T extends FieldValues> {
name: Path<T>;
form: UseFormReturn<T>;
form: UseFormReturn<any>;
formOptions?: RegisterOptions<T>;
label?: string;
placeholder?: string;

View File

@@ -1,19 +1,20 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
"use client";
import { FieldValues, Path, RegisterOptions, UseFormReturn } from "react-hook-form";
import SelectTemplate, { Props as SelectTemplateProps, StylesConfig } from "react-select";
import { cn } from "@repo/shared-components";
import dynamic from "next/dynamic";
import { CSSProperties } from "react";
interface SelectProps<T extends FieldValues> extends Omit<SelectTemplateProps, "form"> {
label?: any;
label?: React.ReactNode;
name: Path<T>;
form: UseFormReturn<T> | any;
form: UseFormReturn<any>;
formOptions?: RegisterOptions<T>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}
const customStyles: StylesConfig<any, false> = {
type OptionType = { label: string; value: string };
const customStyles: StylesConfig<OptionType, false> = {
control: (provided) => ({
...provided,
backgroundColor: "var(--color-base-100)",
@@ -55,7 +56,6 @@ const SelectCom = <T extends FieldValues>({
label = name,
placeholder = label,
form,
formOptions,
className,
...inputProps
}: SelectProps<T>) => {
@@ -74,7 +74,6 @@ const SelectCom = <T extends FieldValues>({
});
}
form.trigger(name);
form.Dirty;
}}
value={
(inputProps as any)?.isMulti

View File

@@ -1,10 +1,11 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { FieldValues, Path, RegisterOptions, UseFormReturn } from "react-hook-form";
import { cn } from "@repo/shared-components";
interface InputProps<T extends FieldValues>
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "form"> {
name: Path<T>;
form: UseFormReturn<T>;
form: UseFormReturn<any>;
formOptions?: RegisterOptions<T>;
label?: string;
}
@@ -13,7 +14,6 @@ export const Switch = <T extends FieldValues>({
name,
label = name,
form,
formOptions,
className,
...inputProps
}: InputProps<T>) => {
@@ -21,7 +21,12 @@ export const Switch = <T extends FieldValues>({
<div className="form-control ">
<label className="label cursor-pointer w-full">
<span className={cn("label-text text-left w-full", className)}>{label}</span>
<input type="checkbox" className={cn("toggle", className)} {...form.register(name)} />
<input
type="checkbox"
className={cn("toggle", className)}
{...form.register(name)}
{...inputProps}
/>
</label>
</div>
);