fix linting errors - unused deps etc

This commit is contained in:
2026-09-29 09:02:46 +02:00
parent 29e3173d80
commit 3fde18106d
11 changed files with 14 additions and 36 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": ["leaflet.d.ts"]
"ignorePatterns": ["**/leaflet.d.ts"]
}
+3
View File
@@ -1,5 +1,8 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"**/leaflet.d.ts"
],
"plugins": [
"typescript",
"unicorn",
+1 -1
View File
@@ -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",
@@ -49,7 +49,7 @@ const EditZone = () => {
await refetch();
router.push("/zones");
} catch (error) {
} catch {
setResponseMessage({
type: "error",
message: t("createFailure"),
+3 -3
View File
@@ -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();
-3
View File
@@ -52,14 +52,11 @@ export const AsyncSelectField = <
hideErrorMessage,
required,
size,
loadOption,
loadOptions,
onInformChange,
placeholder,
separators,
...selectProps
}: AsyncSelectFieldProps<TFieldValues, TFieldName, IsMulti, T, D>) => {
const t = useTranslations("App");
+1 -4
View File
@@ -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}
/>
-7
View File
@@ -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<TFieldValues, TFieldName, IsMulti, T, D>) => {
const t = useTranslations("App");
const form = useFormContext<TFieldValues>();
const {
+1 -8
View File
@@ -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<TFieldValues>();
return (
return (
<Field
{...{
name,
+3 -7
View File
@@ -1,4 +1,4 @@
import React from "react";
import type {HTMLProps, ReactNode} from 'react'
import { get } from "lodash";
import {
@@ -19,9 +19,9 @@ type TextAreaFieldProps<
TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = Prettify<
GenericFieldProps<TFieldValues, TFieldName> &
Omit<React.HTMLProps<HTMLTextAreaElement>, "ref" | "name"> & {
Omit<HTMLProps<HTMLTextAreaElement>, "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;
@@ -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";