linted 15.0.0-rc.1 → 15.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/defaults.d.ts +7 -7
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +12 -4
- package/dist/defaults.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/parsers.d.ts +6 -6
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js.map +1 -1
- package/dist/plugins.d.ts +19 -19
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +1 -2
- package/dist/plugins.js.map +1 -1
- package/dist/rulesets/rules/js/JsEnable.d.ts.map +1 -1
- package/dist/rulesets/rules/js/JsEnable.js +10 -21
- package/dist/rulesets/rules/js/JsEnable.js.map +1 -1
- package/dist/rulesets/rules/js/StylisticEnable.d.ts.map +1 -1
- package/dist/rulesets/rules/js/StylisticEnable.js +12 -18
- package/dist/rulesets/rules/js/StylisticEnable.js.map +1 -1
- package/dist/rulesets/rules/state.d.ts +2 -1
- package/dist/rulesets/rules/state.d.ts.map +1 -1
- package/dist/rulesets/rules/state.js +2 -1
- package/dist/rulesets/rules/state.js.map +1 -1
- package/dist/rulesets.d.ts +10 -9
- package/dist/rulesets.d.ts.map +1 -1
- package/dist/rulesets.js +1 -2
- package/dist/rulesets.js.map +1 -1
- package/package.json +3 -3
- package/src/defaults.ts +14 -6
- package/src/index.ts +2 -2
- package/src/parsers.ts +2 -2
- package/src/plugins.ts +3 -11
- package/src/rulesets/rules/js/JsEnable.ts +100 -109
- package/src/rulesets/rules/js/StylisticEnable.ts +12 -18
- package/src/rulesets/rules/state.ts +2 -0
- package/src/rulesets.ts +4 -4
package/src/defaults.ts
CHANGED
@@ -1,14 +1,22 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Scope } from "@eslinted/core";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
js: ["
|
4
|
+
js: ["**/*.config.js"],
|
5
5
|
ts: [
|
6
|
+
"**/*.config.ts",
|
6
7
|
"src/**/*.ts",
|
7
|
-
"
|
8
|
+
"types/**/*.d.ts",
|
8
9
|
],
|
9
10
|
svelte: ["src/**/*.svelte"],
|
10
11
|
html: ["src/**/*.html"],
|
11
12
|
json: ["**/*.json"],
|
12
|
-
jsonc: [
|
13
|
-
|
14
|
-
|
13
|
+
jsonc: [
|
14
|
+
"**/*.jsonc",
|
15
|
+
"**/tsconfig.json",
|
16
|
+
],
|
17
|
+
yml: [
|
18
|
+
"**/*.yml",
|
19
|
+
"**/*.yaml",
|
20
|
+
".github/workflows/*.yml",
|
21
|
+
],
|
22
|
+
} as const satisfies Record<Scope, string[]>;
|
package/src/index.ts
CHANGED
@@ -3,12 +3,12 @@ import defaults from "./defaults.js";
|
|
3
3
|
import parsers from "./parsers.js";
|
4
4
|
import plugins from "./plugins.js";
|
5
5
|
import rulesets from "./rulesets.js";
|
6
|
-
import type {
|
6
|
+
import type { Scope } from "@eslinted/core";
|
7
7
|
import type { Rule } from "@eslinted/core";
|
8
8
|
|
9
9
|
export default function (
|
10
10
|
includes: Partial<typeof defaults> = {},
|
11
|
-
overrides: Partial<Record<
|
11
|
+
overrides: Partial<Record<Scope, Rule["rules"]>> = {},
|
12
12
|
) {
|
13
13
|
try {
|
14
14
|
return core(
|
package/src/parsers.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Scope } from "@eslinted/core";
|
2
2
|
import ts from "@typescript-eslint/parser";
|
3
3
|
import svelte from "svelte-eslint-parser";
|
4
4
|
import html from "@html-eslint/parser";
|
@@ -12,4 +12,4 @@ export default {
|
|
12
12
|
json: jsonc,
|
13
13
|
jsonc,
|
14
14
|
yml,
|
15
|
-
} satisfies Partial<Record<
|
15
|
+
} as const satisfies Partial<Record<Scope, unknown>>;
|
package/src/plugins.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Scope } from "@eslinted/core";
|
2
2
|
import stylistic from "@stylistic/eslint-plugin";
|
3
3
|
import ts from "@typescript-eslint/eslint-plugin";
|
4
4
|
import svelte from "eslint-plugin-svelte";
|
@@ -6,7 +6,7 @@ import html from "@html-eslint/eslint-plugin";
|
|
6
6
|
import jsonc from "eslint-plugin-jsonc";
|
7
7
|
import yml from "eslint-plugin-yml";
|
8
8
|
|
9
|
-
|
9
|
+
export default {
|
10
10
|
js: { "@stylistic": stylistic },
|
11
11
|
ts: {
|
12
12
|
"@stylistic": stylistic,
|
@@ -21,12 +21,4 @@ const Plugins = {
|
|
21
21
|
json: { jsonc },
|
22
22
|
jsonc: { jsonc },
|
23
23
|
yml: { yml },
|
24
|
-
} satisfies Record<
|
25
|
-
Scopes,
|
26
|
-
Record<
|
27
|
-
string,
|
28
|
-
{ configs: unknown }
|
29
|
-
>
|
30
|
-
>;
|
31
|
-
|
32
|
-
export default Plugins;
|
24
|
+
} as const satisfies Record<Scope, Record<string, { configs: unknown }>>;
|
@@ -5,8 +5,8 @@ import {
|
|
5
5
|
NEVER,
|
6
6
|
ALWAYS,
|
7
7
|
AS_NEEDED,
|
8
|
+
CONSECUTIVE,
|
8
9
|
ALL,
|
9
|
-
MULTI,
|
10
10
|
BOTH,
|
11
11
|
} from "../state.js";
|
12
12
|
import { Enable } from "../id.js";
|
@@ -15,7 +15,7 @@ const JsEnable = new Rule(
|
|
15
15
|
Enable,
|
16
16
|
{
|
17
17
|
|
18
|
-
|
18
|
+
// #region Problems
|
19
19
|
// [ https://eslint.org/docs/latest/rules/#possible-problems ]
|
20
20
|
"array-callback-return": [
|
21
21
|
ERROR,
|
@@ -25,12 +25,12 @@ const JsEnable = new Rule(
|
|
25
25
|
allowVoid: true,
|
26
26
|
},
|
27
27
|
],
|
28
|
-
"constructor-super": ERROR,
|
28
|
+
"constructor-super": ERROR, /* tsc */
|
29
29
|
"for-direction": ERROR,
|
30
30
|
"getter-return": [
|
31
31
|
ERROR,
|
32
32
|
{ allowImplicit: false },
|
33
|
-
],
|
33
|
+
], /* tsc */
|
34
34
|
"no-async-promise-executor": ERROR,
|
35
35
|
"no-await-in-loop": ERROR,
|
36
36
|
"no-class-assign": ERROR,
|
@@ -39,34 +39,30 @@ const JsEnable = new Rule(
|
|
39
39
|
ERROR,
|
40
40
|
ALWAYS,
|
41
41
|
],
|
42
|
-
|
43
|
-
/* #endregion */
|
44
|
-
|
45
|
-
/* #region Gunner */
|
46
|
-
"no-const-assign": ERROR, // tsc
|
42
|
+
"no-const-assign": ERROR, /* tsc */
|
47
43
|
"no-constant-binary-expression": ERROR,
|
48
44
|
"no-constant-condition": [
|
49
45
|
ERROR,
|
50
|
-
{ checkLoops:
|
46
|
+
{ checkLoops: ALL },
|
51
47
|
],
|
52
48
|
"no-constructor-return": ERROR,
|
53
49
|
"no-control-regex": ERROR,
|
54
50
|
"no-debugger": ERROR,
|
55
|
-
"no-dupe-args": ERROR,
|
56
|
-
"no-dupe-class-members": ERROR,
|
51
|
+
"no-dupe-args": ERROR, /* tsc */
|
52
|
+
"no-dupe-class-members": ERROR, /* tsc -- TSLint:off: tsc */
|
57
53
|
"no-dupe-else-if": ERROR,
|
58
|
-
"no-dupe-keys": ERROR,
|
54
|
+
"no-dupe-keys": ERROR, /* tsc */
|
59
55
|
"no-duplicate-case": ERROR,
|
60
|
-
"no-duplicate-imports": OFF,
|
56
|
+
"no-duplicate-imports": OFF, /* BUG: breaks separation of TS type-only imports from value imports */
|
61
57
|
"no-empty-character-class": ERROR,
|
62
58
|
"no-empty-pattern": [
|
63
59
|
ERROR,
|
64
|
-
{ allowObjectPatternsAsParameters:
|
60
|
+
{ allowObjectPatternsAsParameters: false },
|
65
61
|
],
|
66
62
|
"no-ex-assign": ERROR,
|
67
|
-
"no-fallthrough": OFF,
|
68
|
-
"no-func-assign": ERROR,
|
69
|
-
"no-import-assign": ERROR,
|
63
|
+
"no-fallthrough": OFF, /* BUG: */
|
64
|
+
"no-func-assign": ERROR, /* tsc */
|
65
|
+
"no-import-assign": ERROR, /* tsc (except Object.assign()) */
|
70
66
|
"no-inner-declarations": [
|
71
67
|
ERROR,
|
72
68
|
BOTH,
|
@@ -85,10 +81,10 @@ const JsEnable = new Rule(
|
|
85
81
|
skipJSXText: true,
|
86
82
|
},
|
87
83
|
],
|
88
|
-
"no-loss-of-precision": ERROR,
|
84
|
+
"no-loss-of-precision": ERROR, /* TSLint */
|
89
85
|
"no-misleading-character-class": ERROR,
|
90
86
|
"no-new-native-nonconstructor": ERROR,
|
91
|
-
"no-obj-calls": ERROR,
|
87
|
+
"no-obj-calls": ERROR, /* tsc */
|
92
88
|
"no-promise-executor-return": [
|
93
89
|
ERROR,
|
94
90
|
{ allowVoid: true },
|
@@ -99,23 +95,23 @@ const JsEnable = new Rule(
|
|
99
95
|
{ props: true },
|
100
96
|
],
|
101
97
|
"no-self-compare": ERROR,
|
102
|
-
"no-setter-return": ERROR,
|
98
|
+
"no-setter-return": ERROR, /* tsc */
|
103
99
|
"no-sparse-arrays": ERROR,
|
104
100
|
"no-template-curly-in-string": ERROR,
|
105
|
-
"no-this-before-super": ERROR,
|
106
|
-
"no-undef": ERROR,
|
101
|
+
"no-this-before-super": ERROR, /* tsc */
|
102
|
+
"no-undef": ERROR, /* tsc */
|
107
103
|
"no-unexpected-multiline": ERROR,
|
108
104
|
"no-unmodified-loop-condition": ERROR,
|
109
|
-
"no-unreachable": ERROR,
|
105
|
+
"no-unreachable": ERROR, /* tsc */
|
110
106
|
"no-unreachable-loop": [
|
111
107
|
ERROR,
|
112
|
-
{ ignore: [] },
|
108
|
+
{ ignore: [] }, /* WhileStatement, DoWhileStatement, ForStatement, ForInStatement, ForOfStatement */
|
113
109
|
],
|
114
110
|
"no-unsafe-finally": ERROR,
|
115
111
|
"no-unsafe-negation": [
|
116
112
|
ERROR,
|
117
113
|
{ enforceForOrderingRelations: true },
|
118
|
-
],
|
114
|
+
], /* tsc */
|
119
115
|
"no-unsafe-optional-chaining": [
|
120
116
|
ERROR,
|
121
117
|
{ disallowArithmeticOperators: true },
|
@@ -129,7 +125,7 @@ const JsEnable = new Rule(
|
|
129
125
|
caughtErrors: ALL,
|
130
126
|
ignoreRestSiblings: false,
|
131
127
|
},
|
132
|
-
],
|
128
|
+
], /* TSLint */
|
133
129
|
"no-use-before-define": [
|
134
130
|
ERROR,
|
135
131
|
{
|
@@ -138,7 +134,7 @@ const JsEnable = new Rule(
|
|
138
134
|
variables: true,
|
139
135
|
allowNamedExports: false,
|
140
136
|
},
|
141
|
-
],
|
137
|
+
], /* TSLint */
|
142
138
|
"no-useless-backreference": ERROR,
|
143
139
|
"require-atomic-updates": [
|
144
140
|
ERROR,
|
@@ -156,7 +152,9 @@ const JsEnable = new Rule(
|
|
156
152
|
{ requireStringLiterals: true },
|
157
153
|
],
|
158
154
|
|
159
|
-
//
|
155
|
+
// #endregion
|
156
|
+
|
157
|
+
// # region Suggestions
|
160
158
|
// [ https://eslint.org/docs/latest/rules/#suggestions ]
|
161
159
|
"accessor-pairs": [
|
162
160
|
ERROR,
|
@@ -172,58 +170,58 @@ const JsEnable = new Rule(
|
|
172
170
|
{ requireReturnForObjectLiteral: true },
|
173
171
|
],
|
174
172
|
"block-scoped-var": ERROR,
|
175
|
-
camelcase: OFF,
|
176
|
-
"capitalized-comments": OFF,
|
177
|
-
"class-methods-use-this": OFF,
|
178
|
-
complexity: OFF,
|
173
|
+
camelcase: OFF, /* preference */
|
174
|
+
"capitalized-comments": OFF, /* preference */
|
175
|
+
"class-methods-use-this": OFF, /* preference -- TSLint */
|
176
|
+
complexity: OFF, /* preference */
|
179
177
|
"consistent-return": [
|
180
178
|
ERROR,
|
181
179
|
{ treatUndefinedAsUnspecified: false },
|
182
|
-
],
|
183
|
-
"consistent-this":
|
180
|
+
], /* tsc -- TSLint:off: tsconfig: noImplicitReturns */
|
181
|
+
"consistent-this": ERROR,
|
184
182
|
curly: [
|
185
183
|
ERROR,
|
186
|
-
|
184
|
+
"multi-or-nest",
|
187
185
|
],
|
188
|
-
"default-case": OFF,
|
186
|
+
"default-case": OFF, /* preference: don't care */
|
189
187
|
"default-case-last": ERROR,
|
190
|
-
"default-param-last": ERROR,
|
188
|
+
"default-param-last": ERROR, /* TSLint */
|
191
189
|
"dot-notation": [
|
192
190
|
ERROR,
|
193
191
|
{ allowKeywords: true },
|
194
|
-
],
|
192
|
+
], /* TSLint */
|
195
193
|
eqeqeq: [
|
196
194
|
ERROR,
|
197
195
|
ALWAYS,
|
198
196
|
],
|
199
|
-
"func-name-matching": OFF,
|
200
|
-
"func-names": OFF,
|
201
|
-
"func-style": OFF,
|
202
|
-
"grouped-accessor-pairs": OFF,
|
203
|
-
"guard-for-in":
|
204
|
-
"id-denylist": OFF,
|
205
|
-
"id-length": OFF,
|
206
|
-
"id-match": OFF,
|
197
|
+
"func-name-matching": OFF, /* preference */
|
198
|
+
"func-names": OFF, /* preference */
|
199
|
+
"func-style": OFF, /* preference */
|
200
|
+
"grouped-accessor-pairs": OFF, /* preference -- BUG: requires adjacency, not as described in documentation */
|
201
|
+
"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 */
|
202
|
+
"id-denylist": OFF, /* preference */
|
203
|
+
"id-length": OFF, /* preference */
|
204
|
+
"id-match": OFF, /* preference */
|
207
205
|
"init-declarations": [
|
208
206
|
ERROR,
|
209
207
|
ALWAYS,
|
210
|
-
],
|
208
|
+
], /* TSLint */
|
211
209
|
"logical-assignment-operators": [
|
212
210
|
ERROR,
|
213
211
|
ALWAYS,
|
214
212
|
{ enforceForIfStatements: true },
|
215
213
|
],
|
216
|
-
"max-classes-per-file": OFF,
|
217
|
-
"max-depth": OFF,
|
218
|
-
"max-lines": OFF,
|
219
|
-
"max-lines-per-function": OFF,
|
220
|
-
"max-nested-callbacks": OFF,
|
221
|
-
"max-params": OFF,
|
222
|
-
"max-statements": OFF,
|
223
|
-
"multiline-comment-style": OFF,
|
224
|
-
"new-cap": OFF,
|
214
|
+
"max-classes-per-file": OFF, /* preference */
|
215
|
+
"max-depth": OFF, /* preference */
|
216
|
+
"max-lines": OFF, /* preference */
|
217
|
+
"max-lines-per-function": OFF, /* preference */
|
218
|
+
"max-nested-callbacks": OFF, /* preference */
|
219
|
+
"max-params": OFF, /* preference -- TSLint:off: preference */
|
220
|
+
"max-statements": OFF, /* preference */
|
221
|
+
"multiline-comment-style": OFF, /* preference */
|
222
|
+
"new-cap": OFF, /* preference -- breaks Scriptable */
|
225
223
|
"no-alert": ERROR,
|
226
|
-
"no-array-constructor": ERROR,
|
224
|
+
"no-array-constructor": ERROR, /* TSLint */
|
227
225
|
"no-bitwise": [
|
228
226
|
ERROR,
|
229
227
|
{
|
@@ -233,11 +231,11 @@ const JsEnable = new Rule(
|
|
233
231
|
],
|
234
232
|
"no-caller": ERROR,
|
235
233
|
"no-case-declarations": ERROR,
|
236
|
-
"no-console": OFF,
|
234
|
+
"no-console": OFF, /* preference -- breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */
|
237
235
|
"no-continue": ERROR,
|
238
236
|
"no-delete-var": ERROR,
|
239
237
|
"no-div-regex": ERROR,
|
240
|
-
"no-else-return": OFF,
|
238
|
+
"no-else-return": OFF, /* preference */
|
241
239
|
"no-empty": [
|
242
240
|
ERROR,
|
243
241
|
{ allowEmptyCatch: false },
|
@@ -245,7 +243,7 @@ const JsEnable = new Rule(
|
|
245
243
|
"no-empty-function": [
|
246
244
|
ERROR,
|
247
245
|
{ allow: ["constructors"] }, /** functions, arrowFunctions, generatorFunctions, methods, generatorMethods, getters, setters, constructors, asyncFunctions, asyncMethods; TS-ONLY: private-constructors, protected-constructors, decoratedFunctions, overrideMethods */
|
248
|
-
],
|
246
|
+
], /* TSLint */
|
249
247
|
"no-empty-static-block": ERROR,
|
250
248
|
"no-eq-null": ERROR,
|
251
249
|
"no-eval": [
|
@@ -276,36 +274,26 @@ const JsEnable = new Rule(
|
|
276
274
|
allow: [], /** "~" | "!!" | "+" | "- -" | "-" | "*" */
|
277
275
|
},
|
278
276
|
],
|
279
|
-
"no-implicit-globals": OFF,
|
280
|
-
"no-implied-eval": ERROR,
|
281
|
-
"no-inline-comments": OFF,
|
277
|
+
"no-implicit-globals": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
278
|
+
"no-implied-eval": ERROR, /* TSLint */
|
279
|
+
"no-inline-comments": OFF, /* preference */
|
282
280
|
"no-invalid-this": [
|
283
281
|
ERROR,
|
284
282
|
{ capIsConstructor: false },
|
285
|
-
],
|
283
|
+
], /* TSLint:off: tsconfig: { strict, noImplicitThis } */
|
286
284
|
"no-iterator": ERROR,
|
287
285
|
"no-label-var": ERROR,
|
288
286
|
"no-lone-blocks": ERROR,
|
289
|
-
"no-lonely-if": OFF,
|
290
|
-
"no-loop-func": ERROR,
|
291
|
-
"no-magic-numbers":
|
292
|
-
OFF,
|
293
|
-
{
|
294
|
-
ignore: [],
|
295
|
-
ignoreArrayIndexes: true,
|
296
|
-
ignoreDefaultValues: true,
|
297
|
-
ignoreClassFieldInitialValues: true,
|
298
|
-
enforceConst: true,
|
299
|
-
detectObjects: false,
|
300
|
-
},
|
301
|
-
], // TSLint
|
287
|
+
"no-lonely-if": OFF, /* preference */
|
288
|
+
"no-loop-func": ERROR, /* TSLint */
|
289
|
+
"no-magic-numbers": OFF, /* preference - breaks TypeScript number literals, even with most liberal exceptions */
|
302
290
|
"no-multi-assign": [
|
303
291
|
ERROR,
|
304
292
|
{ ignoreNonDeclaration: false },
|
305
293
|
],
|
306
294
|
"no-multi-str": ERROR,
|
307
|
-
"no-negated-condition": OFF,
|
308
|
-
"no-nested-ternary": OFF,
|
295
|
+
"no-negated-condition": OFF, /* preference */
|
296
|
+
"no-nested-ternary": OFF, /* preference */
|
309
297
|
"no-new": ERROR,
|
310
298
|
"no-new-func": ERROR,
|
311
299
|
"no-new-wrappers": ERROR,
|
@@ -329,29 +317,29 @@ const JsEnable = new Rule(
|
|
329
317
|
"no-redeclare": [
|
330
318
|
ERROR,
|
331
319
|
{ builtinGlobals: true },
|
332
|
-
],
|
333
|
-
"no-regex-spaces": OFF,
|
334
|
-
"no-restricted-exports": OFF,
|
335
|
-
"no-restricted-globals": OFF,
|
336
|
-
"no-restricted-imports": OFF,
|
337
|
-
"no-restricted-properties": OFF,
|
338
|
-
"no-restricted-syntax": OFF,
|
320
|
+
], /* tsc -- TSLint:off: tsc (let, const, -var) */
|
321
|
+
"no-regex-spaces": OFF, /* preference */
|
322
|
+
"no-restricted-exports": OFF, /* preference */
|
323
|
+
"no-restricted-globals": OFF, /* preference */
|
324
|
+
"no-restricted-imports": OFF, /* preference -- TSLint:off */
|
325
|
+
"no-restricted-properties": OFF, /* preference */
|
326
|
+
"no-restricted-syntax": OFF, /* preference */
|
339
327
|
"no-return-assign": [
|
340
328
|
ERROR,
|
341
|
-
ALWAYS,
|
329
|
+
ALWAYS, /* ALWAYS | "except-parens" (disallow assignments unless enclosed in parens) */
|
342
330
|
],
|
343
331
|
"no-script-url": ERROR,
|
344
332
|
"no-sequences": [
|
345
333
|
ERROR,
|
346
334
|
{ allowInParentheses: true },
|
347
335
|
],
|
348
|
-
"no-shadow": OFF,
|
336
|
+
"no-shadow": OFF, /* investigate -- TSLint:off: investigate */
|
349
337
|
"no-shadow-restricted-names": ERROR,
|
350
|
-
"no-ternary": OFF,
|
351
|
-
"no-throw-literal": ERROR,
|
338
|
+
"no-ternary": OFF, /* preference */
|
339
|
+
"no-throw-literal": ERROR, /* TSLint */
|
352
340
|
"no-undef-init": ERROR,
|
353
|
-
"no-undefined": OFF,
|
354
|
-
"no-underscore-dangle": OFF,
|
341
|
+
"no-undefined": OFF, /* investigate (breaks Scriptable? breaks Sveltekit?) */
|
342
|
+
"no-underscore-dangle": OFF, /* preference */
|
355
343
|
"no-unneeded-ternary": [
|
356
344
|
ERROR,
|
357
345
|
{ defaultAssignment: false },
|
@@ -364,7 +352,7 @@ const JsEnable = new Rule(
|
|
364
352
|
allowTaggedTemplates: true,
|
365
353
|
enforceForJSX: false,
|
366
354
|
},
|
367
|
-
],
|
355
|
+
], /* TSLint */
|
368
356
|
"no-unused-labels": ERROR,
|
369
357
|
"no-useless-call": ERROR,
|
370
358
|
"no-useless-catch": ERROR,
|
@@ -373,7 +361,7 @@ const JsEnable = new Rule(
|
|
373
361
|
{ enforceForClassMembers: true },
|
374
362
|
],
|
375
363
|
"no-useless-concat": ERROR,
|
376
|
-
"no-useless-constructor": ERROR,
|
364
|
+
"no-useless-constructor": ERROR, /* TSLint */
|
377
365
|
"no-useless-escape": ERROR,
|
378
366
|
"no-useless-rename": [
|
379
367
|
ERROR,
|
@@ -389,7 +377,7 @@ const JsEnable = new Rule(
|
|
389
377
|
ERROR,
|
390
378
|
{ allowAsStatement: true },
|
391
379
|
],
|
392
|
-
"no-warning-comments": OFF,
|
380
|
+
"no-warning-comments": OFF, /* preference */
|
393
381
|
"no-with": ERROR,
|
394
382
|
"object-shorthand": [
|
395
383
|
ERROR,
|
@@ -403,9 +391,9 @@ const JsEnable = new Rule(
|
|
403
391
|
"one-var": [
|
404
392
|
ERROR,
|
405
393
|
{
|
406
|
-
"var":
|
407
|
-
let:
|
408
|
-
"const":
|
394
|
+
"var": CONSECUTIVE,
|
395
|
+
let: CONSECUTIVE,
|
396
|
+
"const": CONSECUTIVE,
|
409
397
|
separateRequires: true,
|
410
398
|
},
|
411
399
|
],
|
@@ -440,7 +428,7 @@ const JsEnable = new Rule(
|
|
440
428
|
},
|
441
429
|
},
|
442
430
|
{ enforceForRenamedProperties: true },
|
443
|
-
],
|
431
|
+
], /* TSLint */
|
444
432
|
"prefer-exponentiation-operator": ERROR,
|
445
433
|
"prefer-named-capture-group": OFF,
|
446
434
|
"prefer-numeric-literals": ERROR,
|
@@ -453,7 +441,7 @@ const JsEnable = new Rule(
|
|
453
441
|
"prefer-regex-literals": [
|
454
442
|
ERROR,
|
455
443
|
{ disallowRedundantWrapping: true },
|
456
|
-
],
|
444
|
+
], /* TSLint */
|
457
445
|
"prefer-rest-params": ERROR,
|
458
446
|
"prefer-spread": ERROR,
|
459
447
|
"prefer-template": ERROR,
|
@@ -461,14 +449,14 @@ const JsEnable = new Rule(
|
|
461
449
|
ERROR,
|
462
450
|
AS_NEEDED,
|
463
451
|
],
|
464
|
-
"require-await": ERROR,
|
452
|
+
"require-await": ERROR, /* TSLint */
|
465
453
|
"require-unicode-regexp": ERROR,
|
466
454
|
"require-yield": ERROR,
|
467
|
-
"sort-imports": OFF,
|
468
|
-
"sort-keys": OFF,
|
469
|
-
"sort-vars": OFF,
|
470
|
-
strict: OFF,
|
471
|
-
"symbol-description": OFF,
|
455
|
+
"sort-imports": OFF, /* preference */
|
456
|
+
"sort-keys": OFF, /* preference */
|
457
|
+
"sort-vars": OFF, /* preference */
|
458
|
+
strict: OFF, /* preference */
|
459
|
+
"symbol-description": OFF, /* preference */
|
472
460
|
"vars-on-top": ERROR,
|
473
461
|
yoda: [
|
474
462
|
ERROR,
|
@@ -479,10 +467,13 @@ const JsEnable = new Rule(
|
|
479
467
|
},
|
480
468
|
],
|
481
469
|
|
470
|
+
// #endregion
|
471
|
+
|
482
472
|
// Layout & Formatting
|
483
473
|
// [ https://eslint.org/docs/latest/rules/#layout--formatting ]
|
484
|
-
"
|
485
|
-
|
474
|
+
"unicode-bom": OFF, /* preference: don't care */
|
475
|
+
|
476
|
+
// #endregion
|
486
477
|
},
|
487
478
|
);
|
488
479
|
|
@@ -360,23 +360,23 @@ const StylisticEnable = new Rule(
|
|
360
360
|
{
|
361
361
|
ObjectExpression: {
|
362
362
|
multiline: true,
|
363
|
-
minProperties:
|
364
|
-
consistent:
|
363
|
+
minProperties: 3,
|
364
|
+
consistent: true,
|
365
365
|
},
|
366
366
|
ObjectPattern: {
|
367
367
|
multiline: true,
|
368
|
-
minProperties:
|
369
|
-
consistent:
|
368
|
+
minProperties: 3,
|
369
|
+
consistent: true,
|
370
370
|
},
|
371
371
|
ImportDeclaration: {
|
372
372
|
multiline: true,
|
373
|
-
minProperties:
|
374
|
-
consistent:
|
373
|
+
minProperties: 3,
|
374
|
+
consistent: true,
|
375
375
|
},
|
376
376
|
ExportDeclaration: {
|
377
377
|
multiline: true,
|
378
|
-
minProperties:
|
379
|
-
consistent:
|
378
|
+
minProperties: 3,
|
379
|
+
consistent: true,
|
380
380
|
},
|
381
381
|
},
|
382
382
|
],
|
@@ -390,7 +390,7 @@ const StylisticEnable = new Rule(
|
|
390
390
|
],
|
391
391
|
"@stylistic/object-property-newline": [
|
392
392
|
ERROR,
|
393
|
-
{ allowAllPropertiesOnSameLine:
|
393
|
+
{ allowAllPropertiesOnSameLine: true },
|
394
394
|
],
|
395
395
|
"@stylistic/one-var-declaration-per-line": [
|
396
396
|
ERROR,
|
@@ -399,13 +399,7 @@ const StylisticEnable = new Rule(
|
|
399
399
|
"@stylistic/operator-linebreak": [
|
400
400
|
ERROR,
|
401
401
|
BEFORE,
|
402
|
-
{
|
403
|
-
overrides: {
|
404
|
-
"=": AFTER,
|
405
|
-
"?": BEFORE,
|
406
|
-
":": BEFORE,
|
407
|
-
},
|
408
|
-
},
|
402
|
+
{ overrides: { "=": AFTER } },
|
409
403
|
],
|
410
404
|
"@stylistic/padded-blocks": [
|
411
405
|
ERROR,
|
@@ -686,8 +680,8 @@ const StylisticEnable = new Rule(
|
|
686
680
|
"@stylistic/yield-star-spacing": [
|
687
681
|
ERROR,
|
688
682
|
{
|
689
|
-
before:
|
690
|
-
after:
|
683
|
+
before: false,
|
684
|
+
after: true,
|
691
685
|
},
|
692
686
|
],
|
693
687
|
},
|
@@ -6,6 +6,7 @@ const ALWAYS = "always";
|
|
6
6
|
const ALWAYS_MULTILINE = "always-multiline";
|
7
7
|
const MULTILINE = "multiline";
|
8
8
|
const CONSISTENT = "consistent";
|
9
|
+
const CONSECUTIVE = "consecutive";
|
9
10
|
const AS_NEEDED = "as-needed";
|
10
11
|
const STRICT = "strict";
|
11
12
|
const ANY = "any";
|
@@ -34,6 +35,7 @@ export {
|
|
34
35
|
ALWAYS_MULTILINE,
|
35
36
|
MULTILINE,
|
36
37
|
CONSISTENT,
|
38
|
+
CONSECUTIVE,
|
37
39
|
AS_NEEDED,
|
38
40
|
STRICT,
|
39
41
|
ANY,
|
package/src/rulesets.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import type { Scope } from "@eslinted/core";
|
2
|
+
import type { Ruleset } from "@eslinted/core";
|
1
3
|
import JsRuleset from "./rulesets/JsRuleset.js";
|
2
4
|
import TsRuleset from "./rulesets/TsRuleset.js";
|
3
5
|
import SvelteRuleset from "./rulesets/SvelteRuleset.js";
|
@@ -6,7 +8,7 @@ import JsonRuleset from "./rulesets/JsonRuleset.js";
|
|
6
8
|
import JsoncRuleset from "./rulesets/JsoncRuleset.js";
|
7
9
|
import YmlRuleset from "./rulesets/YmlRuleset.js";
|
8
10
|
|
9
|
-
|
11
|
+
export default {
|
10
12
|
js: JsRuleset,
|
11
13
|
ts: TsRuleset,
|
12
14
|
svelte: SvelteRuleset,
|
@@ -14,6 +16,4 @@ const rulesets = {
|
|
14
16
|
json: JsonRuleset,
|
15
17
|
jsonc: JsoncRuleset,
|
16
18
|
yml: YmlRuleset,
|
17
|
-
} as const;
|
18
|
-
|
19
|
-
export default rulesets;
|
19
|
+
} as const satisfies { [S in Scope]: Ruleset<S> };
|