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", "$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", "$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"**/leaflet.d.ts"
],
"plugins": [ "plugins": [
"typescript", "typescript",
"unicorn", "unicorn",
+1 -1
View File
@@ -24,7 +24,7 @@
"@infra-blocks/zod-utils": "^0.4.2", "@infra-blocks/zod-utils": "^0.4.2",
"@next/bundle-analyzer": "^16.3.6", "@next/bundle-analyzer": "^16.3.6",
"@serwist/next": "^9.5.12", "@serwist/next": "^9.5.12",
"@socialgouv/matomo-next": "^1.10.0", "@socialgouv/matomo-next": "^1.14.2",
"@tanstack/react-query": "^5.29.0", "@tanstack/react-query": "^5.29.0",
"@turf/boolean-point-in-polygon": "^7.0.0-alpha.114", "@turf/boolean-point-in-polygon": "^7.0.0-alpha.114",
"@types/node": "^22.7.2", "@types/node": "^22.7.2",
@@ -49,7 +49,7 @@ const EditZone = () => {
await refetch(); await refetch();
router.push("/zones"); router.push("/zones");
} catch (error) { } catch {
setResponseMessage({ setResponseMessage({
type: "error", type: "error",
message: t("createFailure"), message: t("createFailure"),
+3 -3
View File
@@ -1,6 +1,6 @@
"use client"; "use client";
import { useEffect } from "react"; import { useEffect, type ReactNode } from "react";
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import { useLocale } from "next-intl"; import { useLocale } from "next-intl";
@@ -10,11 +10,11 @@ import { setUserLocale } from "@/server/setUserLocale";
import { usePathname, useRouter } from "@/utils/routing"; import { usePathname, useRouter } from "@/utils/routing";
type LocaleCheckerProps = { type LocaleCheckerProps = {
children?: React.ReactNode; children?: ReactNode;
}; };
export const LocaleChecker = ({ children }: LocaleCheckerProps) => { export const LocaleChecker = ({ children }: LocaleCheckerProps) => {
const { data: sessionData, status, update } = useSession(); const { data: sessionData, status } = useSession();
const router = useRouter(); const router = useRouter();
const pathname = usePathname(); const pathname = usePathname();
const params = useParams(); const params = useParams();
-3
View File
@@ -52,14 +52,11 @@ export const AsyncSelectField = <
hideErrorMessage, hideErrorMessage,
required, required,
size, size,
loadOption, loadOption,
loadOptions, loadOptions,
onInformChange, onInformChange,
placeholder, placeholder,
separators, separators,
...selectProps ...selectProps
}: AsyncSelectFieldProps<TFieldValues, TFieldName, IsMulti, T, D>) => { }: AsyncSelectFieldProps<TFieldValues, TFieldName, IsMulti, T, D>) => {
const t = useTranslations("App"); const t = useTranslations("App");
+1 -4
View File
@@ -88,10 +88,7 @@ export const Select = <
T = string, T = string,
D = unknown, D = unknown,
>({ >({
className,
required,
size, size,
placeholder, placeholder,
separators, separators,
hasError, hasError,
@@ -121,7 +118,7 @@ export const Select = <
}} }}
classNames={{ classNames={{
...classNames(hasError ?? false, separators ?? false), ...classNames(hasError ?? false, separators ?? false),
...(classNameOverrides ?? {}), ...classNameOverrides,
}} }}
{...selectProps} {...selectProps}
/> />
-7
View File
@@ -1,7 +1,4 @@
import React from "react";
import { flatMap, get, isArray, isNil, isObject } from "lodash"; import { flatMap, get, isArray, isNil, isObject } from "lodash";
import { useTranslations } from "next-intl";
import { import {
Controller, Controller,
FieldPath, FieldPath,
@@ -47,13 +44,9 @@ export const SelectField = <
label, label,
hideErrorMessage, hideErrorMessage,
required, required,
placeholder,
separators,
options, options,
...selectProps ...selectProps
}: SelectFieldProps<TFieldValues, TFieldName, IsMulti, T, D>) => { }: SelectFieldProps<TFieldValues, TFieldName, IsMulti, T, D>) => {
const t = useTranslations("App");
const form = useFormContext<TFieldValues>(); const form = useFormContext<TFieldValues>();
const { const {
-7
View File
@@ -5,7 +5,6 @@ import {
Controller, Controller,
FieldPath, FieldPath,
FieldValues, FieldValues,
useFormContext,
} from "react-hook-form"; } from "react-hook-form";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
@@ -34,14 +33,8 @@ export const SwitchField = <
disabled, disabled,
className, className,
labelClassName, labelClassName,
childrenWrapperClassName,
hideErrorMessage,
...rest ...rest
} = props; } = props;
const form = useFormContext<TFieldValues>();
return ( return (
<Field <Field
{...{ {...{
+3 -7
View File
@@ -1,4 +1,4 @@
import React from "react"; import type {HTMLProps, ReactNode} from 'react'
import { get } from "lodash"; import { get } from "lodash";
import { import {
@@ -19,9 +19,9 @@ type TextAreaFieldProps<
TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = Prettify< > = Prettify<
GenericFieldProps<TFieldValues, TFieldName> & GenericFieldProps<TFieldValues, TFieldName> &
Omit<React.HTMLProps<HTMLTextAreaElement>, "ref" | "name"> & { Omit<HTMLProps<HTMLTextAreaElement>, "ref" | "name"> & {
handleChanged?: (props: { name: string }) => void; handleChanged?: (props: { name: string }) => void;
startIcon?: React.ReactNode; startIcon?: ReactNode;
required?: boolean; required?: boolean;
} }
>; >;
@@ -40,11 +40,7 @@ export const TextAreaField = <
labelClassName, labelClassName,
childrenWrapperClassName, childrenWrapperClassName,
hideErrorMessage = false, hideErrorMessage = false,
startIcon,
handleChanged,
required, required,
disabled, disabled,
...rest ...rest
} = props; } = props;
@@ -1,6 +1,5 @@
import { useState } from "react"; import { useState } from "react";
import { on } from "events";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import { FieldPath, FieldValues } from "react-hook-form"; import { FieldPath, FieldValues } from "react-hook-form";
import { FaExternalLinkAlt } from "react-icons/fa"; import { FaExternalLinkAlt } from "react-icons/fa";