-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
138 lines (134 loc) · 3.49 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
// @ts-check
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import stylistic from "@stylistic/eslint-plugin";
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
globals: globals.node,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
}
},
{
plugins: {
stylistic
},
rules: {
"stylistic/indent": [
"error",
"tab",
{
"MemberExpression": 0
}
],
"stylistic/no-tabs": 0,
"stylistic/brace-style": [ "error", "allman" ],
"stylistic/comma-style": [ "error" ],
"stylistic/array-bracket-spacing": [ "error", "always" ],
"stylistic/space-before-blocks": [ "warn" ],
"stylistic/comma-spacing": [ "error" ],
"stylistic/function-call-spacing": [ "error", "never" ],
"stylistic/space-before-function-paren": [ "error", "always" ],
"stylistic/space-in-parens": [ "error", "always", { exceptions: [ "{}" , "empty" ] } ],
"stylistic/keyword-spacing": [ "error" ],
"stylistic/space-unary-ops": [ "error" ],
"stylistic/key-spacing": [ "error" ],
"stylistic/arrow-parens": [
"error",
"always"
],
"stylistic/function-paren-newline": [ "warn" ],
"stylistic/linebreak-style": [ "error", "unix" ],
"stylistic/quotes": [ "error", "double" ],
"stylistic/semi": "error",
"stylistic/no-trailing-spaces": "error",
"stylistic/block-spacing": [ "error" ],
"stylistic/arrow-spacing": [ "error" ],
"stylistic/space-infix-ops": [ "error" ],
"stylistic/object-curly-spacing": [ "error", "always" ],
"stylistic/no-multi-spaces": [ "error" ],
"stylistic/operator-linebreak": [ "error", "after" ],
"stylistic/no-extra-parens": [
"error",
"all",
{
"conditionalAssign": false
}
],
"stylistic/comma-dangle": [ "error" ]
}
},
{
rules: {
"@typescript-eslint/no-this-alias": [
"error",
{
"allowedNames": [ "self" ]
}
],
"@typescript-eslint/prefer-nullish-coalescing": "off",
"curly": [ "error", "multi-line" ],
"one-var": [ "error", "never" ],
"arrow-body-style": [ "error", "always" ],
"no-template-curly-in-string": [ "error" ],
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
"no-new-object": [ "error" ],
"no-empty-function": [ "error" ],
"no-empty": [
"warn",
{
"allowEmptyCatch": true
}
],
"no-eq-null": [ "error" ],
"no-extra-bind": [ "error" ],
"no-self-compare": [ "error" ],
"no-useless-call": [ "error" ],
"no-array-constructor": [ "error" ],
"prefer-destructuring": [
"error", {
"VariableDeclarator": {
"array": true,
"object": true
},
"AssignmentExpression": {
"array": false,
"object": false
}
},
{
"enforceForRenamedProperties": false
}
],
"object-shorthand": [ "warn" ],
"prefer-spread": [ "warn" ],
"prefer-template": [ "warn" ],
"no-loop-func": [ "warn" ],
"prefer-rest-params": [ "warn" ],
"no-new-func": [ "warn" ],
"no-unneeded-ternary": [ "warn" ],
"no-process-exit": "off",
"require-await": "warn"
}
},
{
files: [ "**/*.js" ],
extends: [ tseslint.configs.disableTypeChecked ]
}
];