mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 01:16:00 -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:
76
eslint.config.mjs
Normal file
76
eslint.config.mjs
Normal file
@@ -0,0 +1,76 @@
|
||||
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
|
||||
});
|
||||
|
||||
export default [
|
||||
// Base configuration with ignores
|
||||
{
|
||||
ignores: [
|
||||
".next/**",
|
||||
"node_modules/**",
|
||||
"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"),
|
||||
|
||||
// TypeScript recommended rules
|
||||
...compat.extends("plugin:@typescript-eslint/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
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
...compat.extends("plugin:@typescript-eslint/recommended-requiring-type-checking")[0],
|
||||
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// Allow CommonJS require in .cjs files
|
||||
{
|
||||
files: ["**/*.cjs"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user