-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
108 lines (104 loc) · 2.4 KB
/
eslint.config.mjs
File metadata and controls
108 lines (104 loc) · 2.4 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
import { FlatCompat } from "@eslint/eslintrc";
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
import nextTypescript from "eslint-config-next/typescript";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compact = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [...nextCoreWebVitals, ...nextTypescript, ...compact.config({
rules: {
"no-console": "error",
"no-unused-vars": "error",
"no-var": "error",
"@typescript-eslint/no-explicit-any": "error",
"no-alert": "error",
"consistent-return": "error",
"no-nested-ternary": "off",
"unicorn/filename-case": [
"error",
{
case: "kebabCase",
},
],
"unicorn/import-style": "off",
"unicorn/prevent-abbreviations": [
"error",
{
replacements: {
e: {
error: false,
event: false,
},
env: {
environment: false,
},
err: {
error: true,
},
ev: {
event: true,
},
evt: {
event: true,
},
idx: {
index: false,
},
msg: {
message: false,
},
props: {
properties: false,
},
prop: {
property: false,
},
param: {
parameter: false,
},
params: {
parameters: false,
},
res: {
resource: true,
response: true,
result: true,
},
src: {
source: true,
},
temp: {
temporary: true,
},
tmp: {
temporary: true,
},
util: {
utility: true,
},
utils: {
utilities: false,
},
val: {
value: true,
},
var: {
variable: true,
},
vars: {
variables: true,
},
},
},
],
}
}), eslintPluginUnicorn.configs.recommended, {
ignores: [
"node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"
]
}];
export default eslintConfig;