-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
231 lines (202 loc) · 6.8 KB
/
index.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
import js from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import arrayFunc from "eslint-plugin-array-func";
import jsdoc from "eslint-plugin-jsdoc";
import n from "eslint-plugin-n";
import regexp from "eslint-plugin-regexp";
import sortClassMembers from "eslint-plugin-sort-class-members";
export default [
/**
* @see {@link https://www.npmjs.com/package/@eslint/js}
* @see {@link https://eslint.org/docs/latest/rules/}
*/
js.configs.recommended,
/**
* @see {@link https://eslint.style/guide/config-presets}
* @see {@link https://eslint.style/packages/default}
*/
stylistic.configs["recommended-flat"],
/**
* @see {@link https://www.npmjs.com/package/eslint-plugin-array-func}
*/
arrayFunc.configs.all,
/**
* @see {@link https://www.npmjs.com/package/eslint-plugin-jsdoc}
*/
jsdoc.configs["flat/recommended"],
/**
* @see {@link https://www.npmjs.com/package/eslint-plugin-n}
*/
n.configs["flat/recommended"],
/**
* @see {@link https://www.npmjs.com/package/eslint-plugin-regexp}
*/
regexp.configs["flat/recommended"],
/**
* @see {@link https://www.npmjs.com/package/eslint-plugin-sort-class-members}
*/
sortClassMembers.configs["flat/recommended"],
/**
* @see {@link https://www.npmjs.com/package/@cargosense/eslint-config}
*/
{
rules: {
/**
* Enforce consistent line breaks between array elements.
*
* @see {@link https://eslint.style/rules/default/array-element-newline}
*/
"@stylistic/array-element-newline": ["error", "consistent"],
/**
* Enforce consistent brace style for blocks.
*
* @see {@link https://eslint.style/rules/default/brace-style}
*/
"@stylistic/brace-style": ["error", "1tbs"],
/**
* Enforce consistent usage of line breaks between arguments of a function
* call.
*
* @see {@link https://eslint.style/rules/js/function-call-argument-newline}
*/
"@stylistic/function-call-argument-newline": ["error", "consistent"],
/**
* Disallow spaces between the function name and the opening parenthesis
* that calls it.
*
* @see {@link https://eslint.style/rules/default/function-call-spacing}
*/
"@stylistic/function-call-spacing": ["error"],
/**
* Enforce a consistent location for an arrow function containing an
* implicit return.
*
* @see {@link https://eslint.style/rules/default/implicit-arrow-linebreak}
*/
"@stylistic/implicit-arrow-linebreak": "error",
/**
* Enforce consistent line endings independent of operating system, VCS,
* or editor.
*
* @see {@link https://eslint.style/rules/default/linebreak-style}
*/
"@stylistic/linebreak-style": "warn",
/**
* Enforce a maximum line length to increase code readability and
* maintainability.
*
* @see {@link https://eslint.style/rules/default/max-len}
*/
"@stylistic/max-len": ["warn", {
code: 120,
comments: 80,
ignoreUrls: true,
tabWidth: 2,
}],
/**
* Disallow unnecessary semicolons.
*
* @see {@link https://eslint.style/rules/default/no-extra-semi}
*/
"@stylistic/no-extra-semi": "error",
/**
* Warns against using the arrow function syntax in places where it could
* be confused with a comparison operator.
*
* @see {@link https://eslint.style/rules/default/no-confusing-arrow}
*/
"@stylistic/no-confusing-arrow": "warn",
/**
* Enforce a consistent linebreak style for operators.
*
* @see {@link https://eslint.style/rules/default/operator-linebreak}
*/
"@stylistic/operator-linebreak": ["error", "after"],
/**
* Disallow quotes around object literal property names that are not
* strictly required.
*
* @see {@link https://eslint.style/rules/default/quote-props}
*/
"@stylistic/quote-props": ["error", "as-needed"],
/**
* Enforce the consistent use of either double quotes.
*
* @see {@link https://eslint.style/rules/default/quotes}
*/
"@stylistic/quotes": ["error", "double", {
allowTemplateLiterals: true,
avoidEscape: false,
}],
/**
* Enforce consistent use of semicolons.
*
* @see {@link https://eslint.style/rules/default/semi}
*/
"@stylistic/semi": ["error", "always"],
/**
* Enforce consistent spacing before function parentheses.
*
* @see {@link https://eslint.style/rules/js/space-before-function-paren}
*/
"@stylistic/space-before-function-paren": ["error", {
anonymous: "never",
asyncArrow: "always",
named: "never",
}],
/**
* Control spacing around colons of `case` and `default` clauses in switch
* statements.
*
* @see {@link https://eslint.style/rules/default/switch-colon-spacing}
*/
"@stylistic/switch-colon-spacing": "error",
/**
* Sorts tags by a specified sequence according to tag name, optionally
* adding line breaks between tag groups.
*
* @see {@link https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/sort-tags.md}
*/
"jsdoc/sort-tags": ["warn", { alphabetizeExtras: true }],
/**
* Enforce lines (or no lines) between tags.
*
* @see {@link https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/tag-lines.md}
*/
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
/**
* Report unsupported Node.js built-in APIs on the configured Node.js
* version.
*
* @see {@link https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md}
*/
"n/no-unsupported-features/node-builtins": ["error", { allowExperimental: true }],
/**
* Disallow unused variables (excluding variables whose name begins with
* an underscore).
*
* @see {@link https://eslint.org/docs/latest/rules/no-unused-vars}
*/
"no-unused-vars": ["error", {
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
}],
/**
* Enforce sorted import declarations within modules.
*
* @see {@link https://eslint.org/docs/latest/rules/sort-imports}
*/
"sort-imports": ["error", { allowSeparatedGroups: true }],
/**
* Require object keys to be sorted.
*
* @see {@link https://eslint.org/docs/latest/rules/sort-keys}
*/
"sort-keys": ["error", "asc", {
allowLineSeparatedGroups: true,
caseSensitive: false,
natural: true,
}],
},
},
];