Fix apps/console lint issues

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-22 12:51:08 +04:00
parent b4a73f2eea
commit dd23449cc0
244 changed files with 7685 additions and 8029 deletions

View File

@@ -9,13 +9,13 @@ export function useStateWithSchema<T extends ZodTypeAny>(
const [value, errors] = useMemo((): [z.infer<T>, Record<string, string>] => {
try {
schema.parse(state);
return [schema.parse(state), {}];
return [schema.parse(state) as z.TypeOf<T>, {}];
} catch (error) {
if (error instanceof ZodError) {
return [
state,
Object.fromEntries(
error.issues.map((issue) => [
error.issues.map(issue => [
issue.path.join("."),
issue.message,
]) ?? [],
@@ -32,7 +32,7 @@ export function useStateWithSchema<T extends ZodTypeAny>(
errors,
update: useCallback(
<TKey extends keyof z.infer<T>>(key: TKey, value: z.infer<T>[TKey]) => {
setState((prevState) => ({ ...prevState, [key]: value }));
setState(prevState => ({ ...prevState, [key]: value }));
},
[],
),