mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-10 02:08:14 -06:00
feat: upgrade to Next.js 15, React 19, and migrate to ESLint 9 flat config
Major framework upgrades: - Next.js 13 → 15.5.6 - React 18.2.0 → 19.2.0 - ESLint 8 → 9 with flat config migration Dependency updates: - @headlessui/react, date-fns, zod, true-myth, usehooks-ts - @typescript-eslint packages to v8 - TypeScript to v5.9.3 - Prettier to v3.6.2 Breaking changes: - Migrate from .eslintrc.json to eslint.config.mjs - Remove deprecated swcMinify option from next.config.mjs - Update all React type definitions
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import type { FunctionComponent, ReactFragment, ReactNode } from "react";
|
||||
import type { FunctionComponent, ReactNode } from "react";
|
||||
import React from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
type PropertyProps = {
|
||||
title: string | ReactNode | ReactFragment;
|
||||
children: string | ReactNode | ReactFragment;
|
||||
title: string | ReactNode;
|
||||
children: string | ReactNode;
|
||||
titleClass?: string;
|
||||
valueClass?: string;
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ export function ipv6InCIDR(ip: string, cidr: string): boolean {
|
||||
const mask = (maxMask << BigInt(128 - prefixLen)) & maxMask;
|
||||
|
||||
return (ipInt & mask) === (rangeInt & mask);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ const useLookup = (warningHandler?: WarningHandler) => {
|
||||
|
||||
async function getAndParse<T>(
|
||||
url: string,
|
||||
schema: ZodSchema
|
||||
schema: ZodSchema<T>
|
||||
): Promise<Result<T, Error>> {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -366,7 +366,6 @@ const useLookup = (warningHandler?: WarningHandler) => {
|
||||
)
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const data = await response.json();
|
||||
|
||||
// Try each schema until one works
|
||||
@@ -381,7 +380,6 @@ const useLookup = (warningHandler?: WarningHandler) => {
|
||||
);
|
||||
}
|
||||
case "json": {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const data = JSON.parse(target);
|
||||
for (const schema of schemas) {
|
||||
const result = schema.safeParse(data);
|
||||
|
||||
@@ -796,7 +796,7 @@ const TypeValidators = new Map<
|
||||
const octet = parseInt(octets[i] ?? "", 10);
|
||||
if (isNaN(octet) || octet < 0 || octet > 255) {
|
||||
return Promise.resolve(
|
||||
`Invalid IPv4 address: octet ${i + 1} (${octets[i]}) must be 0-255`
|
||||
`Invalid IPv4 address: octet ${i + 1} (${octets[i] ?? 'undefined'}) must be 0-255`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user