linted 16.3.2-rc.0 → 16.3.3-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/RELEASE.yml +35 -0
- package/.github/workflows/rc.yml +35 -0
- package/LICENSE +21 -21
- package/README.md +388 -388
- package/SECURITY.md +9 -9
- package/dist/imports/plugins/index.d.ts.map +1 -1
- package/eslint.config.js +3 -3
- package/package.json +99 -99
- package/src/declarations/markdownlint/index.d.ts +3 -3
- package/src/declarations/markdownlint/parser.d.ts +9 -9
- package/src/declarations/mocha/index.d.ts +8 -8
- package/src/imports/index.ts +4 -4
- package/src/imports/parsers/index.ts +16 -16
- package/src/imports/plugins/index.ts +20 -20
- package/src/index.ts +34 -34
- package/src/statics/files/html/index.ts +1 -1
- package/src/statics/files/index.ts +22 -22
- package/src/statics/files/js/index.ts +1 -1
- package/src/statics/files/json/index.ts +1 -1
- package/src/statics/files/jsonc/index.ts +4 -4
- package/src/statics/files/md/index.ts +1 -1
- package/src/statics/files/mocha/index.ts +1 -1
- package/src/statics/files/svelte/index.ts +1 -1
- package/src/statics/files/ts/index.ts +5 -5
- package/src/statics/files/yml/index.ts +5 -5
- package/src/statics/index.ts +4 -4
- package/src/statics/rules/index.ts +22 -22
- package/src/statics/rules/presets/Html.ts +5 -5
- package/src/statics/rules/presets/Js.ts +5 -5
- package/src/statics/rules/presets/Json.ts +5 -5
- package/src/statics/rules/presets/Jsonc.ts +5 -5
- package/src/statics/rules/presets/Md.ts +4 -4
- package/src/statics/rules/presets/Mocha.ts +5 -5
- package/src/statics/rules/presets/Svelte.ts +16 -16
- package/src/statics/rules/presets/Ts.ts +14 -14
- package/src/statics/rules/presets/Yml.ts +5 -5
- package/src/statics/rules/presets/html/Enable.ts +5 -5
- package/src/statics/rules/presets/html/Recommended.ts +7 -7
- package/src/statics/rules/presets/index.ts +10 -10
- package/src/statics/rules/presets/js/Enable.ts +288 -288
- package/src/statics/rules/presets/js/EnableStylistic.ts +288 -288
- package/src/statics/rules/presets/json/Enable.ts +33 -33
- package/src/statics/rules/presets/json/EnableX.ts +51 -51
- package/src/statics/rules/presets/jsonc/OverrideJson.ts +6 -6
- package/src/statics/rules/presets/md/Enable.ts +23 -23
- package/src/statics/rules/presets/mocha/Enable.ts +5 -5
- package/src/statics/rules/presets/mocha/Recommended.ts +7 -7
- package/src/statics/rules/presets/svelte/DisableJS.ts +7 -7
- package/src/statics/rules/presets/svelte/DisableTS.ts +5 -5
- package/src/statics/rules/presets/svelte/DisableX.ts +6 -6
- package/src/statics/rules/presets/svelte/Enable.ts +130 -130
- package/src/statics/rules/presets/svelte/EnableX.ts +6 -6
- package/src/statics/rules/presets/ts/DisableCompiler.ts +23 -23
- package/src/statics/rules/presets/ts/DisableX.ts +34 -34
- package/src/statics/rules/presets/ts/Enable.ts +407 -407
- package/src/statics/rules/presets/ts/EnableX.ts +87 -87
- package/src/statics/rules/presets/yml/Enable.ts +30 -30
- package/src/statics/rules/presets/yml/EnableX.ts +18 -18
- package/src/statics/rules/strings/id/index.ts +17 -17
- package/src/statics/rules/strings/index.ts +6 -6
- package/src/statics/rules/strings/level/index.ts +5 -5
- package/src/statics/rules/strings/state/index.ts +55 -55
- package/tsconfig.json +160 -160
@@ -1,288 +1,288 @@
|
|
1
|
-
import { Strings, type RuleEntry } from "../index.js";
|
2
|
-
|
3
|
-
const {
|
4
|
-
Id: { Enable },
|
5
|
-
Level: { ERROR, OFF },
|
6
|
-
State: {
|
7
|
-
NEVER,
|
8
|
-
ALWAYS,
|
9
|
-
AS_NEEDED,
|
10
|
-
CONSECUTIVE,
|
11
|
-
ALLOW,
|
12
|
-
ALL,
|
13
|
-
MULTI,
|
14
|
-
BOTH,
|
15
|
-
},
|
16
|
-
} = Strings;
|
17
|
-
|
18
|
-
export default [
|
19
|
-
Enable,
|
20
|
-
{
|
21
|
-
// #region Problems
|
22
|
-
// [ https://eslint.org/docs/latest/rules/#possible-problems ]
|
23
|
-
"array-callback-return": [ERROR, { allowImplicit: false, checkForEach: true, allowVoid: true }],
|
24
|
-
"constructor-super": ERROR, /* tsc */
|
25
|
-
"for-direction": ERROR,
|
26
|
-
"getter-return": [ERROR, { allowImplicit: false }], /* tsc */
|
27
|
-
"no-async-promise-executor": ERROR,
|
28
|
-
"no-await-in-loop": ERROR,
|
29
|
-
"no-class-assign": ERROR,
|
30
|
-
"no-compare-neg-zero": ERROR,
|
31
|
-
"no-cond-assign": [ERROR, ALWAYS],
|
32
|
-
"no-const-assign": ERROR, /* tsc */
|
33
|
-
"no-constant-binary-expression": ERROR,
|
34
|
-
"no-constant-condition": [ERROR, { checkLoops: true }], /* BUG: incorrect option description (claims "all" is ok): https://eslint.org/docs/latest/rules/no-constant-condition */
|
35
|
-
"no-constructor-return": ERROR,
|
36
|
-
"no-control-regex": ERROR,
|
37
|
-
"no-debugger": ERROR,
|
38
|
-
"no-dupe-args": ERROR, /* tsc */
|
39
|
-
"no-dupe-class-members": ERROR, /* tsc -- TSLint:off: tsc */
|
40
|
-
"no-dupe-else-if": ERROR,
|
41
|
-
"no-dupe-keys": ERROR, /* tsc */
|
42
|
-
"no-duplicate-case": ERROR,
|
43
|
-
"no-duplicate-imports": OFF, /* BUG: breaks separation of TS type-only imports from value imports */
|
44
|
-
"no-empty-character-class": ERROR,
|
45
|
-
"no-empty-pattern": [ERROR, { allowObjectPatternsAsParameters: false }],
|
46
|
-
"no-ex-assign": ERROR,
|
47
|
-
"no-fallthrough": [ERROR, { allowEmptyCase: true, reportUnusedFallthroughComment: true }],
|
48
|
-
"no-func-assign": ERROR, /* tsc */
|
49
|
-
"no-import-assign": ERROR, /* tsc (except Object.assign()) */
|
50
|
-
"no-inner-declarations": [ERROR, BOTH, { blockScopedFunctions: ALLOW }],
|
51
|
-
"no-invalid-regexp": [ERROR, { allowConstructorFlags: [] }],
|
52
|
-
"no-irregular-whitespace": [
|
53
|
-
ERROR,
|
54
|
-
{
|
55
|
-
skipStrings: true,
|
56
|
-
skipComments: true,
|
57
|
-
skipRegExps: true,
|
58
|
-
skipTemplates: true,
|
59
|
-
skipJSXText: true,
|
60
|
-
},
|
61
|
-
],
|
62
|
-
"no-loss-of-precision": ERROR, /* TSLint */
|
63
|
-
"no-misleading-character-class": ERROR,
|
64
|
-
"no-new-native-nonconstructor": ERROR,
|
65
|
-
"no-obj-calls": ERROR, /* tsc */
|
66
|
-
"no-promise-executor-return": [ERROR, { allowVoid: true }],
|
67
|
-
"no-prototype-builtins": ERROR,
|
68
|
-
"no-self-assign": [ERROR, { props: true }],
|
69
|
-
"no-self-compare": ERROR,
|
70
|
-
"no-setter-return": ERROR, /* tsc */
|
71
|
-
"no-sparse-arrays": ERROR,
|
72
|
-
"no-template-curly-in-string": ERROR,
|
73
|
-
"no-this-before-super": ERROR, /* tsc */
|
74
|
-
"no-undef": ERROR, /* tsc */
|
75
|
-
"no-unexpected-multiline": ERROR,
|
76
|
-
"no-unmodified-loop-condition": ERROR,
|
77
|
-
"no-unreachable": ERROR, /* tsc */
|
78
|
-
"no-unreachable-loop": [ERROR, { ignore: [] /* WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement */ }],
|
79
|
-
"no-unsafe-finally": ERROR,
|
80
|
-
"no-unsafe-negation": [ERROR, { enforceForOrderingRelations: true }], /* tsc */
|
81
|
-
"no-unsafe-optional-chaining": [ERROR, { disallowArithmeticOperators: true }],
|
82
|
-
"no-unused-private-class-members": ERROR,
|
83
|
-
"no-unused-vars": [
|
84
|
-
ERROR,
|
85
|
-
{
|
86
|
-
vars: ALL,
|
87
|
-
args: ALL,
|
88
|
-
caughtErrors: ALL,
|
89
|
-
ignoreRestSiblings: false,
|
90
|
-
ignoreClassWithStaticInitBlock: false,
|
91
|
-
reportUsedIgnorePattern: true,
|
92
|
-
},
|
93
|
-
], /* TSLint */
|
94
|
-
"no-use-before-define": [
|
95
|
-
ERROR,
|
96
|
-
{
|
97
|
-
functions: true,
|
98
|
-
classes: true,
|
99
|
-
variables: true,
|
100
|
-
allowNamedExports: false,
|
101
|
-
},
|
102
|
-
], /* TSLint */
|
103
|
-
"no-useless-assignment": ERROR,
|
104
|
-
"no-useless-backreference": ERROR,
|
105
|
-
"require-atomic-updates": [ERROR, { allowProperties: false }],
|
106
|
-
"use-isnan": [ERROR, { enforceForSwitchCase: true, enforceForIndexOf: true }],
|
107
|
-
"valid-typeof": [ERROR, { requireStringLiterals: true }],
|
108
|
-
|
109
|
-
// #endregion
|
110
|
-
|
111
|
-
// #region Suggestions
|
112
|
-
// [ https://eslint.org/docs/latest/rules/#suggestions ]
|
113
|
-
"accessor-pairs": [ERROR, { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }],
|
114
|
-
"arrow-body-style": [ERROR, AS_NEEDED, { requireReturnForObjectLiteral: true }],
|
115
|
-
"block-scoped-var": ERROR,
|
116
|
-
camelcase: OFF, /* preference */
|
117
|
-
"capitalized-comments": OFF, /* preference */
|
118
|
-
"class-methods-use-this": OFF, /* preference -- TSLint */
|
119
|
-
complexity: OFF, /* preference */
|
120
|
-
"consistent-return": [ERROR, { treatUndefinedAsUnspecified: false }], /* tsc -- TSLint:off: tsconfig: noImplicitReturns */
|
121
|
-
"consistent-this": ERROR,
|
122
|
-
curly: [ERROR, MULTI],
|
123
|
-
"default-case": OFF, /* preference: don't care */
|
124
|
-
"default-case-last": ERROR,
|
125
|
-
"default-param-last": ERROR, /* TSLint */
|
126
|
-
"dot-notation": [ERROR, { allowKeywords: true }], /* TSLint */
|
127
|
-
eqeqeq: [ERROR, ALWAYS],
|
128
|
-
"func-name-matching": OFF, /* preference */
|
129
|
-
"func-names": OFF, /* preference */
|
130
|
-
"func-style": OFF, /* preference */
|
131
|
-
"grouped-accessor-pairs": OFF, /* preference -- BUG: requires adjacency, not as described in documentation */
|
132
|
-
"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 */
|
133
|
-
"id-denylist": OFF, /* preference */
|
134
|
-
"id-length": OFF, /* preference */
|
135
|
-
"id-match": OFF, /* preference */
|
136
|
-
"init-declarations": [ERROR, ALWAYS], /* TSLint */
|
137
|
-
"logical-assignment-operators": [ERROR, ALWAYS, { enforceForIfStatements: true }],
|
138
|
-
"max-classes-per-file": OFF, /* preference */
|
139
|
-
"max-depth": OFF, /* preference */
|
140
|
-
"max-lines": OFF, /* preference */
|
141
|
-
"max-lines-per-function": OFF, /* preference */
|
142
|
-
"max-nested-callbacks": OFF, /* preference */
|
143
|
-
"max-params": OFF, /* preference -- TSLint:off: preference */
|
144
|
-
"max-statements": OFF, /* preference */
|
145
|
-
"multiline-comment-style": OFF, /* preference */
|
146
|
-
"new-cap": OFF, /* preference -- breaks Scriptable */
|
147
|
-
"no-alert": ERROR,
|
148
|
-
"no-array-constructor": ERROR, /* TSLint */
|
149
|
-
"no-bitwise": [ERROR, { allow: [], int32Hint: true }],
|
150
|
-
"no-caller": ERROR,
|
151
|
-
"no-case-declarations": ERROR,
|
152
|
-
"no-console": OFF, /* preference -- breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */
|
153
|
-
"no-continue": ERROR,
|
154
|
-
"no-delete-var": ERROR,
|
155
|
-
"no-div-regex": ERROR,
|
156
|
-
"no-else-return": OFF, /* preference */
|
157
|
-
"no-empty": [ERROR, { allowEmptyCatch: false }],
|
158
|
-
"no-empty-function": [ERROR, { allow: ["constructors"] /** functions, arrowFunctions, generatorFunctions, methods, generatorMethods, getters, setters, constructors, asyncFunctions, asyncMethods; TS-ONLY: private-constructors, protected-constructors, decoratedFunctions, overrideMethods */ }], /* TSLint */
|
159
|
-
"no-empty-static-block": ERROR,
|
160
|
-
"no-eq-null": ERROR,
|
161
|
-
"no-eval": [ERROR, { allowIndirect: false }],
|
162
|
-
"no-extend-native": [ERROR, { exceptions: [] }],
|
163
|
-
"no-extra-bind": ERROR,
|
164
|
-
"no-extra-boolean-cast": [ERROR, { enforceForLogicalOperands: true }],
|
165
|
-
"no-extra-label": ERROR,
|
166
|
-
"no-global-assign": [ERROR, { exceptions: [] }],
|
167
|
-
"no-implicit-coercion": [
|
168
|
-
ERROR,
|
169
|
-
{
|
170
|
-
"boolean": true,
|
171
|
-
number: true,
|
172
|
-
string: true,
|
173
|
-
disallowTemplateShorthand: true,
|
174
|
-
allow: [], /** "~" | "!!" | "+" | "- -" | "-" | "*" */
|
175
|
-
},
|
176
|
-
],
|
177
|
-
"no-implicit-globals": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
178
|
-
"no-implied-eval": ERROR, /* TSLint */
|
179
|
-
"no-inline-comments": OFF, /* preference */
|
180
|
-
"no-invalid-this": [ERROR, { capIsConstructor: false }], /* TSLint:off: tsconfig: { strict, noImplicitThis } */
|
181
|
-
"no-iterator": ERROR,
|
182
|
-
"no-label-var": ERROR,
|
183
|
-
"no-lone-blocks": ERROR,
|
184
|
-
"no-lonely-if": OFF, /* preference */
|
185
|
-
"no-loop-func": ERROR, /* TSLint */
|
186
|
-
"no-magic-numbers": OFF, /* preference - breaks TypeScript number literals, even with most liberal exceptions */
|
187
|
-
"no-multi-assign": [ERROR, { ignoreNonDeclaration: false }],
|
188
|
-
"no-multi-str": ERROR,
|
189
|
-
"no-negated-condition": OFF, /* preference */
|
190
|
-
"no-nested-ternary": OFF, /* preference */
|
191
|
-
"no-new": ERROR,
|
192
|
-
"no-new-func": ERROR,
|
193
|
-
"no-new-wrappers": ERROR,
|
194
|
-
"no-nonoctal-decimal-escape": ERROR,
|
195
|
-
"no-object-constructor": ERROR,
|
196
|
-
"no-octal": ERROR,
|
197
|
-
"no-octal-escape": ERROR,
|
198
|
-
"no-param-reassign": [ERROR, { props: true, ignorePropertyModificationsFor: [], ignorePropertyModificationsForRegex: [] }],
|
199
|
-
"no-plusplus": [ERROR, { allowForLoopAfterthoughts: true }],
|
200
|
-
"no-proto": ERROR,
|
201
|
-
"no-redeclare": [ERROR, { builtinGlobals: true }], /* tsc -- TSLint:off: tsc (let, const, -var) */
|
202
|
-
"no-regex-spaces": OFF, /* preference */
|
203
|
-
"no-restricted-exports": OFF, /* preference */
|
204
|
-
"no-restricted-globals": OFF, /* preference */
|
205
|
-
"no-restricted-imports": OFF, /* preference -- TSLint:off */
|
206
|
-
"no-restricted-properties": OFF, /* preference */
|
207
|
-
"no-restricted-syntax": OFF, /* preference */
|
208
|
-
"no-return-assign": [ERROR, ALWAYS], /* ALWAYS | "except-parens" (disallow assignments unless enclosed in parens) */
|
209
|
-
"no-script-url": ERROR,
|
210
|
-
"no-sequences": [ERROR, { allowInParentheses: true }],
|
211
|
-
"no-shadow": OFF, /* investigate -- TSLint:off: investigate */
|
212
|
-
"no-shadow-restricted-names": ERROR,
|
213
|
-
"no-ternary": OFF, /* preference */
|
214
|
-
"no-throw-literal": ERROR, /* TSLint */
|
215
|
-
"no-undef-init": ERROR,
|
216
|
-
"no-undefined": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
217
|
-
"no-underscore-dangle": OFF, /* preference */
|
218
|
-
"no-unneeded-ternary": [ERROR, { defaultAssignment: false }],
|
219
|
-
"no-unused-expressions": [
|
220
|
-
ERROR,
|
221
|
-
{
|
222
|
-
allowShortCircuit: true,
|
223
|
-
allowTernary: true,
|
224
|
-
allowTaggedTemplates: true,
|
225
|
-
enforceForJSX: false,
|
226
|
-
},
|
227
|
-
], /* TSLint */
|
228
|
-
"no-unused-labels": ERROR,
|
229
|
-
"no-useless-call": ERROR,
|
230
|
-
"no-useless-catch": ERROR,
|
231
|
-
"no-useless-computed-key": [ERROR, { enforceForClassMembers: true }],
|
232
|
-
"no-useless-concat": ERROR,
|
233
|
-
"no-useless-constructor": ERROR, /* TSLint */
|
234
|
-
"no-useless-escape": ERROR,
|
235
|
-
"no-useless-rename": [ERROR, { ignoreImport: false, ignoreExport: false, ignoreDestructuring: false }],
|
236
|
-
"no-useless-return": ERROR,
|
237
|
-
"no-var": ERROR,
|
238
|
-
"no-void": [ERROR, { allowAsStatement: true }],
|
239
|
-
"no-warning-comments": OFF, /* preference */
|
240
|
-
"no-with": ERROR,
|
241
|
-
"object-shorthand": [ERROR, ALWAYS, { avoidQuotes: true, ignoreConstructors: false, avoidExplicitReturnArrows: false }],
|
242
|
-
"one-var": [
|
243
|
-
ERROR,
|
244
|
-
{
|
245
|
-
"var": CONSECUTIVE,
|
246
|
-
let: CONSECUTIVE,
|
247
|
-
"const": CONSECUTIVE,
|
248
|
-
separateRequires: true,
|
249
|
-
},
|
250
|
-
],
|
251
|
-
"operator-assignment": [ERROR, ALWAYS],
|
252
|
-
"prefer-arrow-callback": [ERROR, { allowNamedFunctions: false, allowUnboundThis: true }],
|
253
|
-
"prefer-const": [
|
254
|
-
ERROR,
|
255
|
-
{ destructuring: ALL, ignoreReadBeforeAssign: false },
|
256
|
-
],
|
257
|
-
"prefer-destructuring": [ERROR, { VariableDeclarator: { array: true, object: true }, AssignmentExpression: { array: false, object: false } }, { enforceForRenamedProperties: true }], /* TSLint */
|
258
|
-
"prefer-exponentiation-operator": ERROR,
|
259
|
-
"prefer-named-capture-group": OFF,
|
260
|
-
"prefer-numeric-literals": ERROR,
|
261
|
-
"prefer-object-has-own": ERROR,
|
262
|
-
"prefer-object-spread": ERROR,
|
263
|
-
"prefer-promise-reject-errors": [ERROR, { allowEmptyReject: false }],
|
264
|
-
"prefer-regex-literals": [ERROR, { disallowRedundantWrapping: true }], /* TSLint */
|
265
|
-
"prefer-rest-params": ERROR,
|
266
|
-
"prefer-spread": ERROR,
|
267
|
-
"prefer-template": ERROR,
|
268
|
-
radix: [ERROR, AS_NEEDED],
|
269
|
-
"require-await": ERROR, /* TSLint */
|
270
|
-
"require-unicode-regexp": ERROR,
|
271
|
-
"require-yield": ERROR,
|
272
|
-
"sort-imports": OFF, /* preference */
|
273
|
-
"sort-keys": OFF, /* preference */
|
274
|
-
"sort-vars": OFF, /* preference */
|
275
|
-
strict: OFF, /* preference */
|
276
|
-
"symbol-description": OFF, /* preference */
|
277
|
-
"vars-on-top": ERROR,
|
278
|
-
yoda: [ERROR, NEVER, { exceptRange: false, onlyEquality: false }],
|
279
|
-
|
280
|
-
// #endregion
|
281
|
-
|
282
|
-
// #region Layout & Formatting
|
283
|
-
// [ https://eslint.org/docs/latest/rules/#layout--formatting ]
|
284
|
-
"unicode-bom": OFF, /* preference: don't care */
|
285
|
-
|
286
|
-
// #endregion
|
287
|
-
},
|
288
|
-
] as const satisfies RuleEntry;
|
1
|
+
import { Strings, type RuleEntry } from "../index.js";
|
2
|
+
|
3
|
+
const {
|
4
|
+
Id: { Enable },
|
5
|
+
Level: { ERROR, OFF },
|
6
|
+
State: {
|
7
|
+
NEVER,
|
8
|
+
ALWAYS,
|
9
|
+
AS_NEEDED,
|
10
|
+
CONSECUTIVE,
|
11
|
+
ALLOW,
|
12
|
+
ALL,
|
13
|
+
MULTI,
|
14
|
+
BOTH,
|
15
|
+
},
|
16
|
+
} = Strings;
|
17
|
+
|
18
|
+
export default [
|
19
|
+
Enable,
|
20
|
+
{
|
21
|
+
// #region Problems
|
22
|
+
// [ https://eslint.org/docs/latest/rules/#possible-problems ]
|
23
|
+
"array-callback-return": [ERROR, { allowImplicit: false, checkForEach: true, allowVoid: true }],
|
24
|
+
"constructor-super": ERROR, /* tsc */
|
25
|
+
"for-direction": ERROR,
|
26
|
+
"getter-return": [ERROR, { allowImplicit: false }], /* tsc */
|
27
|
+
"no-async-promise-executor": ERROR,
|
28
|
+
"no-await-in-loop": ERROR,
|
29
|
+
"no-class-assign": ERROR,
|
30
|
+
"no-compare-neg-zero": ERROR,
|
31
|
+
"no-cond-assign": [ERROR, ALWAYS],
|
32
|
+
"no-const-assign": ERROR, /* tsc */
|
33
|
+
"no-constant-binary-expression": ERROR,
|
34
|
+
"no-constant-condition": [ERROR, { checkLoops: true }], /* BUG: incorrect option description (claims "all" is ok): https://eslint.org/docs/latest/rules/no-constant-condition */
|
35
|
+
"no-constructor-return": ERROR,
|
36
|
+
"no-control-regex": ERROR,
|
37
|
+
"no-debugger": ERROR,
|
38
|
+
"no-dupe-args": ERROR, /* tsc */
|
39
|
+
"no-dupe-class-members": ERROR, /* tsc -- TSLint:off: tsc */
|
40
|
+
"no-dupe-else-if": ERROR,
|
41
|
+
"no-dupe-keys": ERROR, /* tsc */
|
42
|
+
"no-duplicate-case": ERROR,
|
43
|
+
"no-duplicate-imports": OFF, /* BUG: breaks separation of TS type-only imports from value imports */
|
44
|
+
"no-empty-character-class": ERROR,
|
45
|
+
"no-empty-pattern": [ERROR, { allowObjectPatternsAsParameters: false }],
|
46
|
+
"no-ex-assign": ERROR,
|
47
|
+
"no-fallthrough": [ERROR, { allowEmptyCase: true, reportUnusedFallthroughComment: true }],
|
48
|
+
"no-func-assign": ERROR, /* tsc */
|
49
|
+
"no-import-assign": ERROR, /* tsc (except Object.assign()) */
|
50
|
+
"no-inner-declarations": [ERROR, BOTH, { blockScopedFunctions: ALLOW }],
|
51
|
+
"no-invalid-regexp": [ERROR, { allowConstructorFlags: [] }],
|
52
|
+
"no-irregular-whitespace": [
|
53
|
+
ERROR,
|
54
|
+
{
|
55
|
+
skipStrings: true,
|
56
|
+
skipComments: true,
|
57
|
+
skipRegExps: true,
|
58
|
+
skipTemplates: true,
|
59
|
+
skipJSXText: true,
|
60
|
+
},
|
61
|
+
],
|
62
|
+
"no-loss-of-precision": ERROR, /* TSLint */
|
63
|
+
"no-misleading-character-class": ERROR,
|
64
|
+
"no-new-native-nonconstructor": ERROR,
|
65
|
+
"no-obj-calls": ERROR, /* tsc */
|
66
|
+
"no-promise-executor-return": [ERROR, { allowVoid: true }],
|
67
|
+
"no-prototype-builtins": ERROR,
|
68
|
+
"no-self-assign": [ERROR, { props: true }],
|
69
|
+
"no-self-compare": ERROR,
|
70
|
+
"no-setter-return": ERROR, /* tsc */
|
71
|
+
"no-sparse-arrays": ERROR,
|
72
|
+
"no-template-curly-in-string": ERROR,
|
73
|
+
"no-this-before-super": ERROR, /* tsc */
|
74
|
+
"no-undef": ERROR, /* tsc */
|
75
|
+
"no-unexpected-multiline": ERROR,
|
76
|
+
"no-unmodified-loop-condition": ERROR,
|
77
|
+
"no-unreachable": ERROR, /* tsc */
|
78
|
+
"no-unreachable-loop": [ERROR, { ignore: [] /* WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement */ }],
|
79
|
+
"no-unsafe-finally": ERROR,
|
80
|
+
"no-unsafe-negation": [ERROR, { enforceForOrderingRelations: true }], /* tsc */
|
81
|
+
"no-unsafe-optional-chaining": [ERROR, { disallowArithmeticOperators: true }],
|
82
|
+
"no-unused-private-class-members": ERROR,
|
83
|
+
"no-unused-vars": [
|
84
|
+
ERROR,
|
85
|
+
{
|
86
|
+
vars: ALL,
|
87
|
+
args: ALL,
|
88
|
+
caughtErrors: ALL,
|
89
|
+
ignoreRestSiblings: false,
|
90
|
+
ignoreClassWithStaticInitBlock: false,
|
91
|
+
reportUsedIgnorePattern: true,
|
92
|
+
},
|
93
|
+
], /* TSLint */
|
94
|
+
"no-use-before-define": [
|
95
|
+
ERROR,
|
96
|
+
{
|
97
|
+
functions: true,
|
98
|
+
classes: true,
|
99
|
+
variables: true,
|
100
|
+
allowNamedExports: false,
|
101
|
+
},
|
102
|
+
], /* TSLint */
|
103
|
+
"no-useless-assignment": ERROR,
|
104
|
+
"no-useless-backreference": ERROR,
|
105
|
+
"require-atomic-updates": [ERROR, { allowProperties: false }],
|
106
|
+
"use-isnan": [ERROR, { enforceForSwitchCase: true, enforceForIndexOf: true }],
|
107
|
+
"valid-typeof": [ERROR, { requireStringLiterals: true }],
|
108
|
+
|
109
|
+
// #endregion
|
110
|
+
|
111
|
+
// #region Suggestions
|
112
|
+
// [ https://eslint.org/docs/latest/rules/#suggestions ]
|
113
|
+
"accessor-pairs": [ERROR, { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }],
|
114
|
+
"arrow-body-style": [ERROR, AS_NEEDED, { requireReturnForObjectLiteral: true }],
|
115
|
+
"block-scoped-var": ERROR,
|
116
|
+
camelcase: OFF, /* preference */
|
117
|
+
"capitalized-comments": OFF, /* preference */
|
118
|
+
"class-methods-use-this": OFF, /* preference -- TSLint */
|
119
|
+
complexity: OFF, /* preference */
|
120
|
+
"consistent-return": [ERROR, { treatUndefinedAsUnspecified: false }], /* tsc -- TSLint:off: tsconfig: noImplicitReturns */
|
121
|
+
"consistent-this": ERROR,
|
122
|
+
curly: [ERROR, MULTI],
|
123
|
+
"default-case": OFF, /* preference: don't care */
|
124
|
+
"default-case-last": ERROR,
|
125
|
+
"default-param-last": ERROR, /* TSLint */
|
126
|
+
"dot-notation": [ERROR, { allowKeywords: true }], /* TSLint */
|
127
|
+
eqeqeq: [ERROR, ALWAYS],
|
128
|
+
"func-name-matching": OFF, /* preference */
|
129
|
+
"func-names": OFF, /* preference */
|
130
|
+
"func-style": OFF, /* preference */
|
131
|
+
"grouped-accessor-pairs": OFF, /* preference -- BUG: requires adjacency, not as described in documentation */
|
132
|
+
"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 */
|
133
|
+
"id-denylist": OFF, /* preference */
|
134
|
+
"id-length": OFF, /* preference */
|
135
|
+
"id-match": OFF, /* preference */
|
136
|
+
"init-declarations": [ERROR, ALWAYS], /* TSLint */
|
137
|
+
"logical-assignment-operators": [ERROR, ALWAYS, { enforceForIfStatements: true }],
|
138
|
+
"max-classes-per-file": OFF, /* preference */
|
139
|
+
"max-depth": OFF, /* preference */
|
140
|
+
"max-lines": OFF, /* preference */
|
141
|
+
"max-lines-per-function": OFF, /* preference */
|
142
|
+
"max-nested-callbacks": OFF, /* preference */
|
143
|
+
"max-params": OFF, /* preference -- TSLint:off: preference */
|
144
|
+
"max-statements": OFF, /* preference */
|
145
|
+
"multiline-comment-style": OFF, /* preference */
|
146
|
+
"new-cap": OFF, /* preference -- breaks Scriptable */
|
147
|
+
"no-alert": ERROR,
|
148
|
+
"no-array-constructor": ERROR, /* TSLint */
|
149
|
+
"no-bitwise": [ERROR, { allow: [], int32Hint: true }],
|
150
|
+
"no-caller": ERROR,
|
151
|
+
"no-case-declarations": ERROR,
|
152
|
+
"no-console": OFF, /* preference -- breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */
|
153
|
+
"no-continue": ERROR,
|
154
|
+
"no-delete-var": ERROR,
|
155
|
+
"no-div-regex": ERROR,
|
156
|
+
"no-else-return": OFF, /* preference */
|
157
|
+
"no-empty": [ERROR, { allowEmptyCatch: false }],
|
158
|
+
"no-empty-function": [ERROR, { allow: ["constructors"] /** functions, arrowFunctions, generatorFunctions, methods, generatorMethods, getters, setters, constructors, asyncFunctions, asyncMethods; TS-ONLY: private-constructors, protected-constructors, decoratedFunctions, overrideMethods */ }], /* TSLint */
|
159
|
+
"no-empty-static-block": ERROR,
|
160
|
+
"no-eq-null": ERROR,
|
161
|
+
"no-eval": [ERROR, { allowIndirect: false }],
|
162
|
+
"no-extend-native": [ERROR, { exceptions: [] }],
|
163
|
+
"no-extra-bind": ERROR,
|
164
|
+
"no-extra-boolean-cast": [ERROR, { enforceForLogicalOperands: true }],
|
165
|
+
"no-extra-label": ERROR,
|
166
|
+
"no-global-assign": [ERROR, { exceptions: [] }],
|
167
|
+
"no-implicit-coercion": [
|
168
|
+
ERROR,
|
169
|
+
{
|
170
|
+
"boolean": true,
|
171
|
+
number: true,
|
172
|
+
string: true,
|
173
|
+
disallowTemplateShorthand: true,
|
174
|
+
allow: [], /** "~" | "!!" | "+" | "- -" | "-" | "*" */
|
175
|
+
},
|
176
|
+
],
|
177
|
+
"no-implicit-globals": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
178
|
+
"no-implied-eval": ERROR, /* TSLint */
|
179
|
+
"no-inline-comments": OFF, /* preference */
|
180
|
+
"no-invalid-this": [ERROR, { capIsConstructor: false }], /* TSLint:off: tsconfig: { strict, noImplicitThis } */
|
181
|
+
"no-iterator": ERROR,
|
182
|
+
"no-label-var": ERROR,
|
183
|
+
"no-lone-blocks": ERROR,
|
184
|
+
"no-lonely-if": OFF, /* preference */
|
185
|
+
"no-loop-func": ERROR, /* TSLint */
|
186
|
+
"no-magic-numbers": OFF, /* preference - breaks TypeScript number literals, even with most liberal exceptions */
|
187
|
+
"no-multi-assign": [ERROR, { ignoreNonDeclaration: false }],
|
188
|
+
"no-multi-str": ERROR,
|
189
|
+
"no-negated-condition": OFF, /* preference */
|
190
|
+
"no-nested-ternary": OFF, /* preference */
|
191
|
+
"no-new": ERROR,
|
192
|
+
"no-new-func": ERROR,
|
193
|
+
"no-new-wrappers": ERROR,
|
194
|
+
"no-nonoctal-decimal-escape": ERROR,
|
195
|
+
"no-object-constructor": ERROR,
|
196
|
+
"no-octal": ERROR,
|
197
|
+
"no-octal-escape": ERROR,
|
198
|
+
"no-param-reassign": [ERROR, { props: true, ignorePropertyModificationsFor: [], ignorePropertyModificationsForRegex: [] }],
|
199
|
+
"no-plusplus": [ERROR, { allowForLoopAfterthoughts: true }],
|
200
|
+
"no-proto": ERROR,
|
201
|
+
"no-redeclare": [ERROR, { builtinGlobals: true }], /* tsc -- TSLint:off: tsc (let, const, -var) */
|
202
|
+
"no-regex-spaces": OFF, /* preference */
|
203
|
+
"no-restricted-exports": OFF, /* preference */
|
204
|
+
"no-restricted-globals": OFF, /* preference */
|
205
|
+
"no-restricted-imports": OFF, /* preference -- TSLint:off */
|
206
|
+
"no-restricted-properties": OFF, /* preference */
|
207
|
+
"no-restricted-syntax": OFF, /* preference */
|
208
|
+
"no-return-assign": [ERROR, ALWAYS], /* ALWAYS | "except-parens" (disallow assignments unless enclosed in parens) */
|
209
|
+
"no-script-url": ERROR,
|
210
|
+
"no-sequences": [ERROR, { allowInParentheses: true }],
|
211
|
+
"no-shadow": OFF, /* investigate -- TSLint:off: investigate */
|
212
|
+
"no-shadow-restricted-names": ERROR,
|
213
|
+
"no-ternary": OFF, /* preference */
|
214
|
+
"no-throw-literal": ERROR, /* TSLint */
|
215
|
+
"no-undef-init": ERROR,
|
216
|
+
"no-undefined": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
217
|
+
"no-underscore-dangle": OFF, /* preference */
|
218
|
+
"no-unneeded-ternary": [ERROR, { defaultAssignment: false }],
|
219
|
+
"no-unused-expressions": [
|
220
|
+
ERROR,
|
221
|
+
{
|
222
|
+
allowShortCircuit: true,
|
223
|
+
allowTernary: true,
|
224
|
+
allowTaggedTemplates: true,
|
225
|
+
enforceForJSX: false,
|
226
|
+
},
|
227
|
+
], /* TSLint */
|
228
|
+
"no-unused-labels": ERROR,
|
229
|
+
"no-useless-call": ERROR,
|
230
|
+
"no-useless-catch": ERROR,
|
231
|
+
"no-useless-computed-key": [ERROR, { enforceForClassMembers: true }],
|
232
|
+
"no-useless-concat": ERROR,
|
233
|
+
"no-useless-constructor": ERROR, /* TSLint */
|
234
|
+
"no-useless-escape": ERROR,
|
235
|
+
"no-useless-rename": [ERROR, { ignoreImport: false, ignoreExport: false, ignoreDestructuring: false }],
|
236
|
+
"no-useless-return": ERROR,
|
237
|
+
"no-var": ERROR,
|
238
|
+
"no-void": [ERROR, { allowAsStatement: true }],
|
239
|
+
"no-warning-comments": OFF, /* preference */
|
240
|
+
"no-with": ERROR,
|
241
|
+
"object-shorthand": [ERROR, ALWAYS, { avoidQuotes: true, ignoreConstructors: false, avoidExplicitReturnArrows: false }],
|
242
|
+
"one-var": [
|
243
|
+
ERROR,
|
244
|
+
{
|
245
|
+
"var": CONSECUTIVE,
|
246
|
+
let: CONSECUTIVE,
|
247
|
+
"const": CONSECUTIVE,
|
248
|
+
separateRequires: true,
|
249
|
+
},
|
250
|
+
],
|
251
|
+
"operator-assignment": [ERROR, ALWAYS],
|
252
|
+
"prefer-arrow-callback": [ERROR, { allowNamedFunctions: false, allowUnboundThis: true }],
|
253
|
+
"prefer-const": [
|
254
|
+
ERROR,
|
255
|
+
{ destructuring: ALL, ignoreReadBeforeAssign: false },
|
256
|
+
],
|
257
|
+
"prefer-destructuring": [ERROR, { VariableDeclarator: { array: true, object: true }, AssignmentExpression: { array: false, object: false } }, { enforceForRenamedProperties: true }], /* TSLint */
|
258
|
+
"prefer-exponentiation-operator": ERROR,
|
259
|
+
"prefer-named-capture-group": OFF,
|
260
|
+
"prefer-numeric-literals": ERROR,
|
261
|
+
"prefer-object-has-own": ERROR,
|
262
|
+
"prefer-object-spread": ERROR,
|
263
|
+
"prefer-promise-reject-errors": [ERROR, { allowEmptyReject: false }],
|
264
|
+
"prefer-regex-literals": [ERROR, { disallowRedundantWrapping: true }], /* TSLint */
|
265
|
+
"prefer-rest-params": ERROR,
|
266
|
+
"prefer-spread": ERROR,
|
267
|
+
"prefer-template": ERROR,
|
268
|
+
radix: [ERROR, AS_NEEDED],
|
269
|
+
"require-await": ERROR, /* TSLint */
|
270
|
+
"require-unicode-regexp": ERROR,
|
271
|
+
"require-yield": ERROR,
|
272
|
+
"sort-imports": OFF, /* preference */
|
273
|
+
"sort-keys": OFF, /* preference */
|
274
|
+
"sort-vars": OFF, /* preference */
|
275
|
+
strict: OFF, /* preference */
|
276
|
+
"symbol-description": OFF, /* preference */
|
277
|
+
"vars-on-top": ERROR,
|
278
|
+
yoda: [ERROR, NEVER, { exceptRange: false, onlyEquality: false }],
|
279
|
+
|
280
|
+
// #endregion
|
281
|
+
|
282
|
+
// #region Layout & Formatting
|
283
|
+
// [ https://eslint.org/docs/latest/rules/#layout--formatting ]
|
284
|
+
"unicode-bom": OFF, /* preference: don't care */
|
285
|
+
|
286
|
+
// #endregion
|
287
|
+
},
|
288
|
+
] as const satisfies RuleEntry;
|