fix eslint

This commit is contained in:
2025-11-15 15:24:36 +01:00
parent 7cf51c2c8a
commit bf51e2f16b
6 changed files with 57 additions and 11 deletions

View File

@@ -1,6 +0,0 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
]
}

View File

@@ -28,4 +28,4 @@ jobs:
run: pnpm install run: pnpm install
- name: Run check - name: Run check
run: pnpm run check run: pnpm run lint

37
eslint.config.mjs Normal file
View File

@@ -0,0 +1,37 @@
// @ts-check
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import tseslint from "typescript-eslint";
const eslintConfig = defineConfig([
// Next.js core-web-vitals and TypeScript configs
...nextVitals,
...nextTs,
// Add strict TypeScript rules on top
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// Configure TypeScript parser options
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
// Override default ignores of eslint-config-next
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
// Additional ignores:
"*.mjs",
"tailwind.config.ts",
]),
]);
export default eslintConfig;

View File

@@ -6,9 +6,10 @@
"dev": "next dev --turbopack", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"check": "next lint && npx tsc --noEmit" "lint": "next typegen && eslint . && npx tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@eslint/js": "^9.39.1",
"@hookform/resolvers": "^5.1.1", "@hookform/resolvers": "^5.1.1",
"@radix-ui/react-label": "^2.1.7", "@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-popover": "^1.1.14", "@radix-ui/react-popover": "^1.1.14",
@@ -42,7 +43,8 @@
"postcss": "8.5.6", "postcss": "8.5.6",
"tailwindcss": "4.1.17", "tailwindcss": "4.1.17",
"turbo": "2.6.1", "turbo": "2.6.1",
"typescript": "5.9.3" "typescript": "5.9.3",
"typescript-eslint": "^8.46.4"
}, },
"packageManager": "pnpm@10.21.0", "packageManager": "pnpm@10.21.0",
"pnpm": { "pnpm": {

6
pnpm-lock.yaml generated
View File

@@ -12,6 +12,9 @@ importers:
.: .:
dependencies: dependencies:
'@eslint/js':
specifier: ^9.39.1
version: 9.39.1
'@hookform/resolvers': '@hookform/resolvers':
specifier: ^5.1.1 specifier: ^5.1.1
version: 5.2.2(react-hook-form@7.66.0(react@19.2.0)) version: 5.2.2(react-hook-form@7.66.0(react@19.2.0))
@@ -109,6 +112,9 @@ importers:
typescript: typescript:
specifier: 5.9.3 specifier: 5.9.3
version: 5.9.3 version: 5.9.3
typescript-eslint:
specifier: ^8.46.4
version: 8.46.4(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
packages: packages:

View File

@@ -10,7 +10,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "react-jsx",
"incremental": true, "incremental": true,
"plugins": [ "plugins": [
{ {
@@ -22,6 +22,13 @@
}, },
"target": "ES2023" "target": "ES2023"
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "event-dates.json"], "include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"event-dates.json",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }