mirror of
https://github.com/Xevion/rdap.git
synced 2026-01-31 06:25:28 -06:00
fix: upgrade to Next.js 16 and fix pnpm 10 compatibility
- Upgrade Next.js from 15.5.6 to 16.1.1 - Upgrade eslint-config-next to 16.1.1 for ESLint 9 flat config support - Add required ESLint dependencies (@eslint/js, @eslint/eslintrc, typescript-eslint) - Rewrite eslint.config.mjs to use Next.js 16's native flat config - Fix React hooks lint errors (set-state-in-effect) by using queueMicrotask - Fix exhaustive-deps warning in LookupInput - Suppress false positive refs lint error in react-hook-form integration This resolves pnpm 10's stricter package resolution and module exports handling.
This commit is contained in:
+9
-43
@@ -1,17 +1,5 @@
|
||||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
||||
import tsParser from "@typescript-eslint/parser";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import js from "@eslint/js";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
});
|
||||
import nextConfig from "eslint-config-next";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default [
|
||||
// Base configuration with ignores
|
||||
@@ -24,48 +12,26 @@ export default [
|
||||
"out/**",
|
||||
"*.config.mjs",
|
||||
"*.config.js",
|
||||
"next-env.d.ts", // Next.js generated file
|
||||
],
|
||||
},
|
||||
|
||||
// Next.js core web vitals using FlatCompat
|
||||
...compat.extends("next/core-web-vitals"),
|
||||
// Next.js core web vitals config
|
||||
...nextConfig,
|
||||
|
||||
// TypeScript recommended rules
|
||||
...compat.extends("plugin:@typescript-eslint/recommended"),
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
// Base TypeScript configuration
|
||||
{
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslint,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"@typescript-eslint/consistent-type-imports": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// Additional strict TypeScript rules for .ts and .tsx files
|
||||
// TypeScript rules requiring type checking
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
...compat.extends("plugin:@typescript-eslint/recommended-requiring-type-checking")[0],
|
||||
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/consistent-type-imports": "warn",
|
||||
},
|
||||
},
|
||||
|
||||
// Allow CommonJS require in .cjs files
|
||||
|
||||
Reference in New Issue
Block a user