-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
74 lines (73 loc) · 2.63 KB
/
eslint.config.js
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
import eslint from "@eslint/js"
import functional from "eslint-plugin-functional"
import perfectionist from "eslint-plugin-perfectionist"
import eslintPluginUnicorn from "eslint-plugin-unicorn"
import tseslint from "typescript-eslint"
export default [
eslint.configs.all,
...tseslint.configs.all,
eslintPluginUnicorn.configs["flat/all"],
perfectionist.configs["recommended-natural"],
functional.configs.all,
{ languageOptions: { parserOptions: { projectService: true } } },
{
rules: {
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
complexity: "off",
"functional/prefer-immutable-types": "off",
"functional/type-declaration-immutability": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-statements": "off",
"no-ternary": "off",
"sort-imports": "off",
"unicorn/no-abusive-eslint-disable": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-nested-ternary": "off",
},
},
{
rules: {
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
curly: ["error", "multi"],
"functional/functional-parameters": [
"error",
{ allowRestParameter: true },
],
"functional/no-conditional-statements": [
"error",
{ allowReturningBranches: true },
],
"functional/prefer-tacit": "error",
"id-length": ["error", { exceptions: ["c", "r", "x", "y", "z"] }],
"no-restricted-syntax": [
"error",
{
message: "Modifying a Set or Map is not allowed.",
selector: `CallExpression[callee.property.name=/^(${[
"add",
"clear",
"delete",
"set",
].join("|")})$/][callee.object.type='Identifier']`,
},
],
"one-var": ["error", "never"],
},
},
{
files: ["eslint.config.js"],
rules: { "@typescript-eslint/naming-convention": "off" },
},
{
files: ["**/*.spec.ts"],
rules: {
"functional/functional-parameters": "off",
"functional/no-expression-statements": "off",
"functional/no-return-void": "off",
},
},
]