-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
123 lines (121 loc) · 3.21 KB
/
Copy patheslint.config.mjs
File metadata and controls
123 lines (121 loc) · 3.21 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import importPlugin from "eslint-plugin-import";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
plugins: { import: importPlugin },
settings: {
"import/resolver": {
typescript: { alwaysTryTypes: true, project: "./tsconfig.json" },
node: true,
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
"import/no-cycle": [
"error",
{ maxDepth: 10, ignoreExternal: true },
],
"import/no-unused-modules": [
"warn",
{
unusedExports: true,
missingExports: false,
src: [
"app/**/*.{ts,tsx}",
"lib/**/*.{ts,tsx}",
"components/**/*.{ts,tsx}",
"workflows/**/*.{ts,tsx}",
"test/**/*.{ts,tsx}",
],
ignoreExports: [
"app/**/page.tsx",
"app/**/layout.tsx",
"app/**/route.ts",
"app/**/loading.tsx",
"app/**/error.tsx",
"app/**/global-error.tsx",
"app/**/opengraph-image.tsx",
"app/sitemap.ts",
"app/robots.ts",
"components/ui/**",
"**/*.test.ts",
"**/*.test.tsx",
],
},
],
"no-restricted-imports": [
"error",
{
paths: [
{
name: "next/link",
message:
"Import the wrapper from '@/app/_components/link' instead. See AGENTS.md.",
},
],
},
],
complexity: ["warn", 20],
"max-lines-per-function": [
"warn",
{ max: 200, skipBlankLines: true, skipComments: true, IIFEs: true },
],
"max-lines": [
"warn",
{ max: 600, skipBlankLines: true, skipComments: true },
],
},
},
{
files: ["app/_components/link.tsx"],
rules: { "no-restricted-imports": "off" },
},
{
// Large interactive UI surfaces with inherent state/branch fan-out.
// The header-search bars are also under active iterative refactor.
files: [
"app/_components/header-search/deck-mode-bar.tsx",
"app/_components/header-search/simple-bar.tsx",
"app/_components/builder/move-card-menu.tsx",
"app/_components/builder/printing-carousel.tsx",
"app/_components/search/search-form.tsx",
],
rules: {
"max-lines-per-function": "off",
"max-lines": "off",
complexity: "off",
},
},
{
files: ["**/*.test.ts", "**/*.test.tsx", "**/__tests__/**/*.{ts,tsx}"],
rules: {
"max-lines-per-function": "off",
"max-lines": "off",
complexity: "off",
},
},
globalIgnores([
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
"coverage/**",
"docs/hifi-poc/**",
"docs/backlog/**",
"app/.well-known",
".claude/**",
]),
]);
export default eslintConfig;