linted 16.12.2-rc.2 → 16.12.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/RELEASE.yml +35 -35
- package/.github/workflows/rc.yml +35 -35
- package/LICENSE +21 -21
- package/README.md +390 -390
- package/SECURITY.md +9 -9
- package/dist/imports/plugins.d.ts.map +1 -1
- package/dist/imports.d.ts.map +1 -1
- package/eslint.config.js +3 -3
- package/package.json +99 -99
- package/src/files/html.ts +1 -1
- package/src/files/js.ts +1 -1
- package/src/files/json.ts +1 -1
- package/src/files/jsonc.ts +4 -4
- package/src/files/md.ts +1 -1
- package/src/files/mocha.ts +1 -1
- package/src/files/svelte.ts +1 -1
- package/src/files/ts.ts +5 -5
- package/src/files/yml.ts +5 -5
- package/src/files.ts +22 -22
- package/src/imports/parsers.ts +15 -15
- package/src/imports/plugins.ts +19 -19
- package/src/imports.ts +8 -8
- package/src/index.ts +36 -36
- package/src/rules/_strings/id.ts +18 -18
- package/src/rules/_strings/level.ts +6 -6
- package/src/rules/_strings/state.ts +56 -56
- package/src/rules/_strings.ts +6 -6
- package/src/rules/html/enable.ts +16 -16
- package/src/rules/html/enable_recommended.ts +9 -9
- package/src/rules/html.ts +4 -4
- package/src/rules/js/enable.ts +524 -524
- package/src/rules/js/enable_stylistic.ts +608 -608
- package/src/rules/js.ts +4 -4
- package/src/rules/json/enable.ts +33 -33
- package/src/rules/json/enable_x.ts +89 -89
- package/src/rules/json.ts +4 -4
- package/src/rules/jsonc/override.ts +16 -16
- package/src/rules/jsonc.ts +4 -4
- package/src/rules/md/enable.ts +15 -15
- package/src/rules/md.ts +3 -3
- package/src/rules/mocha/enable.ts +3 -3
- package/src/rules/mocha/enable_recommended.ts +9 -9
- package/src/rules/mocha.ts +4 -4
- package/src/rules/svelte/disable.ts +9 -9
- package/src/rules/svelte/disable_js.ts +11 -11
- package/src/rules/svelte/disable_ts.ts +9 -9
- package/src/rules/svelte/enable.ts +228 -228
- package/src/rules/svelte/enable_x.ts +20 -20
- package/src/rules/svelte.ts +15 -15
- package/src/rules/ts/disable.ts +22 -22
- package/src/rules/ts/disable_x.ts +32 -32
- package/src/rules/ts/enable.ts +549 -549
- package/src/rules/ts/enable_x.ts +115 -115
- package/src/rules/ts.ts +13 -13
- package/src/rules/yml/enable.ts +64 -64
- package/src/rules/yml/enable_x.ts +68 -68
- package/src/rules/yml.ts +4 -4
- package/src/rules.ts +22 -22
- package/tsconfig.json +161 -161
- package/types/markdownlint/index.d.ts +3 -3
- package/types/markdownlint/parser.d.ts +9 -9
- package/types/mocha/index.d.ts +8 -8
- package/dist/rules/_html.d.ts +0 -8
- package/dist/rules/_html.d.ts.map +0 -1
- package/dist/rules/_html.js +0 -4
- package/dist/rules/_html.js.map +0 -1
- package/dist/rules/_js.d.ts +0 -765
- package/dist/rules/_js.d.ts.map +0 -1
- package/dist/rules/_js.js +0 -4
- package/dist/rules/_js.js.map +0 -1
- package/dist/rules/_json.d.ts +0 -74
- package/dist/rules/_json.d.ts.map +0 -1
- package/dist/rules/_json.js +0 -4
- package/dist/rules/_json.js.map +0 -1
- package/dist/rules/_jsonc.d.ts +0 -77
- package/dist/rules/_jsonc.d.ts.map +0 -1
- package/dist/rules/_jsonc.js +0 -4
- package/dist/rules/_jsonc.js.map +0 -1
- package/dist/rules/_md.d.ts +0 -7
- package/dist/rules/_md.d.ts.map +0 -1
- package/dist/rules/_md.js +0 -3
- package/dist/rules/_md.js.map +0 -1
- package/dist/rules/_mocha.d.ts +0 -8
- package/dist/rules/_mocha.d.ts.map +0 -1
- package/dist/rules/_mocha.js +0 -4
- package/dist/rules/_mocha.js.map +0 -1
- package/dist/rules/_svelte.d.ts +0 -1269
- package/dist/rules/_svelte.d.ts.map +0 -1
- package/dist/rules/_svelte.js +0 -15
- package/dist/rules/_svelte.js.map +0 -1
- package/dist/rules/_ts.d.ts +0 -1133
- package/dist/rules/_ts.d.ts.map +0 -1
- package/dist/rules/_ts.js +0 -13
- package/dist/rules/_ts.js.map +0 -1
- package/dist/rules/_yml.d.ts +0 -73
- package/dist/rules/_yml.d.ts.map +0 -1
- package/dist/rules/_yml.js +0 -4
- package/dist/rules/_yml.js.map +0 -1
- package/dist/rules/html/_enable.d.ts +0 -8
- package/dist/rules/html/_enable.d.ts.map +0 -1
- package/dist/rules/html/_enable.js +0 -10
- package/dist/rules/html/_enable.js.map +0 -1
- package/dist/rules/html/_recommended.d.ts +0 -3
- package/dist/rules/html/_recommended.d.ts.map +0 -1
- package/dist/rules/html/_recommended.js +0 -5
- package/dist/rules/html/_recommended.js.map +0 -1
- package/dist/rules/js/_enable.d.ts +0 -348
- package/dist/rules/js/_enable.d.ts.map +0 -1
- package/dist/rules/js/_enable.js +0 -260
- package/dist/rules/js/_enable.js.map +0 -1
- package/dist/rules/js/stylistic.d.ts +0 -420
- package/dist/rules/js/stylistic.d.ts.map +0 -1
- package/dist/rules/js/stylistic.js +0 -270
- package/dist/rules/js/stylistic.js.map +0 -1
- package/dist/rules/json/_enable.d.ts +0 -27
- package/dist/rules/json/_enable.d.ts.map +0 -1
- package/dist/rules/json/_enable.js +0 -31
- package/dist/rules/json/_enable.js.map +0 -1
- package/dist/rules/md/_enable.d.ts +0 -7
- package/dist/rules/md/_enable.d.ts.map +0 -1
- package/dist/rules/md/_enable.js +0 -9
- package/dist/rules/md/_enable.js.map +0 -1
- package/dist/rules/mocha/_enable.d.ts +0 -3
- package/dist/rules/mocha/_enable.d.ts.map +0 -1
- package/dist/rules/mocha/_enable.js +0 -4
- package/dist/rules/mocha/_enable.js.map +0 -1
- package/dist/rules/mocha/_recommended.d.ts +0 -3
- package/dist/rules/mocha/_recommended.d.ts.map +0 -1
- package/dist/rules/mocha/_recommended.js +0 -5
- package/dist/rules/mocha/_recommended.js.map +0 -1
- package/dist/rules/svelte/_enable.d.ts +0 -126
- package/dist/rules/svelte/_enable.d.ts.map +0 -1
- package/dist/rules/svelte/_enable.js +0 -90
- package/dist/rules/svelte/_enable.js.map +0 -1
- package/dist/rules/svelte/disable_x.d.ts +0 -5
- package/dist/rules/svelte/disable_x.d.ts.map +0 -1
- package/dist/rules/svelte/disable_x.js +0 -4
- package/dist/rules/svelte/disable_x.js.map +0 -1
- package/dist/rules/ts/_enable.d.ts +0 -262
- package/dist/rules/ts/_enable.d.ts.map +0 -1
- package/dist/rules/ts/_enable.js +0 -359
- package/dist/rules/ts/_enable.js.map +0 -1
- package/dist/rules/ts/disable_compiler.d.ts +0 -18
- package/dist/rules/ts/disable_compiler.d.ts.map +0 -1
- package/dist/rules/ts/disable_compiler.js +0 -22
- package/dist/rules/ts/disable_compiler.js.map +0 -1
- package/dist/rules/yml/_enable.d.ts +0 -39
- package/dist/rules/yml/_enable.d.ts.map +0 -1
- package/dist/rules/yml/_enable.js +0 -28
- package/dist/rules/yml/_enable.js.map +0 -1
package/src/rules/js/enable.ts
CHANGED
@@ -1,524 +1,524 @@
|
|
1
|
-
import { enable, level, state } from "../_strings.js";
|
2
|
-
|
3
|
-
const
|
4
|
-
{ ERROR, OFF } = level,
|
5
|
-
{
|
6
|
-
Never,
|
7
|
-
Always,
|
8
|
-
AsNeeded,
|
9
|
-
Consecutive,
|
10
|
-
Allow,
|
11
|
-
All,
|
12
|
-
Multi,
|
13
|
-
Both,
|
14
|
-
} = state;
|
15
|
-
|
16
|
-
export default [
|
17
|
-
enable,
|
18
|
-
{
|
19
|
-
// #region Problems
|
20
|
-
// https://eslint.org/docs/latest/rules/#possible-problems
|
21
|
-
"array-callback-return": [
|
22
|
-
ERROR,
|
23
|
-
{
|
24
|
-
allowImplicit: false,
|
25
|
-
checkForEach: true,
|
26
|
-
allowVoid: true,
|
27
|
-
},
|
28
|
-
],
|
29
|
-
"constructor-super": ERROR, /* tsc */
|
30
|
-
"for-direction": ERROR,
|
31
|
-
"getter-return": [
|
32
|
-
ERROR,
|
33
|
-
{
|
34
|
-
allowImplicit: false,
|
35
|
-
},
|
36
|
-
], /* tsc */
|
37
|
-
"no-async-promise-executor": ERROR,
|
38
|
-
"no-await-in-loop": ERROR,
|
39
|
-
"no-class-assign": ERROR,
|
40
|
-
"no-compare-neg-zero": ERROR,
|
41
|
-
"no-cond-assign": [ERROR, Always],
|
42
|
-
"no-const-assign": ERROR, /* tsc */
|
43
|
-
"no-constant-binary-expression": ERROR,
|
44
|
-
"no-constant-condition": [
|
45
|
-
ERROR,
|
46
|
-
{
|
47
|
-
checkLoops: true,
|
48
|
-
},
|
49
|
-
] /* BUG: incorrect option description (claims "all" is ok): https://eslint.org/docs/latest/rules/no-constant-condition */,
|
50
|
-
"no-constructor-return": ERROR,
|
51
|
-
"no-control-regex": ERROR,
|
52
|
-
"no-debugger": ERROR,
|
53
|
-
"no-dupe-args": ERROR, /* tsc */
|
54
|
-
"no-dupe-class-members": ERROR, /* tsc -- TSLint:off: tsc */
|
55
|
-
"no-dupe-else-if": ERROR,
|
56
|
-
"no-dupe-keys": ERROR, /* tsc */
|
57
|
-
"no-duplicate-case": ERROR,
|
58
|
-
"no-duplicate-imports": OFF /* BUG: breaks separation of TS type-only imports from value imports */,
|
59
|
-
"no-empty-character-class": ERROR,
|
60
|
-
"no-empty-pattern": [
|
61
|
-
ERROR,
|
62
|
-
{
|
63
|
-
allowObjectPatternsAsParameters: false,
|
64
|
-
},
|
65
|
-
],
|
66
|
-
"no-ex-assign": ERROR,
|
67
|
-
"no-fallthrough": [
|
68
|
-
ERROR,
|
69
|
-
{
|
70
|
-
allowEmptyCase: true,
|
71
|
-
reportUnusedFallthroughComment: true,
|
72
|
-
},
|
73
|
-
],
|
74
|
-
"no-func-assign": ERROR, /* tsc */
|
75
|
-
"no-import-assign": ERROR, /* tsc (except Object.assign()) */
|
76
|
-
"no-inner-declarations": [
|
77
|
-
ERROR,
|
78
|
-
Both,
|
79
|
-
{
|
80
|
-
blockScopedFunctions: Allow,
|
81
|
-
},
|
82
|
-
],
|
83
|
-
"no-invalid-regexp": [
|
84
|
-
ERROR,
|
85
|
-
{
|
86
|
-
allowConstructorFlags: [],
|
87
|
-
},
|
88
|
-
],
|
89
|
-
"no-irregular-whitespace": [
|
90
|
-
ERROR,
|
91
|
-
{
|
92
|
-
skipStrings: true,
|
93
|
-
skipComments: true,
|
94
|
-
skipRegExps: true,
|
95
|
-
skipTemplates: true,
|
96
|
-
skipJSXText: true,
|
97
|
-
},
|
98
|
-
],
|
99
|
-
"no-loss-of-precision": ERROR /* TSLint */,
|
100
|
-
"no-misleading-character-class": ERROR,
|
101
|
-
"no-new-native-nonconstructor": ERROR,
|
102
|
-
"no-obj-calls": ERROR, /* tsc */
|
103
|
-
"no-promise-executor-return": [
|
104
|
-
ERROR,
|
105
|
-
{
|
106
|
-
allowVoid: true,
|
107
|
-
},
|
108
|
-
],
|
109
|
-
"no-prototype-builtins": ERROR,
|
110
|
-
"no-self-assign": [
|
111
|
-
ERROR,
|
112
|
-
{
|
113
|
-
props: true,
|
114
|
-
},
|
115
|
-
],
|
116
|
-
"no-self-compare": ERROR,
|
117
|
-
"no-setter-return": ERROR, /* tsc */
|
118
|
-
"no-sparse-arrays": ERROR,
|
119
|
-
"no-template-curly-in-string": ERROR,
|
120
|
-
"no-this-before-super": ERROR, /* tsc */
|
121
|
-
"no-undef": ERROR, /* tsc */
|
122
|
-
"no-unexpected-multiline": ERROR,
|
123
|
-
"no-unmodified-loop-condition": ERROR,
|
124
|
-
"no-unreachable": ERROR, /* tsc */
|
125
|
-
"no-unreachable-loop": [
|
126
|
-
ERROR,
|
127
|
-
{
|
128
|
-
ignore: [] /* WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement */,
|
129
|
-
},
|
130
|
-
],
|
131
|
-
"no-unsafe-finally": ERROR,
|
132
|
-
"no-unsafe-negation": [
|
133
|
-
ERROR,
|
134
|
-
{
|
135
|
-
enforceForOrderingRelations: true,
|
136
|
-
},
|
137
|
-
], /* tsc */
|
138
|
-
"no-unsafe-optional-chaining": [
|
139
|
-
ERROR,
|
140
|
-
{
|
141
|
-
disallowArithmeticOperators: true,
|
142
|
-
},
|
143
|
-
],
|
144
|
-
"no-unused-private-class-members": ERROR,
|
145
|
-
"no-unused-vars": [
|
146
|
-
ERROR,
|
147
|
-
{
|
148
|
-
vars: All,
|
149
|
-
args: All,
|
150
|
-
caughtErrors: All,
|
151
|
-
ignoreRestSiblings: false,
|
152
|
-
ignoreClassWithStaticInitBlock: false,
|
153
|
-
reportUsedIgnorePattern: true,
|
154
|
-
},
|
155
|
-
] /* TSLint */,
|
156
|
-
"no-use-before-define": [
|
157
|
-
ERROR,
|
158
|
-
{
|
159
|
-
functions: true,
|
160
|
-
classes: true,
|
161
|
-
variables: true,
|
162
|
-
allowNamedExports: false,
|
163
|
-
},
|
164
|
-
] /* TSLint */,
|
165
|
-
"no-useless-assignment": ERROR,
|
166
|
-
"no-useless-backreference": ERROR,
|
167
|
-
"require-atomic-updates": [
|
168
|
-
ERROR,
|
169
|
-
{
|
170
|
-
allowProperties: false,
|
171
|
-
},
|
172
|
-
],
|
173
|
-
"use-isnan": [
|
174
|
-
ERROR,
|
175
|
-
{
|
176
|
-
enforceForSwitchCase: true,
|
177
|
-
enforceForIndexOf: true,
|
178
|
-
},
|
179
|
-
],
|
180
|
-
"valid-typeof": [
|
181
|
-
ERROR,
|
182
|
-
{
|
183
|
-
requireStringLiterals: true,
|
184
|
-
},
|
185
|
-
],
|
186
|
-
|
187
|
-
// #endregion
|
188
|
-
|
189
|
-
// #region Suggestions
|
190
|
-
// [ https://eslint.org/docs/latest/rules/#suggestions ]
|
191
|
-
"accessor-pairs": [
|
192
|
-
ERROR,
|
193
|
-
{
|
194
|
-
setWithoutGet: true,
|
195
|
-
getWithoutSet: false,
|
196
|
-
enforceForClassMembers: true,
|
197
|
-
},
|
198
|
-
],
|
199
|
-
"arrow-body-style": [
|
200
|
-
ERROR,
|
201
|
-
AsNeeded,
|
202
|
-
{
|
203
|
-
requireReturnForObjectLiteral: true,
|
204
|
-
},
|
205
|
-
],
|
206
|
-
"block-scoped-var": ERROR,
|
207
|
-
camelcase: OFF /* preference */,
|
208
|
-
"capitalized-comments": OFF /* preference */,
|
209
|
-
"class-methods-use-this": OFF, /* preference -- TSLint */
|
210
|
-
complexity: OFF /* preference */,
|
211
|
-
"consistent-return": [
|
212
|
-
ERROR,
|
213
|
-
{
|
214
|
-
treatUndefinedAsUnspecified: false,
|
215
|
-
},
|
216
|
-
] /* tsc -- TSLint:off: tsconfig: noImplicitReturns */,
|
217
|
-
"consistent-this": ERROR,
|
218
|
-
curly: [ERROR, Multi],
|
219
|
-
"default-case": OFF, /* preference: don't care */
|
220
|
-
"default-case-last": ERROR,
|
221
|
-
"default-param-last": ERROR /* TSLint */,
|
222
|
-
"dot-notation": [
|
223
|
-
ERROR,
|
224
|
-
{
|
225
|
-
allowKeywords: true,
|
226
|
-
},
|
227
|
-
] /* TSLint */,
|
228
|
-
eqeqeq: [ERROR, Always],
|
229
|
-
"func-name-matching": OFF /* preference */,
|
230
|
-
"func-names": OFF /* preference */,
|
231
|
-
"func-style": OFF /* preference */,
|
232
|
-
"grouped-accessor-pairs": OFF /* preference -- BUG: requires adjacency, not as described in documentation */,
|
233
|
-
"guard-for-in": OFF, /* preference - not helpful because using for-in on non-literal objects is bad practice and this rule doesn't guard against that anyway, while adding a pointless check to known object literals */
|
234
|
-
"id-denylist": OFF /* preference */,
|
235
|
-
"id-length": OFF /* preference */,
|
236
|
-
"id-match": OFF /* preference */,
|
237
|
-
"init-declarations": [ERROR, Always] /* TSLint */,
|
238
|
-
"logical-assignment-operators": [
|
239
|
-
ERROR,
|
240
|
-
Always,
|
241
|
-
{
|
242
|
-
enforceForIfStatements: true,
|
243
|
-
},
|
244
|
-
],
|
245
|
-
"max-classes-per-file": OFF /* preference */,
|
246
|
-
"max-depth": OFF /* preference */,
|
247
|
-
"max-lines": OFF /* preference */,
|
248
|
-
"max-lines-per-function": OFF /* preference */,
|
249
|
-
"max-nested-callbacks": OFF /* preference */,
|
250
|
-
"max-params": OFF, /* preference -- TSLint:off: preference */
|
251
|
-
"max-statements": OFF /* preference */,
|
252
|
-
"multiline-comment-style": OFF /* preference */,
|
253
|
-
"new-cap": OFF, /* preference -- breaks Scriptable */
|
254
|
-
"no-alert": ERROR,
|
255
|
-
"no-array-constructor": ERROR /* TSLint */,
|
256
|
-
"no-bitwise": [
|
257
|
-
ERROR,
|
258
|
-
{
|
259
|
-
allow: [],
|
260
|
-
int32Hint: true,
|
261
|
-
},
|
262
|
-
],
|
263
|
-
"no-caller": ERROR,
|
264
|
-
"no-case-declarations": ERROR,
|
265
|
-
"no-console": OFF, /* preference -- breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */
|
266
|
-
"no-continue": ERROR,
|
267
|
-
"no-delete-var": ERROR,
|
268
|
-
"no-div-regex": ERROR,
|
269
|
-
"no-else-return": OFF /* preference */,
|
270
|
-
"no-empty": [
|
271
|
-
ERROR,
|
272
|
-
{
|
273
|
-
allowEmptyCatch: false,
|
274
|
-
},
|
275
|
-
],
|
276
|
-
"no-empty-function": [
|
277
|
-
ERROR,
|
278
|
-
{
|
279
|
-
allow:
|
280
|
-
["constructors"] /** functions, arrowFunctions, generatorFunctions, methods, generatorMethods, getters, setters, constructors, asyncFunctions, asyncMethods; TS-ONLY: private-constructors, protected-constructors, decoratedFunctions, overrideMethods */,
|
281
|
-
},
|
282
|
-
] /* TSLint */,
|
283
|
-
"no-empty-static-block": ERROR,
|
284
|
-
"no-eq-null": ERROR,
|
285
|
-
"no-eval": [
|
286
|
-
ERROR,
|
287
|
-
{
|
288
|
-
allowIndirect: false,
|
289
|
-
},
|
290
|
-
],
|
291
|
-
"no-extend-native": [
|
292
|
-
ERROR,
|
293
|
-
{
|
294
|
-
exceptions: [],
|
295
|
-
},
|
296
|
-
],
|
297
|
-
"no-extra-bind": ERROR,
|
298
|
-
"no-extra-boolean-cast": [
|
299
|
-
ERROR,
|
300
|
-
{
|
301
|
-
enforceForLogicalOperands: true,
|
302
|
-
},
|
303
|
-
],
|
304
|
-
"no-extra-label": ERROR,
|
305
|
-
"no-global-assign": [
|
306
|
-
ERROR,
|
307
|
-
{
|
308
|
-
exceptions: [],
|
309
|
-
},
|
310
|
-
],
|
311
|
-
"no-implicit-coercion": [
|
312
|
-
ERROR,
|
313
|
-
{
|
314
|
-
"boolean": true,
|
315
|
-
number: true,
|
316
|
-
string: true,
|
317
|
-
disallowTemplateShorthand: true,
|
318
|
-
allow: [] /** "~" | "!!" | "+" | "- -" | "-" | "*" */,
|
319
|
-
},
|
320
|
-
],
|
321
|
-
"no-implicit-globals": OFF /* investigate (breaks Scriptable? breaks Sveltekit?) */,
|
322
|
-
"no-implied-eval": ERROR /* TSLint */,
|
323
|
-
"no-inline-comments": OFF /* preference */,
|
324
|
-
"no-invalid-this": [ERROR, { capIsConstructor: false }] /* TSLint:off: tsconfig: { strict, noImplicitThis } */,
|
325
|
-
"no-iterator": ERROR,
|
326
|
-
"no-label-var": ERROR,
|
327
|
-
"no-lone-blocks": ERROR,
|
328
|
-
"no-lonely-if": OFF /* preference */,
|
329
|
-
"no-loop-func": ERROR /* TSLint */,
|
330
|
-
"no-magic-numbers": OFF /* preference - breaks TypeScript number literals, even with most liberal exceptions */,
|
331
|
-
"no-multi-assign": [
|
332
|
-
ERROR,
|
333
|
-
{
|
334
|
-
ignoreNonDeclaration: false,
|
335
|
-
},
|
336
|
-
],
|
337
|
-
"no-multi-str": ERROR,
|
338
|
-
"no-negated-condition": OFF /* preference */,
|
339
|
-
"no-nested-ternary": OFF /* preference */,
|
340
|
-
"no-new": ERROR,
|
341
|
-
"no-new-func": ERROR,
|
342
|
-
"no-new-wrappers": ERROR,
|
343
|
-
"no-nonoctal-decimal-escape": ERROR,
|
344
|
-
"no-object-constructor": ERROR,
|
345
|
-
"no-octal": ERROR,
|
346
|
-
"no-octal-escape": ERROR,
|
347
|
-
"no-param-reassign": [
|
348
|
-
ERROR,
|
349
|
-
{
|
350
|
-
props: true,
|
351
|
-
ignorePropertyModificationsFor: [],
|
352
|
-
ignorePropertyModificationsForRegex: [],
|
353
|
-
},
|
354
|
-
],
|
355
|
-
"no-plusplus": [
|
356
|
-
ERROR,
|
357
|
-
{
|
358
|
-
allowForLoopAfterthoughts: true,
|
359
|
-
},
|
360
|
-
],
|
361
|
-
"no-proto": ERROR,
|
362
|
-
"no-redeclare": [ERROR, { builtinGlobals: true }] /* tsc -- TSLint:off: tsc (let, const, -var) */,
|
363
|
-
"no-regex-spaces": OFF /* preference */,
|
364
|
-
"no-restricted-exports": OFF /* preference */,
|
365
|
-
"no-restricted-globals": OFF /* preference */,
|
366
|
-
"no-restricted-imports": OFF /* preference -- TSLint:off */,
|
367
|
-
"no-restricted-properties": OFF /* preference */,
|
368
|
-
"no-restricted-syntax": OFF /* preference */,
|
369
|
-
"no-return-assign": [ERROR, Always] /* ALWAYS | "except-parens" (disallow assignments unless enclosed in parens) */,
|
370
|
-
"no-script-url": ERROR,
|
371
|
-
"no-sequences": [
|
372
|
-
ERROR,
|
373
|
-
{
|
374
|
-
allowInParentheses: true,
|
375
|
-
},
|
376
|
-
],
|
377
|
-
"no-shadow": OFF /* investigate -- TSLint:off: investigate */,
|
378
|
-
"no-shadow-restricted-names": ERROR,
|
379
|
-
"no-ternary": OFF /* preference */,
|
380
|
-
"no-throw-literal": ERROR /* TSLint */,
|
381
|
-
"no-undef-init": ERROR,
|
382
|
-
"no-undefined": OFF /* investigate (breaks Scriptable? breaks Sveltekit?) */,
|
383
|
-
"no-underscore-dangle": OFF /* preference */,
|
384
|
-
"no-unneeded-ternary": [
|
385
|
-
ERROR,
|
386
|
-
{
|
387
|
-
defaultAssignment: false,
|
388
|
-
},
|
389
|
-
],
|
390
|
-
"no-unused-expressions": [
|
391
|
-
ERROR,
|
392
|
-
{
|
393
|
-
allowShortCircuit: true,
|
394
|
-
allowTernary: true,
|
395
|
-
allowTaggedTemplates: true,
|
396
|
-
enforceForJSX: false,
|
397
|
-
},
|
398
|
-
] /* TSLint */,
|
399
|
-
"no-unused-labels": ERROR,
|
400
|
-
"no-useless-call": ERROR,
|
401
|
-
"no-useless-catch": ERROR,
|
402
|
-
"no-useless-computed-key": [
|
403
|
-
ERROR,
|
404
|
-
{
|
405
|
-
enforceForClassMembers: true,
|
406
|
-
},
|
407
|
-
],
|
408
|
-
"no-useless-concat": ERROR,
|
409
|
-
"no-useless-constructor": ERROR /* TSLint */,
|
410
|
-
"no-useless-escape": ERROR,
|
411
|
-
"no-useless-rename": [
|
412
|
-
ERROR,
|
413
|
-
{
|
414
|
-
ignoreImport: false,
|
415
|
-
ignoreExport: false,
|
416
|
-
ignoreDestructuring: false,
|
417
|
-
},
|
418
|
-
],
|
419
|
-
"no-useless-return": ERROR,
|
420
|
-
"no-var": ERROR,
|
421
|
-
"no-void": [
|
422
|
-
ERROR,
|
423
|
-
{
|
424
|
-
allowAsStatement: true,
|
425
|
-
|
426
|
-
},
|
427
|
-
],
|
428
|
-
"no-warning-comments": OFF /* preference */,
|
429
|
-
"no-with": ERROR,
|
430
|
-
"object-shorthand": [
|
431
|
-
ERROR,
|
432
|
-
Always,
|
433
|
-
{
|
434
|
-
avoidQuotes: true,
|
435
|
-
ignoreConstructors: false,
|
436
|
-
avoidExplicitReturnArrows: false,
|
437
|
-
},
|
438
|
-
],
|
439
|
-
"one-var": [
|
440
|
-
ERROR,
|
441
|
-
{
|
442
|
-
"var": Consecutive,
|
443
|
-
let: Consecutive,
|
444
|
-
"const": Consecutive,
|
445
|
-
separateRequires: true,
|
446
|
-
},
|
447
|
-
],
|
448
|
-
"operator-assignment": [ERROR, Always],
|
449
|
-
"prefer-arrow-callback": [
|
450
|
-
ERROR,
|
451
|
-
{
|
452
|
-
allowNamedFunctions: false,
|
453
|
-
allowUnboundThis: true,
|
454
|
-
},
|
455
|
-
],
|
456
|
-
"prefer-const": [
|
457
|
-
ERROR,
|
458
|
-
{
|
459
|
-
destructuring: All,
|
460
|
-
ignoreReadBeforeAssign: false,
|
461
|
-
},
|
462
|
-
],
|
463
|
-
"prefer-destructuring": [
|
464
|
-
ERROR,
|
465
|
-
{
|
466
|
-
VariableDeclarator: {
|
467
|
-
array: true,
|
468
|
-
object: true,
|
469
|
-
},
|
470
|
-
AssignmentExpression: {
|
471
|
-
array: false,
|
472
|
-
object: false,
|
473
|
-
},
|
474
|
-
},
|
475
|
-
{ enforceForRenamedProperties: true },
|
476
|
-
] /* TSLint */,
|
477
|
-
"prefer-exponentiation-operator": ERROR,
|
478
|
-
"prefer-named-capture-group": OFF,
|
479
|
-
"prefer-numeric-literals": ERROR,
|
480
|
-
"prefer-object-has-own": ERROR,
|
481
|
-
"prefer-object-spread": ERROR,
|
482
|
-
"prefer-promise-reject-errors": [
|
483
|
-
ERROR,
|
484
|
-
{
|
485
|
-
allowEmptyReject: false,
|
486
|
-
},
|
487
|
-
],
|
488
|
-
"prefer-regex-literals": [
|
489
|
-
ERROR,
|
490
|
-
{
|
491
|
-
disallowRedundantWrapping: true,
|
492
|
-
},
|
493
|
-
] /* TSLint */,
|
494
|
-
"prefer-rest-params": ERROR,
|
495
|
-
"prefer-spread": ERROR,
|
496
|
-
"prefer-template": ERROR,
|
497
|
-
radix: [ERROR, AsNeeded],
|
498
|
-
"require-await": ERROR /* TSLint */,
|
499
|
-
"require-unicode-regexp": ERROR,
|
500
|
-
"require-yield": ERROR,
|
501
|
-
"sort-imports": OFF /* preference */,
|
502
|
-
"sort-keys": OFF /* preference */,
|
503
|
-
"sort-vars": OFF /* preference */,
|
504
|
-
strict: OFF /* preference */,
|
505
|
-
"symbol-description": OFF /* preference */,
|
506
|
-
"vars-on-top": ERROR,
|
507
|
-
yoda: [
|
508
|
-
ERROR,
|
509
|
-
Never,
|
510
|
-
{
|
511
|
-
exceptRange: false,
|
512
|
-
onlyEquality: false,
|
513
|
-
},
|
514
|
-
],
|
515
|
-
|
516
|
-
// #endregion
|
517
|
-
|
518
|
-
// #region Layout & Formatting
|
519
|
-
// [ https://eslint.org/docs/latest/rules/#layout--formatting ]
|
520
|
-
"unicode-bom": OFF /* preference: don't care */,
|
521
|
-
|
522
|
-
// #endregion
|
523
|
-
},
|
524
|
-
] as const;
|
1
|
+
import { enable, level, state } from "../_strings.js";
|
2
|
+
|
3
|
+
const
|
4
|
+
{ ERROR, OFF } = level,
|
5
|
+
{
|
6
|
+
Never,
|
7
|
+
Always,
|
8
|
+
AsNeeded,
|
9
|
+
Consecutive,
|
10
|
+
Allow,
|
11
|
+
All,
|
12
|
+
Multi,
|
13
|
+
Both,
|
14
|
+
} = state;
|
15
|
+
|
16
|
+
export default [
|
17
|
+
enable,
|
18
|
+
{
|
19
|
+
// #region Problems
|
20
|
+
// https://eslint.org/docs/latest/rules/#possible-problems
|
21
|
+
"array-callback-return": [
|
22
|
+
ERROR,
|
23
|
+
{
|
24
|
+
allowImplicit: false,
|
25
|
+
checkForEach: true,
|
26
|
+
allowVoid: true,
|
27
|
+
},
|
28
|
+
],
|
29
|
+
"constructor-super": ERROR, /* tsc */
|
30
|
+
"for-direction": ERROR,
|
31
|
+
"getter-return": [
|
32
|
+
ERROR,
|
33
|
+
{
|
34
|
+
allowImplicit: false,
|
35
|
+
},
|
36
|
+
], /* tsc */
|
37
|
+
"no-async-promise-executor": ERROR,
|
38
|
+
"no-await-in-loop": ERROR,
|
39
|
+
"no-class-assign": ERROR,
|
40
|
+
"no-compare-neg-zero": ERROR,
|
41
|
+
"no-cond-assign": [ERROR, Always],
|
42
|
+
"no-const-assign": ERROR, /* tsc */
|
43
|
+
"no-constant-binary-expression": ERROR,
|
44
|
+
"no-constant-condition": [
|
45
|
+
ERROR,
|
46
|
+
{
|
47
|
+
checkLoops: true,
|
48
|
+
},
|
49
|
+
] /* BUG: incorrect option description (claims "all" is ok): https://eslint.org/docs/latest/rules/no-constant-condition */,
|
50
|
+
"no-constructor-return": ERROR,
|
51
|
+
"no-control-regex": ERROR,
|
52
|
+
"no-debugger": ERROR,
|
53
|
+
"no-dupe-args": ERROR, /* tsc */
|
54
|
+
"no-dupe-class-members": ERROR, /* tsc -- TSLint:off: tsc */
|
55
|
+
"no-dupe-else-if": ERROR,
|
56
|
+
"no-dupe-keys": ERROR, /* tsc */
|
57
|
+
"no-duplicate-case": ERROR,
|
58
|
+
"no-duplicate-imports": OFF /* BUG: breaks separation of TS type-only imports from value imports */,
|
59
|
+
"no-empty-character-class": ERROR,
|
60
|
+
"no-empty-pattern": [
|
61
|
+
ERROR,
|
62
|
+
{
|
63
|
+
allowObjectPatternsAsParameters: false,
|
64
|
+
},
|
65
|
+
],
|
66
|
+
"no-ex-assign": ERROR,
|
67
|
+
"no-fallthrough": [
|
68
|
+
ERROR,
|
69
|
+
{
|
70
|
+
allowEmptyCase: true,
|
71
|
+
reportUnusedFallthroughComment: true,
|
72
|
+
},
|
73
|
+
],
|
74
|
+
"no-func-assign": ERROR, /* tsc */
|
75
|
+
"no-import-assign": ERROR, /* tsc (except Object.assign()) */
|
76
|
+
"no-inner-declarations": [
|
77
|
+
ERROR,
|
78
|
+
Both,
|
79
|
+
{
|
80
|
+
blockScopedFunctions: Allow,
|
81
|
+
},
|
82
|
+
],
|
83
|
+
"no-invalid-regexp": [
|
84
|
+
ERROR,
|
85
|
+
{
|
86
|
+
allowConstructorFlags: [],
|
87
|
+
},
|
88
|
+
],
|
89
|
+
"no-irregular-whitespace": [
|
90
|
+
ERROR,
|
91
|
+
{
|
92
|
+
skipStrings: true,
|
93
|
+
skipComments: true,
|
94
|
+
skipRegExps: true,
|
95
|
+
skipTemplates: true,
|
96
|
+
skipJSXText: true,
|
97
|
+
},
|
98
|
+
],
|
99
|
+
"no-loss-of-precision": ERROR /* TSLint */,
|
100
|
+
"no-misleading-character-class": ERROR,
|
101
|
+
"no-new-native-nonconstructor": ERROR,
|
102
|
+
"no-obj-calls": ERROR, /* tsc */
|
103
|
+
"no-promise-executor-return": [
|
104
|
+
ERROR,
|
105
|
+
{
|
106
|
+
allowVoid: true,
|
107
|
+
},
|
108
|
+
],
|
109
|
+
"no-prototype-builtins": ERROR,
|
110
|
+
"no-self-assign": [
|
111
|
+
ERROR,
|
112
|
+
{
|
113
|
+
props: true,
|
114
|
+
},
|
115
|
+
],
|
116
|
+
"no-self-compare": ERROR,
|
117
|
+
"no-setter-return": ERROR, /* tsc */
|
118
|
+
"no-sparse-arrays": ERROR,
|
119
|
+
"no-template-curly-in-string": ERROR,
|
120
|
+
"no-this-before-super": ERROR, /* tsc */
|
121
|
+
"no-undef": ERROR, /* tsc */
|
122
|
+
"no-unexpected-multiline": ERROR,
|
123
|
+
"no-unmodified-loop-condition": ERROR,
|
124
|
+
"no-unreachable": ERROR, /* tsc */
|
125
|
+
"no-unreachable-loop": [
|
126
|
+
ERROR,
|
127
|
+
{
|
128
|
+
ignore: [] /* WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement */,
|
129
|
+
},
|
130
|
+
],
|
131
|
+
"no-unsafe-finally": ERROR,
|
132
|
+
"no-unsafe-negation": [
|
133
|
+
ERROR,
|
134
|
+
{
|
135
|
+
enforceForOrderingRelations: true,
|
136
|
+
},
|
137
|
+
], /* tsc */
|
138
|
+
"no-unsafe-optional-chaining": [
|
139
|
+
ERROR,
|
140
|
+
{
|
141
|
+
disallowArithmeticOperators: true,
|
142
|
+
},
|
143
|
+
],
|
144
|
+
"no-unused-private-class-members": ERROR,
|
145
|
+
"no-unused-vars": [
|
146
|
+
ERROR,
|
147
|
+
{
|
148
|
+
vars: All,
|
149
|
+
args: All,
|
150
|
+
caughtErrors: All,
|
151
|
+
ignoreRestSiblings: false,
|
152
|
+
ignoreClassWithStaticInitBlock: false,
|
153
|
+
reportUsedIgnorePattern: true,
|
154
|
+
},
|
155
|
+
] /* TSLint */,
|
156
|
+
"no-use-before-define": [
|
157
|
+
ERROR,
|
158
|
+
{
|
159
|
+
functions: true,
|
160
|
+
classes: true,
|
161
|
+
variables: true,
|
162
|
+
allowNamedExports: false,
|
163
|
+
},
|
164
|
+
] /* TSLint */,
|
165
|
+
"no-useless-assignment": ERROR,
|
166
|
+
"no-useless-backreference": ERROR,
|
167
|
+
"require-atomic-updates": [
|
168
|
+
ERROR,
|
169
|
+
{
|
170
|
+
allowProperties: false,
|
171
|
+
},
|
172
|
+
],
|
173
|
+
"use-isnan": [
|
174
|
+
ERROR,
|
175
|
+
{
|
176
|
+
enforceForSwitchCase: true,
|
177
|
+
enforceForIndexOf: true,
|
178
|
+
},
|
179
|
+
],
|
180
|
+
"valid-typeof": [
|
181
|
+
ERROR,
|
182
|
+
{
|
183
|
+
requireStringLiterals: true,
|
184
|
+
},
|
185
|
+
],
|
186
|
+
|
187
|
+
// #endregion
|
188
|
+
|
189
|
+
// #region Suggestions
|
190
|
+
// [ https://eslint.org/docs/latest/rules/#suggestions ]
|
191
|
+
"accessor-pairs": [
|
192
|
+
ERROR,
|
193
|
+
{
|
194
|
+
setWithoutGet: true,
|
195
|
+
getWithoutSet: false,
|
196
|
+
enforceForClassMembers: true,
|
197
|
+
},
|
198
|
+
],
|
199
|
+
"arrow-body-style": [
|
200
|
+
ERROR,
|
201
|
+
AsNeeded,
|
202
|
+
{
|
203
|
+
requireReturnForObjectLiteral: true,
|
204
|
+
},
|
205
|
+
],
|
206
|
+
"block-scoped-var": ERROR,
|
207
|
+
camelcase: OFF /* preference */,
|
208
|
+
"capitalized-comments": OFF /* preference */,
|
209
|
+
"class-methods-use-this": OFF, /* preference -- TSLint */
|
210
|
+
complexity: OFF /* preference */,
|
211
|
+
"consistent-return": [
|
212
|
+
ERROR,
|
213
|
+
{
|
214
|
+
treatUndefinedAsUnspecified: false,
|
215
|
+
},
|
216
|
+
] /* tsc -- TSLint:off: tsconfig: noImplicitReturns */,
|
217
|
+
"consistent-this": ERROR,
|
218
|
+
curly: [ERROR, Multi],
|
219
|
+
"default-case": OFF, /* preference: don't care */
|
220
|
+
"default-case-last": ERROR,
|
221
|
+
"default-param-last": ERROR /* TSLint */,
|
222
|
+
"dot-notation": [
|
223
|
+
ERROR,
|
224
|
+
{
|
225
|
+
allowKeywords: true,
|
226
|
+
},
|
227
|
+
] /* TSLint */,
|
228
|
+
eqeqeq: [ERROR, Always],
|
229
|
+
"func-name-matching": OFF /* preference */,
|
230
|
+
"func-names": OFF /* preference */,
|
231
|
+
"func-style": OFF /* preference */,
|
232
|
+
"grouped-accessor-pairs": OFF /* preference -- BUG: requires adjacency, not as described in documentation */,
|
233
|
+
"guard-for-in": OFF, /* preference - not helpful because using for-in on non-literal objects is bad practice and this rule doesn't guard against that anyway, while adding a pointless check to known object literals */
|
234
|
+
"id-denylist": OFF /* preference */,
|
235
|
+
"id-length": OFF /* preference */,
|
236
|
+
"id-match": OFF /* preference */,
|
237
|
+
"init-declarations": [ERROR, Always] /* TSLint */,
|
238
|
+
"logical-assignment-operators": [
|
239
|
+
ERROR,
|
240
|
+
Always,
|
241
|
+
{
|
242
|
+
enforceForIfStatements: true,
|
243
|
+
},
|
244
|
+
],
|
245
|
+
"max-classes-per-file": OFF /* preference */,
|
246
|
+
"max-depth": OFF /* preference */,
|
247
|
+
"max-lines": OFF /* preference */,
|
248
|
+
"max-lines-per-function": OFF /* preference */,
|
249
|
+
"max-nested-callbacks": OFF /* preference */,
|
250
|
+
"max-params": OFF, /* preference -- TSLint:off: preference */
|
251
|
+
"max-statements": OFF /* preference */,
|
252
|
+
"multiline-comment-style": OFF /* preference */,
|
253
|
+
"new-cap": OFF, /* preference -- breaks Scriptable */
|
254
|
+
"no-alert": ERROR,
|
255
|
+
"no-array-constructor": ERROR /* TSLint */,
|
256
|
+
"no-bitwise": [
|
257
|
+
ERROR,
|
258
|
+
{
|
259
|
+
allow: [],
|
260
|
+
int32Hint: true,
|
261
|
+
},
|
262
|
+
],
|
263
|
+
"no-caller": ERROR,
|
264
|
+
"no-case-declarations": ERROR,
|
265
|
+
"no-console": OFF, /* preference -- breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */
|
266
|
+
"no-continue": ERROR,
|
267
|
+
"no-delete-var": ERROR,
|
268
|
+
"no-div-regex": ERROR,
|
269
|
+
"no-else-return": OFF /* preference */,
|
270
|
+
"no-empty": [
|
271
|
+
ERROR,
|
272
|
+
{
|
273
|
+
allowEmptyCatch: false,
|
274
|
+
},
|
275
|
+
],
|
276
|
+
"no-empty-function": [
|
277
|
+
ERROR,
|
278
|
+
{
|
279
|
+
allow:
|
280
|
+
["constructors"] /** functions, arrowFunctions, generatorFunctions, methods, generatorMethods, getters, setters, constructors, asyncFunctions, asyncMethods; TS-ONLY: private-constructors, protected-constructors, decoratedFunctions, overrideMethods */,
|
281
|
+
},
|
282
|
+
] /* TSLint */,
|
283
|
+
"no-empty-static-block": ERROR,
|
284
|
+
"no-eq-null": ERROR,
|
285
|
+
"no-eval": [
|
286
|
+
ERROR,
|
287
|
+
{
|
288
|
+
allowIndirect: false,
|
289
|
+
},
|
290
|
+
],
|
291
|
+
"no-extend-native": [
|
292
|
+
ERROR,
|
293
|
+
{
|
294
|
+
exceptions: [],
|
295
|
+
},
|
296
|
+
],
|
297
|
+
"no-extra-bind": ERROR,
|
298
|
+
"no-extra-boolean-cast": [
|
299
|
+
ERROR,
|
300
|
+
{
|
301
|
+
enforceForLogicalOperands: true,
|
302
|
+
},
|
303
|
+
],
|
304
|
+
"no-extra-label": ERROR,
|
305
|
+
"no-global-assign": [
|
306
|
+
ERROR,
|
307
|
+
{
|
308
|
+
exceptions: [],
|
309
|
+
},
|
310
|
+
],
|
311
|
+
"no-implicit-coercion": [
|
312
|
+
ERROR,
|
313
|
+
{
|
314
|
+
"boolean": true,
|
315
|
+
number: true,
|
316
|
+
string: true,
|
317
|
+
disallowTemplateShorthand: true,
|
318
|
+
allow: [] /** "~" | "!!" | "+" | "- -" | "-" | "*" */,
|
319
|
+
},
|
320
|
+
],
|
321
|
+
"no-implicit-globals": OFF /* investigate (breaks Scriptable? breaks Sveltekit?) */,
|
322
|
+
"no-implied-eval": ERROR /* TSLint */,
|
323
|
+
"no-inline-comments": OFF /* preference */,
|
324
|
+
"no-invalid-this": [ERROR, { capIsConstructor: false }] /* TSLint:off: tsconfig: { strict, noImplicitThis } */,
|
325
|
+
"no-iterator": ERROR,
|
326
|
+
"no-label-var": ERROR,
|
327
|
+
"no-lone-blocks": ERROR,
|
328
|
+
"no-lonely-if": OFF /* preference */,
|
329
|
+
"no-loop-func": ERROR /* TSLint */,
|
330
|
+
"no-magic-numbers": OFF /* preference - breaks TypeScript number literals, even with most liberal exceptions */,
|
331
|
+
"no-multi-assign": [
|
332
|
+
ERROR,
|
333
|
+
{
|
334
|
+
ignoreNonDeclaration: false,
|
335
|
+
},
|
336
|
+
],
|
337
|
+
"no-multi-str": ERROR,
|
338
|
+
"no-negated-condition": OFF /* preference */,
|
339
|
+
"no-nested-ternary": OFF /* preference */,
|
340
|
+
"no-new": ERROR,
|
341
|
+
"no-new-func": ERROR,
|
342
|
+
"no-new-wrappers": ERROR,
|
343
|
+
"no-nonoctal-decimal-escape": ERROR,
|
344
|
+
"no-object-constructor": ERROR,
|
345
|
+
"no-octal": ERROR,
|
346
|
+
"no-octal-escape": ERROR,
|
347
|
+
"no-param-reassign": [
|
348
|
+
ERROR,
|
349
|
+
{
|
350
|
+
props: true,
|
351
|
+
ignorePropertyModificationsFor: [],
|
352
|
+
ignorePropertyModificationsForRegex: [],
|
353
|
+
},
|
354
|
+
],
|
355
|
+
"no-plusplus": [
|
356
|
+
ERROR,
|
357
|
+
{
|
358
|
+
allowForLoopAfterthoughts: true,
|
359
|
+
},
|
360
|
+
],
|
361
|
+
"no-proto": ERROR,
|
362
|
+
"no-redeclare": [ERROR, { builtinGlobals: true }] /* tsc -- TSLint:off: tsc (let, const, -var) */,
|
363
|
+
"no-regex-spaces": OFF /* preference */,
|
364
|
+
"no-restricted-exports": OFF /* preference */,
|
365
|
+
"no-restricted-globals": OFF /* preference */,
|
366
|
+
"no-restricted-imports": OFF /* preference -- TSLint:off */,
|
367
|
+
"no-restricted-properties": OFF /* preference */,
|
368
|
+
"no-restricted-syntax": OFF /* preference */,
|
369
|
+
"no-return-assign": [ERROR, Always] /* ALWAYS | "except-parens" (disallow assignments unless enclosed in parens) */,
|
370
|
+
"no-script-url": ERROR,
|
371
|
+
"no-sequences": [
|
372
|
+
ERROR,
|
373
|
+
{
|
374
|
+
allowInParentheses: true,
|
375
|
+
},
|
376
|
+
],
|
377
|
+
"no-shadow": OFF /* investigate -- TSLint:off: investigate */,
|
378
|
+
"no-shadow-restricted-names": ERROR,
|
379
|
+
"no-ternary": OFF /* preference */,
|
380
|
+
"no-throw-literal": ERROR /* TSLint */,
|
381
|
+
"no-undef-init": ERROR,
|
382
|
+
"no-undefined": OFF /* investigate (breaks Scriptable? breaks Sveltekit?) */,
|
383
|
+
"no-underscore-dangle": OFF /* preference */,
|
384
|
+
"no-unneeded-ternary": [
|
385
|
+
ERROR,
|
386
|
+
{
|
387
|
+
defaultAssignment: false,
|
388
|
+
},
|
389
|
+
],
|
390
|
+
"no-unused-expressions": [
|
391
|
+
ERROR,
|
392
|
+
{
|
393
|
+
allowShortCircuit: true,
|
394
|
+
allowTernary: true,
|
395
|
+
allowTaggedTemplates: true,
|
396
|
+
enforceForJSX: false,
|
397
|
+
},
|
398
|
+
] /* TSLint */,
|
399
|
+
"no-unused-labels": ERROR,
|
400
|
+
"no-useless-call": ERROR,
|
401
|
+
"no-useless-catch": ERROR,
|
402
|
+
"no-useless-computed-key": [
|
403
|
+
ERROR,
|
404
|
+
{
|
405
|
+
enforceForClassMembers: true,
|
406
|
+
},
|
407
|
+
],
|
408
|
+
"no-useless-concat": ERROR,
|
409
|
+
"no-useless-constructor": ERROR /* TSLint */,
|
410
|
+
"no-useless-escape": ERROR,
|
411
|
+
"no-useless-rename": [
|
412
|
+
ERROR,
|
413
|
+
{
|
414
|
+
ignoreImport: false,
|
415
|
+
ignoreExport: false,
|
416
|
+
ignoreDestructuring: false,
|
417
|
+
},
|
418
|
+
],
|
419
|
+
"no-useless-return": ERROR,
|
420
|
+
"no-var": ERROR,
|
421
|
+
"no-void": [
|
422
|
+
ERROR,
|
423
|
+
{
|
424
|
+
allowAsStatement: true,
|
425
|
+
|
426
|
+
},
|
427
|
+
],
|
428
|
+
"no-warning-comments": OFF /* preference */,
|
429
|
+
"no-with": ERROR,
|
430
|
+
"object-shorthand": [
|
431
|
+
ERROR,
|
432
|
+
Always,
|
433
|
+
{
|
434
|
+
avoidQuotes: true,
|
435
|
+
ignoreConstructors: false,
|
436
|
+
avoidExplicitReturnArrows: false,
|
437
|
+
},
|
438
|
+
],
|
439
|
+
"one-var": [
|
440
|
+
ERROR,
|
441
|
+
{
|
442
|
+
"var": Consecutive,
|
443
|
+
let: Consecutive,
|
444
|
+
"const": Consecutive,
|
445
|
+
separateRequires: true,
|
446
|
+
},
|
447
|
+
],
|
448
|
+
"operator-assignment": [ERROR, Always],
|
449
|
+
"prefer-arrow-callback": [
|
450
|
+
ERROR,
|
451
|
+
{
|
452
|
+
allowNamedFunctions: false,
|
453
|
+
allowUnboundThis: true,
|
454
|
+
},
|
455
|
+
],
|
456
|
+
"prefer-const": [
|
457
|
+
ERROR,
|
458
|
+
{
|
459
|
+
destructuring: All,
|
460
|
+
ignoreReadBeforeAssign: false,
|
461
|
+
},
|
462
|
+
],
|
463
|
+
"prefer-destructuring": [
|
464
|
+
ERROR,
|
465
|
+
{
|
466
|
+
VariableDeclarator: {
|
467
|
+
array: true,
|
468
|
+
object: true,
|
469
|
+
},
|
470
|
+
AssignmentExpression: {
|
471
|
+
array: false,
|
472
|
+
object: false,
|
473
|
+
},
|
474
|
+
},
|
475
|
+
{ enforceForRenamedProperties: true },
|
476
|
+
] /* TSLint */,
|
477
|
+
"prefer-exponentiation-operator": ERROR,
|
478
|
+
"prefer-named-capture-group": OFF,
|
479
|
+
"prefer-numeric-literals": ERROR,
|
480
|
+
"prefer-object-has-own": ERROR,
|
481
|
+
"prefer-object-spread": ERROR,
|
482
|
+
"prefer-promise-reject-errors": [
|
483
|
+
ERROR,
|
484
|
+
{
|
485
|
+
allowEmptyReject: false,
|
486
|
+
},
|
487
|
+
],
|
488
|
+
"prefer-regex-literals": [
|
489
|
+
ERROR,
|
490
|
+
{
|
491
|
+
disallowRedundantWrapping: true,
|
492
|
+
},
|
493
|
+
] /* TSLint */,
|
494
|
+
"prefer-rest-params": ERROR,
|
495
|
+
"prefer-spread": ERROR,
|
496
|
+
"prefer-template": ERROR,
|
497
|
+
radix: [ERROR, AsNeeded],
|
498
|
+
"require-await": ERROR /* TSLint */,
|
499
|
+
"require-unicode-regexp": ERROR,
|
500
|
+
"require-yield": ERROR,
|
501
|
+
"sort-imports": OFF /* preference */,
|
502
|
+
"sort-keys": OFF /* preference */,
|
503
|
+
"sort-vars": OFF /* preference */,
|
504
|
+
strict: OFF /* preference */,
|
505
|
+
"symbol-description": OFF /* preference */,
|
506
|
+
"vars-on-top": ERROR,
|
507
|
+
yoda: [
|
508
|
+
ERROR,
|
509
|
+
Never,
|
510
|
+
{
|
511
|
+
exceptRange: false,
|
512
|
+
onlyEquality: false,
|
513
|
+
},
|
514
|
+
],
|
515
|
+
|
516
|
+
// #endregion
|
517
|
+
|
518
|
+
// #region Layout & Formatting
|
519
|
+
// [ https://eslint.org/docs/latest/rules/#layout--formatting ]
|
520
|
+
"unicode-bom": OFF /* preference: don't care */,
|
521
|
+
|
522
|
+
// #endregion
|
523
|
+
},
|
524
|
+
] as const;
|