Skip to content

Commit 1cc41da

Browse files
committed
Fixed warnings issued by ESLint 9 regarding type definition files
1 parent 14f0ccf commit 1cc41da

File tree

9 files changed

+31
-21
lines changed

9 files changed

+31
-21
lines changed

@types/next-auth.d.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
// Source : https://next-auth.js.org/getting-started/typescript#module-augmentation
33
import type { JWT } from "next-auth/jwt";
44

5-
declare module "next-auth" {
5+
declare module "next-auth"
6+
{
67
// Types relatifs aux utilisateurs.
7-
interface User {
8+
interface User
9+
{
810
id: string;
911
role: string;
1012
image?: string;
@@ -14,15 +16,18 @@ declare module "next-auth" {
1416
}
1517

1618
// Types relatifs aux sessions.
17-
interface Session {
19+
interface Session
20+
{
1821
user: {} & JWT;
1922
expires: ISODateString;
2023
}
2124
}
2225

23-
declare module "next-auth/jwt" {
26+
declare module "next-auth/jwt"
27+
{
2428
// Types relatifs aux jetons JWT.
25-
export interface JWT {
29+
export interface JWT
30+
{
2631
id: string;
2732
role: string;
2833
oauth: boolean;

@types/prisma.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Types pour le cache de connexion à la base de données Prisma.
22
import { PrismaClient } from "@prisma/client";
33

4-
declare global {
4+
declare global
5+
{
56
var prisma: PrismaClient;
67
}

@types/react-table.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import type { FileAttributes } from "@/interfaces/File";
44
import type { Dispatch, SetStateAction } from "react";
55

6-
declare module "@tanstack/table-core" {
7-
interface TableMeta {
6+
declare module "@tanstack/table-core"
7+
{
8+
interface TableMeta
9+
{
810
// Fichiers affichés dans le tableau.
911
files: FileAttributes[];
1012

@@ -17,4 +19,4 @@ declare module "@tanstack/table-core" {
1719
// Traductions des messages.
1820
messages: Record<string, string>;
1921
}
20-
}
22+
}

app/[locale]/components/notification.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import { updateReadState } from "../actions";
2121
import { Button, buttonVariants } from "./ui/button";
2222

2323
// Typage des notifications provenant de la base de données.
24-
type Notification = {
24+
interface Notification
25+
{
2526
title: string;
2627
message: string;
2728
createdAt: Date;

app/[locale]/components/ui/form.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ import { Label } from "./label";
2727

2828
const Form = FormProvider;
2929

30-
type FormFieldContextValue<
30+
interface FormFieldContextValue<
3131
TFieldValues extends FieldValues = FieldValues,
3232
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
33-
> = {
33+
>
34+
{
3435
name: TName;
3536
};
3637

@@ -52,7 +53,8 @@ function FormField<
5253
);
5354
}
5455

55-
type FormItemContextValue = {
56+
interface FormItemContextValue
57+
{
5658
id: string;
5759
};
5860

app/[locale]/components/ui/thirdparty/blur-in.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function BlurIn( {
4141
transition: { delay, duration }
4242
}
4343
};
44-
const combinedVariants = variant || defaultVariants;
44+
const combinedVariants = variant ?? defaultVariants;
4545
const [ reducedMotion, setReducedMotion ] = useState( false );
4646

4747
useEffect( () =>

app/[locale]/components/ui/thirdparty/fade-text.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import { useEffect, useMemo, useState, type ReactNode } from "react";
99
import { motion, type Variants } from "framer-motion";
1010

11-
type FadeTextProps = {
11+
interface FadeTextProps
12+
{
1213
as: string;
1314
delay?: number;
1415
className?: string;
1516
direction?: "up" | "down" | "left" | "right";
1617
framerProps?: Variants;
1718
children: ReactNode;
18-
};
19+
}
1920

2021
export default function FadeText( {
2122
as,
@@ -42,9 +43,7 @@ export default function FadeText( {
4243

4344
const FADE_ANIMATION_VARIANTS = useMemo( () =>
4445
{
45-
const { hidden, show, ...rest } = framerProps as {
46-
[name: string]: { [name: string]: number; opacity: number };
47-
};
46+
const { hidden, show, ...rest } = framerProps as Record<string, { [name: string]: number; opacity: number }>;
4847

4948
return {
5049
...rest,

app/[locale]/settings/components/user.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function User( { session }: Readonly<{ session: Session }> )
6767
} );
6868

6969
// Génère un mot de passe aléatoire.
70-
const generateRandomPassword = ( length: number = 15 ) =>
70+
const generateRandomPassword = ( length = 15 ) =>
7171
{
7272
// On génère d'abord aléatoirement des octets sécurisés.
7373
const values = new Uint8Array( length );

utilities/gravatar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Récupère l'URL Gravatar d'une adresse électronique quelconque.
33
// Source : https://docs.gravatar.com/api/avatars/node/
44
//
5-
export const getGravatarUrl = async ( email: string, size: number = 64 ) =>
5+
export const getGravatarUrl = async ( email: string, size = 64 ) =>
66
{
77
const messageBuffer = new TextEncoder().encode( email.trim().toLowerCase() );
88
const hashBuffer = await crypto.subtle.digest( "SHA-256", messageBuffer );

0 commit comments

Comments
 (0)