diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 7d58df4..8503f14 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,4 +1,4 @@ { "$schema": "./node_modules/oxfmt/configuration_schema.json", - "ignorePatterns": ["leaflet.d.ts"] + "ignorePatterns": ["**/leaflet.d.ts"] } diff --git a/.oxlintrc.json b/.oxlintrc.json index 75868c2..e5a7e13 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,5 +1,8 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", + "ignorePatterns": [ + "**/leaflet.d.ts" + ], "plugins": [ "typescript", "unicorn", diff --git a/package.json b/package.json index de0711b..32021f7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@infra-blocks/zod-utils": "^0.4.2", "@next/bundle-analyzer": "^16.3.6", "@serwist/next": "^9.5.12", - "@socialgouv/matomo-next": "^1.10.0", + "@socialgouv/matomo-next": "^1.14.2", "@tanstack/react-query": "^5.29.0", "@turf/boolean-point-in-polygon": "^7.0.0-alpha.114", "@types/node": "^22.7.2", diff --git a/src/app/[locale]/(main)/zones/edit/[id]/page.tsx b/src/app/[locale]/(main)/zones/edit/[id]/page.tsx index 35f817e..04d465c 100644 --- a/src/app/[locale]/(main)/zones/edit/[id]/page.tsx +++ b/src/app/[locale]/(main)/zones/edit/[id]/page.tsx @@ -49,7 +49,7 @@ const EditZone = () => { await refetch(); router.push("/zones"); - } catch (error) { + } catch { setResponseMessage({ type: "error", message: t("createFailure"), diff --git a/src/components/LocaleChecker.tsx b/src/components/LocaleChecker.tsx index be1cd53..f973a83 100644 --- a/src/components/LocaleChecker.tsx +++ b/src/components/LocaleChecker.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, type ReactNode } from "react"; import { useSession } from "next-auth/react"; import { useLocale } from "next-intl"; @@ -10,11 +10,11 @@ import { setUserLocale } from "@/server/setUserLocale"; import { usePathname, useRouter } from "@/utils/routing"; type LocaleCheckerProps = { - children?: React.ReactNode; + children?: ReactNode; }; export const LocaleChecker = ({ children }: LocaleCheckerProps) => { - const { data: sessionData, status, update } = useSession(); + const { data: sessionData, status } = useSession(); const router = useRouter(); const pathname = usePathname(); const params = useParams(); diff --git a/src/components/form/AsyncSelectField.tsx b/src/components/form/AsyncSelectField.tsx index 069ffc9..f236469 100644 --- a/src/components/form/AsyncSelectField.tsx +++ b/src/components/form/AsyncSelectField.tsx @@ -52,14 +52,11 @@ export const AsyncSelectField = < hideErrorMessage, required, size, - loadOption, loadOptions, onInformChange, - placeholder, separators, - ...selectProps }: AsyncSelectFieldProps) => { const t = useTranslations("App"); diff --git a/src/components/form/Select.tsx b/src/components/form/Select.tsx index 99d1074..e1adc13 100644 --- a/src/components/form/Select.tsx +++ b/src/components/form/Select.tsx @@ -88,10 +88,7 @@ export const Select = < T = string, D = unknown, >({ - className, - required, size, - placeholder, separators, hasError, @@ -121,7 +118,7 @@ export const Select = < }} classNames={{ ...classNames(hasError ?? false, separators ?? false), - ...(classNameOverrides ?? {}), + ...classNameOverrides, }} {...selectProps} /> diff --git a/src/components/form/SelectField.tsx b/src/components/form/SelectField.tsx index ca66b9a..8790fcc 100644 --- a/src/components/form/SelectField.tsx +++ b/src/components/form/SelectField.tsx @@ -1,7 +1,4 @@ -import React from "react"; - import { flatMap, get, isArray, isNil, isObject } from "lodash"; -import { useTranslations } from "next-intl"; import { Controller, FieldPath, @@ -47,13 +44,9 @@ export const SelectField = < label, hideErrorMessage, required, - - placeholder, - separators, options, ...selectProps }: SelectFieldProps) => { - const t = useTranslations("App"); const form = useFormContext(); const { diff --git a/src/components/form/SwitchField.tsx b/src/components/form/SwitchField.tsx index 9ee141f..2b28754 100644 --- a/src/components/form/SwitchField.tsx +++ b/src/components/form/SwitchField.tsx @@ -5,7 +5,6 @@ import { Controller, FieldPath, FieldValues, - useFormContext, } from "react-hook-form"; import { twMerge } from "tailwind-merge"; @@ -34,15 +33,9 @@ export const SwitchField = < disabled, className, labelClassName, - - childrenWrapperClassName, - hideErrorMessage, - ...rest } = props; - const form = useFormContext(); - - return ( + return ( = FieldPath, > = Prettify< GenericFieldProps & - Omit, "ref" | "name"> & { + Omit, "ref" | "name"> & { handleChanged?: (props: { name: string }) => void; - startIcon?: React.ReactNode; + startIcon?: ReactNode; required?: boolean; } >; @@ -40,11 +40,7 @@ export const TextAreaField = < labelClassName, childrenWrapperClassName, hideErrorMessage = false, - - startIcon, - handleChanged, required, - disabled, ...rest } = props; diff --git a/src/components/form/TournamentSelectField.tsx b/src/components/form/TournamentSelectField.tsx index 8127167..5c9cbe2 100644 --- a/src/components/form/TournamentSelectField.tsx +++ b/src/components/form/TournamentSelectField.tsx @@ -1,6 +1,5 @@ import { useState } from "react"; -import { on } from "events"; import { useTranslations } from "next-intl"; import { FieldPath, FieldValues } from "react-hook-form"; import { FaExternalLinkAlt } from "react-icons/fa";