-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
188 lines (185 loc) · 5.51 KB
/
.eslintrc.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// https://github.com/cgiosy/cgiosy/blob/main/packages/env-base/index.js
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
overrides: [
{
files: ["*.js", "*.cjs", "*.mjs"],
rules: { "@typescript-eslint/no-var-requires": "off" },
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: [
"@typescript-eslint",
],
rules: {
"no-await-in-loop": "warn",
"no-duplicate-imports": "error",
"no-template-curly-in-string": "error",
"no-unmodified-loop-condition": "warn",
"no-unreachable-loop": "warn",
"no-unused-vars": "off",
"no-use-before-define": "error",
"arrow-body-style": ["error", "as-needed"],
"camelcase": [
"warn",
{
ignoreDestructuring: true,
properties: "never",
},
],
"default-case-last": "error",
"default-param-last": "error",
"dot-notation": "error",
"eqeqeq": ["error", "always", { null: "ignore" }],
"func-names": ["error", "never"],
"func-style": ["error", "expression"],
"guard-for-in": "error",
"init-declarations": ["error", "always"],
"no-array-constructor": "error",
"no-caller": "error",
"no-confusing-arrow": "error",
"no-else-return": ["error", { allowElseIf: false }],
"no-extend-native": "error",
"no-extra-bind": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": ["error", { lexicalBindings: false }],
"no-implied-eval": "error",
"no-lone-blocks": "error",
"no-multi-assign": ["error", { ignoreNonDeclaration: true }],
"no-multi-str": "warn",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-proto": "error",
"no-restricted-syntax": ["error", "FunctionExpression", "WithStatement"],
"no-return-await": "warn",
"no-useless-computed-key": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"object-shorthand": ["error", "properties"],
"one-var": ["error", "never"],
"operator-assignment": ["error", "always"],
"prefer-arrow-callback": ["error", { allowUnboundThis: false }],
"prefer-const": ["error", { destructuring: "all" }],
"prefer-exponentiation-operator": "error",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-regex-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"require-await": "error",
"require-yield": "error",
"sort-imports": [
"error",
{
allowSeparatedGroups: true,
ignoreCase: false,
ignoreDeclarationSort: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["single", "all", "multiple", "none"],
},
],
"spaced-comment": "error",
"strict": ["error", "global"],
"yoda": ["error", "never", { onlyEquality: true }],
"array-bracket-newline": ["error", "consistent"],
"array-bracket-spacing": ["error", "never"],
"array-element-newline": ["error", "consistent"],
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"block-spacing": "error",
"brace-style": "error",
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": [
"error",
{
after: true,
before: false,
},
],
"comma-style": "error",
"computed-property-spacing": ["error", "never"],
"dot-location": ["error", "property"],
"eol-last": ["error", "always"],
"func-call-spacing": ["error", "never"],
"function-call-argument-newline": ["error", "consistent"],
"function-paren-newline": ["error", "multiline-arguments"],
"generator-star-spacing": ["error", "after"],
"implicit-arrow-linebreak": ["error", "beside"],
"indent": ["error", "tab"],
"key-spacing": ["error", { afterColon: true }],
"keyword-spacing": [
"error",
{
after: true,
before: true,
},
],
"linebreak-style": ["error", "unix"],
"lines-between-class-members": ["error", "always"],
"max-len": [
"error",
{
code: 140,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
tabWidth: 4,
},
],
"max-statements-per-line": ["error", { max: 1 }],
"multiline-ternary": ["error", "always-multiline"],
"new-parens": ["error", "always"],
"newline-per-chained-call": ["error", { ignoreChainWithDepth: 2 }],
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
"no-multiple-empty-lines": [
"error",
{
max: 2,
maxBOF: 0,
maxEOF: 0,
},
],
"no-tabs": ["error", { allowIndentationTabs: true }],
"no-trailing-spaces": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": ["error", { multiline: true }],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"operator-linebreak": ["error", "before"],
"padded-blocks": ["error", "never"],
"quotes": ["error", "double", { allowTemplateLiterals: true }],
"rest-spread-spacing": ["error", "never"],
"semi": ["error", "always"],
"semi-spacing": "error",
"semi-style": ["error", "last"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": "error",
"switch-colon-spacing": "error",
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
"unicode-bom": ["error", "never"],
"wrap-iife": ["error", "outside"],
"yield-star-spacing": ["error", "after"],
},
settings: { react: { version: "18" } },
};