fix eslint

This commit is contained in:
2025-11-15 16:43:16 +01:00
parent d880b3fc26
commit fe4783ae97
8 changed files with 73 additions and 81 deletions

View File

@@ -27,5 +27,5 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install run: pnpm install
- name: Run check - name: Run lint
run: pnpm run check run: pnpm run lint

View File

@@ -1,48 +0,0 @@
import { FlatCompat } from "@eslint/eslintrc";
import tseslint from "typescript-eslint";
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default tseslint.config(
{
ignores: [".next"],
},
...compat.extends("next/core-web-vitals"),
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: { attributes: false } },
],
},
},
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
);

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

@@ -2,7 +2,7 @@
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds. * for Docker builds.
*/ */
import "./src/env.js"; import './src/env.ts';
/** @type {import("next").NextConfig} */ /** @type {import("next").NextConfig} */
const config = {}; const config = {};

View File

@@ -9,7 +9,7 @@
"dev": "next dev --turbopack", "dev": "next dev --turbopack",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache", "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache", "format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"lint:fix": "next lint --fix", "lint": "next typegen && eslint . && npx tsc --noEmit",
"preview": "next build && next start", "preview": "next build && next start",
"start": "next start" "start": "next start"
}, },
@@ -34,13 +34,13 @@
"zod": "^4.0.0" "zod": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "3.3.1",
"@tailwindcss/postcss": "4.1.17", "@tailwindcss/postcss": "4.1.17",
"@types/node": "24.10.1", "@types/node": "24.10.1",
"@types/react": "19.2.5", "@types/react": "19.2.5",
"@types/react-dom": "19.2.3", "@types/react-dom": "19.2.3",
"eslint": "9.39.1", "eslint": "9.39.1",
"eslint-config-next": "16.0.3", "eslint-config-next": "16.0.3",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-hooks": "5.2.0", "eslint-plugin-react-hooks": "5.2.0",
"postcss": "8.5.6", "postcss": "8.5.6",
"prettier": "3.6.2", "prettier": "3.6.2",

16
pnpm-lock.yaml generated
View File

@@ -67,9 +67,6 @@ importers:
specifier: ^4.0.0 specifier: ^4.0.0
version: 4.1.12 version: 4.1.12
devDependencies: devDependencies:
'@eslint/eslintrc':
specifier: 3.3.1
version: 3.3.1
'@tailwindcss/postcss': '@tailwindcss/postcss':
specifier: 4.1.17 specifier: 4.1.17
version: 4.1.17 version: 4.1.17
@@ -88,6 +85,9 @@ importers:
eslint-config-next: eslint-config-next:
specifier: 16.0.3 specifier: 16.0.3
version: 16.0.3(@typescript-eslint/parser@8.46.4(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3) version: 16.0.3(@typescript-eslint/parser@8.46.4(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
eslint-config-prettier:
specifier: ^10.1.8
version: 10.1.8(eslint@9.39.1(jiti@2.6.1))
eslint-plugin-react-hooks: eslint-plugin-react-hooks:
specifier: 5.2.0 specifier: 5.2.0
version: 5.2.0(eslint@9.39.1(jiti@2.6.1)) version: 5.2.0(eslint@9.39.1(jiti@2.6.1))
@@ -1499,6 +1499,12 @@ packages:
typescript: typescript:
optional: true optional: true
eslint-config-prettier@10.1.8:
resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
eslint-import-resolver-node@0.3.9: eslint-import-resolver-node@0.3.9:
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
@@ -4109,6 +4115,10 @@ snapshots:
- eslint-plugin-import-x - eslint-plugin-import-x
- supports-color - supports-color
eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)):
dependencies:
eslint: 9.39.1(jiti@2.6.1)
eslint-import-resolver-node@0.3.9: eslint-import-resolver-node@0.3.9:
dependencies: dependencies:
debug: 3.2.7 debug: 3.2.7

View File

@@ -1,42 +1,35 @@
{ {
"compilerOptions": { "compilerOptions": {
/* Base Options: */ "lib": ["dom", "dom.iterable", "esnext"],
"esModuleInterop": true, "allowJs": false,
"skipLibCheck": true, "skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
/* Strictness */
"strict": true, "strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
/* Bundled projects */
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true, "noEmit": true,
"module": "ESNext", "esModuleInterop": true,
"moduleResolution": "Bundler", "module": "esnext",
"jsx": "preserve", "moduleResolution": "bundler",
"plugins": [{ "name": "next" }], "resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true, "incremental": true,
/* Path Aliases */
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
} },
"target": "ES2022",
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": true,
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false,
"noImplicitReturns": false,
"plugins": [{ "name": "next" }]
}, },
"include": [ "include": [
"next-env.d.ts", "next-env.d.ts",
"**/*.ts", "**/*.ts",
"**/*.tsx", "**/*.tsx",
"**/*.cjs", ".next/types/**/*.ts",
"**/*.js", ".next/dev/types/**/*.ts"
".next/types/**/*.ts"
], ],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }