-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
54 lines (49 loc) · 1.84 KB
/
Copy patheslint.config.mjs
File metadata and controls
54 lines (49 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// =============================================================================
// ESLint v9 — Native Flat Config
// -----------------------------------------------------------------------------
// Wir nutzen NICHT eslint-config-next, weil dessen Compat-Schicht mit
// @eslint/eslintrc.FlatCompat in v16 zirkuläre Plugin-Referenzen produziert.
// Die wichtigsten Next.js-spezifischen Checks (img-element, link-passhref, etc.)
// macht Next.js bereits zur Build-Zeit selbst — die Lint-Stufe deckt hier
// hauptsächlich allgemeine TypeScript-Sauberkeit ab.
// =============================================================================
import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
// Globale Ignores — werden auf ALLE Dateien angewendet
ignores: [
".next/**",
"out/**",
"node_modules/**",
"public/search-index.json",
"next-env.d.ts",
"*.config.{js,mjs,cjs,ts}", // Konfigurationsdateien selbst nicht linten
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
rules: {
// Unused-Vars: Warning statt Error, mit Unterstrich-Ignorierung
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
],
// any ist manchmal pragmatisch (z.B. bei generischen Props/Spreads)
"@typescript-eslint/no-explicit-any": "warn",
// Empty-Object-Type in Interface-Erweiterungen ist OK
"@typescript-eslint/no-empty-object-type": "off",
// Wir brauchen keinen no-undef in TS-Dateien — TypeScript erledigt das selbst
"no-undef": "off",
},
},
{
files: ["scripts/**/*.ts"],
rules: {
// Scripts dürfen console.log nutzen
"no-console": "off",
},
},
);