@eslinted/defaults 20.4.0 → 21.0.1

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.
Files changed (131) hide show
  1. package/dist/index.d.ts +504 -523
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/rules/{state.d.ts → _state.d.ts} +1 -1
  4. package/dist/rules/_state.d.ts.map +1 -0
  5. package/dist/rules/_state.js +2 -0
  6. package/dist/rules/_state.js.map +1 -0
  7. package/dist/rules/{css/index.d.ts → css.d.ts} +3 -3
  8. package/dist/rules/css.d.ts.map +1 -0
  9. package/dist/rules/css.js +17 -0
  10. package/dist/rules/css.js.map +1 -0
  11. package/dist/rules/{html/index.d.ts → html.d.ts} +3 -3
  12. package/dist/rules/html.d.ts.map +1 -0
  13. package/dist/rules/html.js +41 -0
  14. package/dist/rules/html.js.map +1 -0
  15. package/dist/rules/index.d.ts +504 -523
  16. package/dist/rules/index.d.ts.map +1 -1
  17. package/dist/rules/index.js +7 -7
  18. package/dist/rules/js.d.ts +219 -221
  19. package/dist/rules/js.d.ts.map +1 -1
  20. package/dist/rules/js.js +545 -7
  21. package/dist/rules/js.js.map +1 -1
  22. package/dist/rules/{json/jsonc.d.ts → json.d.ts} +4 -2
  23. package/dist/rules/json.d.ts.map +1 -0
  24. package/dist/rules/{json/jsonc.js → json.js} +3 -1
  25. package/dist/rules/json.js.map +1 -0
  26. package/dist/rules/{jsonc/index.d.ts → jsonc.d.ts} +3 -3
  27. package/dist/rules/jsonc.d.ts.map +1 -0
  28. package/dist/rules/jsonc.js +10 -0
  29. package/dist/rules/jsonc.js.map +1 -0
  30. package/dist/rules/{svelte/svelte.d.ts → svelte.d.ts} +16 -1
  31. package/dist/rules/svelte.d.ts.map +1 -0
  32. package/dist/rules/{svelte/svelte.js → svelte.js} +15 -0
  33. package/dist/rules/svelte.js.map +1 -0
  34. package/dist/rules/{ts/ts.d.ts → ts.d.ts} +51 -1
  35. package/dist/rules/ts.d.ts.map +1 -0
  36. package/dist/rules/{ts/ts.js → ts.js} +50 -0
  37. package/dist/rules/ts.js.map +1 -0
  38. package/dist/rules/{yml/index.d.ts → yml.d.ts} +3 -3
  39. package/dist/rules/yml.d.ts.map +1 -0
  40. package/dist/rules/yml.js +32 -0
  41. package/dist/rules/yml.js.map +1 -0
  42. package/package.json +1 -1
  43. package/src/rules/css.ts +22 -0
  44. package/src/rules/html.ts +82 -0
  45. package/src/rules/js.ts +621 -6
  46. package/src/rules/{json/jsonc.ts → json.ts} +7 -1
  47. package/src/rules/jsonc.ts +11 -0
  48. package/src/rules/{svelte/svelte.ts → svelte.ts} +39 -2
  49. package/src/rules/{ts/ts.ts → ts.ts} +67 -2
  50. package/src/rules/yml.ts +56 -0
  51. package/dist/rules/css/index.d.ts.map +0 -1
  52. package/dist/rules/css/index.js +0 -19
  53. package/dist/rules/css/index.js.map +0 -1
  54. package/dist/rules/html/index.d.ts.map +0 -1
  55. package/dist/rules/html/index.js +0 -43
  56. package/dist/rules/html/index.js.map +0 -1
  57. package/dist/rules/js.eslint.d.ts +0 -289
  58. package/dist/rules/js.eslint.d.ts.map +0 -1
  59. package/dist/rules/js.eslint.js +0 -285
  60. package/dist/rules/js.eslint.js.map +0 -1
  61. package/dist/rules/js.stylistic.d.ts +0 -271
  62. package/dist/rules/js.stylistic.d.ts.map +0 -1
  63. package/dist/rules/js.stylistic.js +0 -265
  64. package/dist/rules/js.stylistic.js.map +0 -1
  65. package/dist/rules/json/index.d.ts +0 -33
  66. package/dist/rules/json/index.d.ts.map +0 -1
  67. package/dist/rules/json/index.js +0 -7
  68. package/dist/rules/json/index.js.map +0 -1
  69. package/dist/rules/json/json.d.ts +0 -9
  70. package/dist/rules/json/json.d.ts.map +0 -1
  71. package/dist/rules/json/json.js +0 -7
  72. package/dist/rules/json/json.js.map +0 -1
  73. package/dist/rules/json/jsonc.d.ts.map +0 -1
  74. package/dist/rules/json/jsonc.js.map +0 -1
  75. package/dist/rules/jsonc/index.d.ts.map +0 -1
  76. package/dist/rules/jsonc/index.js +0 -12
  77. package/dist/rules/jsonc/index.js.map +0 -1
  78. package/dist/rules/state.d.ts.map +0 -1
  79. package/dist/rules/state.js +0 -2
  80. package/dist/rules/state.js.map +0 -1
  81. package/dist/rules/svelte/disable.d.ts +0 -17
  82. package/dist/rules/svelte/disable.d.ts.map +0 -1
  83. package/dist/rules/svelte/disable.js +0 -15
  84. package/dist/rules/svelte/disable.js.map +0 -1
  85. package/dist/rules/svelte/extend.d.ts +0 -13
  86. package/dist/rules/svelte/extend.d.ts.map +0 -1
  87. package/dist/rules/svelte/extend.js +0 -11
  88. package/dist/rules/svelte/extend.js.map +0 -1
  89. package/dist/rules/svelte/html.d.ts +0 -14
  90. package/dist/rules/svelte/html.d.ts.map +0 -1
  91. package/dist/rules/svelte/html.js +0 -12
  92. package/dist/rules/svelte/html.js.map +0 -1
  93. package/dist/rules/svelte/index.d.ts +0 -115
  94. package/dist/rules/svelte/index.d.ts.map +0 -1
  95. package/dist/rules/svelte/index.js +0 -9
  96. package/dist/rules/svelte/index.js.map +0 -1
  97. package/dist/rules/svelte/svelte.d.ts.map +0 -1
  98. package/dist/rules/svelte/svelte.js.map +0 -1
  99. package/dist/rules/ts/disable.d.ts +0 -26
  100. package/dist/rules/ts/disable.d.ts.map +0 -1
  101. package/dist/rules/ts/disable.js +0 -24
  102. package/dist/rules/ts/disable.js.map +0 -1
  103. package/dist/rules/ts/extend.d.ts +0 -38
  104. package/dist/rules/ts/extend.d.ts.map +0 -1
  105. package/dist/rules/ts/extend.js +0 -36
  106. package/dist/rules/ts/extend.js.map +0 -1
  107. package/dist/rules/ts/index.d.ts +0 -242
  108. package/dist/rules/ts/index.d.ts.map +0 -1
  109. package/dist/rules/ts/index.js +0 -9
  110. package/dist/rules/ts/index.js.map +0 -1
  111. package/dist/rules/ts/ts.d.ts.map +0 -1
  112. package/dist/rules/ts/ts.js.map +0 -1
  113. package/dist/rules/yml/index.d.ts.map +0 -1
  114. package/dist/rules/yml/index.js +0 -34
  115. package/dist/rules/yml/index.js.map +0 -1
  116. package/src/rules/css/index.ts +0 -24
  117. package/src/rules/html/index.ts +0 -84
  118. package/src/rules/js.eslint.ts +0 -348
  119. package/src/rules/js.stylistic.ts +0 -279
  120. package/src/rules/json/index.ts +0 -7
  121. package/src/rules/json/json.ts +0 -13
  122. package/src/rules/jsonc/index.ts +0 -13
  123. package/src/rules/svelte/disable.ts +0 -21
  124. package/src/rules/svelte/extend.ts +0 -14
  125. package/src/rules/svelte/html.ts +0 -14
  126. package/src/rules/svelte/index.ts +0 -11
  127. package/src/rules/ts/disable.ts +0 -26
  128. package/src/rules/ts/extend.ts +0 -42
  129. package/src/rules/ts/index.ts +0 -9
  130. package/src/rules/yml/index.ts +0 -58
  131. /package/src/rules/{state.ts → _state.ts} +0 -0
package/src/rules/js.ts CHANGED
@@ -1,7 +1,622 @@
1
- import eslint from "./js.eslint";
2
- import stylistic from "./js.stylistic";
1
+ import { State } from "./_state";
3
2
 
4
- export default [
5
- eslint,
6
- stylistic,
7
- ];
3
+ // DOC: https://eslint.org/docs/latest/rules/
4
+ export default {
5
+ rules: {
6
+ // #region PROBLEMS
7
+ // DOC: https://eslint.org/docs/latest/rules/#possible-problems
8
+ "array-callback-return": [
9
+ State.ON,
10
+ {
11
+ checkForEach: true,
12
+ allowVoid: true /* INFO: only works if checkForEach */,
13
+ },
14
+ ],
15
+ "constructor-super": State.ON /* @tsc */,
16
+ "for-direction": State.ON,
17
+ "getter-return": State.ON /* @tsc */,
18
+ "no-async-promise-executor": State.ON,
19
+ "no-await-in-loop": State.ON,
20
+ "no-class-assign": State.ON,
21
+ "no-compare-neg-zero": State.ON,
22
+ "no-cond-assign": State.ON,
23
+ "no-const-assign": State.ON /* @tsc */,
24
+ "no-constant-binary-expression": State.ON,
25
+ "no-constant-condition": [
26
+ State.ON,
27
+ {
28
+ checkLoops: "all",
29
+ },
30
+ ] /* BUG: incorrect option description (claims "all" is ok): https://eslint.org/docs/latest/rules/no-constant-condition */,
31
+ "no-constructor-return": State.ON,
32
+ "no-control-regex": State.ON,
33
+ "no-debugger": State.ON,
34
+ "no-dupe-args": State.ON /* @tsc */,
35
+ "no-dupe-class-members": State.ON /* supports TypeScript BUT @tsc */,
36
+ "no-dupe-else-if": State.ON,
37
+ "no-dupe-keys": State.ON /* @tsc */,
38
+ "no-duplicate-case": State.ON,
39
+ "no-duplicate-imports": [
40
+ State.ON,
41
+ {
42
+ includeExports: true,
43
+ allowSeparateTypeImports: true,
44
+ },
45
+ ],
46
+ "no-empty-character-class": State.ON,
47
+ "no-empty-pattern": State.ON,
48
+ "no-ex-assign": State.ON,
49
+ "no-fallthrough": State.ON,
50
+ "no-func-assign": State.ON /* @tsc */,
51
+ "no-import-assign": State.ON /* @tsc: (-Object.assign) */,
52
+ "no-inner-declarations": [
53
+ State.ON,
54
+ "both",
55
+ ],
56
+ "no-invalid-regexp": State.ON,
57
+ "no-irregular-whitespace": State.ON,
58
+ "no-loss-of-precision": State.ON /* supports TypeScript */,
59
+ "no-misleading-character-class": State.ON,
60
+ "no-new-native-nonconstructor": State.ON,
61
+ "no-obj-calls": State.ON /* @tsc */,
62
+ "no-promise-executor-return": [
63
+ State.ON,
64
+ {
65
+ allowVoid: true,
66
+ },
67
+ ],
68
+ "no-prototype-builtins": State.ON,
69
+ "no-self-assign": State.ON,
70
+ "no-self-compare": State.ON,
71
+ "no-setter-return": State.ON /* @tsc */,
72
+ "no-sparse-arrays": State.ON,
73
+ "no-template-curly-in-string": State.ON,
74
+ "no-this-before-super": State.ON /* @tsc */,
75
+ "no-unassigned-vars": State.ON,
76
+ "no-undef": State.ON /* @tsc */,
77
+ "no-unexpected-multiline": State.ON,
78
+ "no-unmodified-loop-condition": State.ON,
79
+ "no-unreachable": State.WARN /* @tsc */,
80
+ "no-unreachable-loop": State.WARN,
81
+ "no-unsafe-finally": State.ON,
82
+ "no-unsafe-negation": [
83
+ State.ON,
84
+ {
85
+ enforceForOrderingRelations: true,
86
+ },
87
+ ] /* @tsc */,
88
+ "no-unsafe-optional-chaining": [
89
+ State.ON,
90
+ {
91
+ disallowArithmeticOperators: true,
92
+ },
93
+ ],
94
+ "no-unused-private-class-members": State.WARN,
95
+ "no-unused-vars": State.WARN /* TSLint */,
96
+ "no-use-before-define": [
97
+ State.ON,
98
+ {
99
+ typedefs: false,
100
+ },
101
+ ] /* supports TypeScript */,
102
+ "no-useless-assignment": State.ON,
103
+ "no-useless-backreference": State.ON,
104
+ "require-atomic-updates": State.ON,
105
+ "use-isnan": [
106
+ State.ON,
107
+ {
108
+ enforceForIndexOf: true,
109
+ },
110
+ ],
111
+ "valid-typeof": [
112
+ State.ON,
113
+ {
114
+ requireStringLiterals: true,
115
+ },
116
+ ],
117
+ // #endregion
118
+
119
+ // #region SUGGESTIONS
120
+ // [ https://eslint.org/docs/latest/rules/#suggestions ]
121
+ "accessor-pairs": [
122
+ State.ON,
123
+ {
124
+ enforceForTSTypes: true,
125
+ },
126
+ ],
127
+ "arrow-body-style": State.WARN,
128
+ "block-scoped-var": State.ON,
129
+ // camelcase: State.OFF,
130
+ // "capitalized-comments": State.OFF,
131
+ // "class-methods-use-this": State.OFF /* supports TypeScript */,
132
+ // complexity: State.OFF,
133
+ "consistent-return": State.ON /* @tsc: noImplicitReturns */,
134
+ "consistent-this": State.ON,
135
+ curly: [
136
+ State.WARN,
137
+ "multi",
138
+ ],
139
+ // "default-case": State.OFF /* @preference: don't care */,
140
+ "default-case-last": State.ON,
141
+ "default-param-last": State.ON /* supports TypeScript */,
142
+ "dot-notation": State.WARN /* TSLint */,
143
+ eqeqeq: State.ON,
144
+ // "func-name-matching": State.OFF,
145
+ // "func-names": State.OFF,
146
+ // "func-style": State.OFF /* supports TypeScript */,
147
+ // "grouped-accessor-pairs": State.OFF /* BUG: requires adjacency, not as described in documentation */,
148
+ // "guard-for-in": State.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 */,
149
+ // "id-denylist": State.OFF,
150
+ // "id-length": State.OFF,
151
+ // "id-match": State.OFF,
152
+ "init-declarations": State.WARN /* supports TypeScript */,
153
+ "logical-assignment-operators": [
154
+ State.WARN,
155
+ "always",
156
+ {
157
+ enforceForIfStatements: true,
158
+ },
159
+ ],
160
+ // "max-classes-per-file": State.OFF,
161
+ // "max-depth": State.OFF,
162
+ // "max-lines": State.OFF,
163
+ // "max-lines-per-function": State.OFF,
164
+ // "max-nested-callbacks": State.OFF,
165
+ // "max-params": State.OFF /* supports TypeScript */,
166
+ // "max-statements": State.OFF,
167
+ // "multiline-comment-style": State.OFF,
168
+ // "new-cap": State.OFF /* @CONFLICT: breaks Scriptable */,
169
+ "no-alert": State.ON,
170
+ "no-array-constructor": State.ON /* supports TypeScript */,
171
+ "no-bitwise": State.ON,
172
+ "no-caller": State.ON,
173
+ "no-case-declarations": State.ON,
174
+ // "no-console": State.OFF /* @CONFLICT: breaks Node.js console applications and Scriptable, and otherwise unnecessarily hampers browser test code */,
175
+ "no-continue": State.ON,
176
+ "no-delete-var": State.ON,
177
+ "no-div-regex": State.ON,
178
+ "no-else-return": State.ON,
179
+ "no-empty": State.ON,
180
+ "no-empty-function": [
181
+ State.WARN,
182
+ {
183
+ allow: [
184
+ "constructors",
185
+ "privateConstructors",
186
+ "protectedConstructors",
187
+ "decoratedFunctions",
188
+ "overrideMethods",
189
+ ],
190
+ },
191
+ ] /* supports TypeScript */,
192
+ "no-empty-static-block": State.WARN,
193
+ "no-eq-null": State.ON,
194
+ "no-eval": State.ON,
195
+ "no-extend-native": State.ON,
196
+ "no-extra-bind": State.ON,
197
+ "no-extra-boolean-cast": [
198
+ State.WARN,
199
+ {
200
+ enforceForLogicalOperands: true,
201
+ },
202
+ ],
203
+ "no-extra-label": State.WARN,
204
+ "no-global-assign": State.ON,
205
+ "no-implicit-coercion": State.ON,
206
+ // "no-implicit-globals": State.OFF /* @CONFLICT: breaks Scriptable? breaks Sveltekit? */,
207
+ "no-implied-eval": State.ON /* TSLint */,
208
+ // "no-inline-comments": State.OFF,
209
+ "no-invalid-this": [
210
+ State.ON,
211
+ {
212
+ capIsConstructor: false,
213
+ },
214
+ ] /* supports TypeScript BUT @tsc: strict, noImplicitThis */,
215
+ "no-iterator": State.ON,
216
+ "no-label-var": State.WARN,
217
+ "no-lone-blocks": State.ON,
218
+ // "no-lonely-if": State.OFF,
219
+ "no-loop-func": State.ON /* supports TypeScript */,
220
+ // "no-magic-numbers": State.OFF /* supports TypeScript BUT @CONFLICT: breaks TypeScript number literals, even with most liberal exceptions */,
221
+ "no-multi-assign": State.ON,
222
+ "no-multi-str": State.WARN,
223
+ // "no-negated-condition": State.OFF,
224
+ // "no-nested-ternary": State.OFF,
225
+ "no-new": State.ON,
226
+ "no-new-func": State.ON,
227
+ "no-new-wrappers": State.ON,
228
+ "no-nonoctal-decimal-escape": State.ON,
229
+ "no-object-constructor": State.ON,
230
+ "no-octal": State.ON,
231
+ "no-octal-escape": State.ON,
232
+ "no-param-reassign": State.ON,
233
+ "no-plusplus": [
234
+ State.ON,
235
+ {
236
+ allowForLoopAfterthoughts: true,
237
+ },
238
+ ],
239
+ "no-proto": State.ON,
240
+ // "no-redeclare": State.OFF /* @tsc: (let, const, -var) */,
241
+ // "no-regex-spaces": State.OFF,
242
+ // "no-restricted-exports": State.OFF,
243
+ // "no-restricted-globals": State.OFF /* supports TypeScript */,
244
+ // "no-restricted-imports": State.OFF /* TSLint */,
245
+ // "no-restricted-properties": State.OFF,
246
+ // "no-restricted-syntax": State.OFF,
247
+ // "no-return-assign": State.OFF,
248
+ "no-script-url": State.ON,
249
+ "no-sequences": State.ON,
250
+ // "no-shadow": State.OFF /* supports TypeScript */,
251
+ "no-shadow-restricted-names": State.ON,
252
+ // "no-ternary": State.OFF,
253
+ "no-throw-literal": State.WARN /* TSLint */,
254
+ "no-undef-init": State.ON,
255
+ // "no-undefined": State.OFF /* @CONFLICT: breaks Scriptable? breaks Sveltekit? */,
256
+ // "no-underscore-dangle": State.OFF,
257
+ "no-unneeded-ternary": State.WARN,
258
+ "no-unused-expressions": [
259
+ State.WARN,
260
+ {
261
+ allowShortCircuit: true,
262
+ allowTernary: true,
263
+ },
264
+ ] /* supports TypeScript */,
265
+ "no-unused-labels": State.WARN,
266
+ "no-useless-call": State.WARN,
267
+ "no-useless-catch": State.WARN,
268
+ "no-useless-computed-key": State.WARN,
269
+ "no-useless-concat": State.WARN,
270
+ "no-useless-constructor": State.WARN /* supports TypeScript */,
271
+ "no-useless-escape": [
272
+ State.WARN,
273
+ {
274
+ allowRegexCharacters: ["-"],
275
+ },
276
+ ],
277
+ "no-useless-rename": State.WARN,
278
+ "no-useless-return": State.WARN,
279
+ "no-var": State.WARN /* supports TypeScript */,
280
+ "no-void": [
281
+ State.ON,
282
+ {
283
+ allowAsStatement: true,
284
+ },
285
+ ],
286
+ // "no-warning-comments": State.OFF,
287
+ "no-with": State.ON,
288
+ "object-shorthand": State.WARN,
289
+ "one-var": [
290
+ State.WARN,
291
+ {
292
+ "var": "consecutive",
293
+ let: "consecutive",
294
+ "const": "consecutive",
295
+ using: "consecutive",
296
+ awaitUsing: "consecutive",
297
+ separateRequires: true,
298
+ },
299
+ ],
300
+ "operator-assignment": State.WARN,
301
+ "prefer-arrow-callback": State.WARN /* supports TypeScript */,
302
+ "prefer-const": [
303
+ State.WARN,
304
+ {
305
+ destructuring: "all",
306
+ },
307
+ ],
308
+ // "prefer-destructuring": State.OFF /* TSLint BUT @preference: too prescriptive */,
309
+ "prefer-exponentiation-operator": State.WARN,
310
+ // "prefer-named-capture-group": State.OFF,
311
+ "prefer-numeric-literals": State.WARN,
312
+ "prefer-object-has-own": State.WARN,
313
+ "prefer-object-spread": State.WARN,
314
+ "prefer-promise-reject-errors": State.WARN,
315
+ "prefer-regex-literals": [
316
+ State.WARN,
317
+ {
318
+ disallowRedundantWrapping: true,
319
+ },
320
+ ] /* TSLint */,
321
+ "prefer-rest-params": State.WARN,
322
+ "prefer-spread": State.WARN,
323
+ // "prefer-template": State.OFF /* @CONFLICT: performance */,
324
+ "preserve-caught-error": [
325
+ State.ON,
326
+ {
327
+ requireCatchParameter: true,
328
+ },
329
+ ],
330
+ radix: State.ON,
331
+ "require-await": State.ON /* TSLint */,
332
+ "require-unicode-regexp": State.ON,
333
+ "require-yield": State.ON,
334
+ // "sort-imports": State.OFF,
335
+ // "sort-keys": State.OFF,
336
+ // "sort-vars": State.OFF,
337
+ // strict: State.OFF,
338
+ // "symbol-description": State.OFF,
339
+ "vars-on-top": State.WARN,
340
+ yoda: State.WARN,
341
+ // #endregion
342
+
343
+ // #region FORMATTING
344
+ // [ https://eslint.org/docs/latest/rules/#layout--formatting ]
345
+ "unicode-bom": State.WARN,
346
+ // #endregion
347
+
348
+ // #region STYLISTIC
349
+ // DOC: https://eslint.style/rules
350
+
351
+ "stylistic/eol-last": State.WARN,
352
+ "stylistic/linebreak-style": State.WARN,
353
+ "stylistic/array-bracket-newline": State.WARN,
354
+ "stylistic/array-bracket-spacing": State.WARN,
355
+ "stylistic/array-element-newline": [
356
+ State.WARN,
357
+ {
358
+ consistent: true,
359
+ multiline: true,
360
+ minItems: 3,
361
+ },
362
+ ],
363
+ "stylistic/arrow-parens": [
364
+ State.WARN,
365
+ "as-needed",
366
+ ],
367
+ "stylistic/arrow-spacing": State.WARN,
368
+ "stylistic/block-spacing": State.WARN,
369
+ "stylistic/brace-style": [
370
+ State.WARN,
371
+ "stroustrup",
372
+ {
373
+ allowSingleLine: true,
374
+ },
375
+ ],
376
+ "stylistic/comma-dangle": [
377
+ State.WARN,
378
+ "always-multiline",
379
+ ],
380
+ "stylistic/comma-spacing": State.WARN,
381
+ "stylistic/comma-style": State.WARN,
382
+ "stylistic/computed-property-spacing": State.WARN,
383
+ "stylistic/curly-newline": State.WARN,
384
+ "stylistic/dot-location": [
385
+ State.WARN,
386
+ "property",
387
+ ],
388
+ // "stylistic/eol-last": State.OFF /* @global */,
389
+ "stylistic/function-call-argument-newline": [
390
+ State.WARN,
391
+ "consistent",
392
+ ],
393
+ "stylistic/function-call-spacing": State.WARN,
394
+ "stylistic/function-paren-newline": [
395
+ State.WARN,
396
+ "multiline-arguments",
397
+ ] /* BUG: https://github.com/eslint-stylistic/eslint-stylistic/issues/290 */,
398
+ "stylistic/generator-star-spacing": State.WARN,
399
+ "stylistic/implicit-arrow-linebreak": State.WARN,
400
+ "stylistic/indent": [
401
+ State.WARN,
402
+ 2,
403
+ {
404
+ assignmentOperator: 0,
405
+ VariableDeclarator: {
406
+ "var": 0,
407
+ let: 0,
408
+ "const": 0,
409
+ },
410
+ outerIIFEBody: 0,
411
+ offsetTernaryExpressions: true,
412
+ },
413
+ ],
414
+ "stylistic/indent-binary-ops": [
415
+ State.WARN,
416
+ 2 /* MUST be same as `stylistic/indent`[1] */,
417
+ ],
418
+ "stylistic/key-spacing": State.WARN,
419
+ "stylistic/keyword-spacing": State.WARN,
420
+ // "stylistic/line-comment-position": State.OFF,
421
+ // "stylistic/linebreak-style": State.OFF /* @global */,
422
+ // "stylistic/lines-around-comment": State.OFF,
423
+ "stylistic/lines-between-class-members": [
424
+ State.WARN,
425
+ {
426
+ enforce: [
427
+ {
428
+ prev: "field",
429
+ next: "field",
430
+ blankLine: "never",
431
+ },
432
+ {
433
+ prev: "field",
434
+ next: "method",
435
+ blankLine: "always",
436
+ },
437
+ {
438
+ prev: "method",
439
+ next: "*",
440
+ blankLine: "always",
441
+ },
442
+ ],
443
+ },
444
+ ],
445
+ "stylistic/max-len": [
446
+ State.WARN,
447
+ {
448
+ code: 300,
449
+ ignoreComments: true,
450
+ ignoreTrailingComments: true,
451
+ ignoreUrls: true,
452
+ ignoreStrings: true,
453
+ ignoreTemplateLiterals: true,
454
+ ignoreRegExpLiterals: true,
455
+ },
456
+ ],
457
+ "stylistic/max-statements-per-line": State.WARN,
458
+ "stylistic/member-delimiter-style": State.WARN,
459
+ // "stylistic/multiline-comment-style": State.OFF,
460
+ "stylistic/multiline-ternary": [
461
+ State.WARN,
462
+ "always-multiline",
463
+ ],
464
+ // "stylistic/new-parens": State.OFF,
465
+ "stylistic/newline-per-chained-call": [
466
+ State.WARN,
467
+ {
468
+ ignoreChainWithDepth: 1,
469
+ },
470
+ ],
471
+ // "stylistic/no-confusing-arrow": State.OFF,
472
+ "stylistic/no-extra-parens": State.WARN,
473
+ "stylistic/no-extra-semi": State.WARN,
474
+ "stylistic/no-floating-decimal": State.WARN,
475
+ // "stylistic/no-mixed-operators": State.OFF,
476
+ "stylistic/no-mixed-spaces-and-tabs": State.WARN,
477
+ "stylistic/no-multi-spaces": [
478
+ State.WARN,
479
+ {
480
+ exceptions: {
481
+ Property: false,
482
+ ImportAttributes: false,
483
+ },
484
+ },
485
+ ],
486
+ "stylistic/no-multiple-empty-lines": [
487
+ State.WARN,
488
+ {
489
+ max: 1,
490
+ maxBOF: 0,
491
+ maxEOF: 0 /* INFO: combine with `eol-last` to ensure file still ends with a single line-break (eol character) */,
492
+ },
493
+ ],
494
+ "stylistic/no-tabs": State.WARN,
495
+ "stylistic/no-trailing-spaces": State.WARN,
496
+ "stylistic/no-whitespace-before-property": State.WARN,
497
+ "stylistic/nonblock-statement-body-position": [
498
+ State.WARN,
499
+ "below",
500
+ ],
501
+ "stylistic/object-curly-newline": [
502
+ State.WARN,
503
+ {
504
+ consistent: true,
505
+ multiline: true,
506
+ minProperties: 3,
507
+ },
508
+ ],
509
+ "stylistic/object-curly-spacing": [
510
+ State.WARN,
511
+ "always",
512
+ {
513
+ emptyObjects: "never",
514
+ },
515
+ ],
516
+ "stylistic/object-property-newline": State.WARN,
517
+ "stylistic/one-var-declaration-per-line": [
518
+ State.WARN,
519
+ "always",
520
+ ],
521
+ "stylistic/operator-linebreak": [
522
+ State.WARN,
523
+ "before",
524
+ ],
525
+ "stylistic/padded-blocks": [
526
+ State.WARN,
527
+ "never",
528
+ {
529
+ allowSingleLineBlocks: true,
530
+ },
531
+ ],
532
+ // "stylistic/padding-line-between-statements": State.OFF /* BUG: when in editor, always removes too many lines and ends up crushing two lines into one statement, which then cannot be autofixed */,
533
+ "stylistic/quote-props": [
534
+ State.WARN,
535
+ "as-needed",
536
+ {
537
+ keywords: true,
538
+ },
539
+ ],
540
+ "stylistic/quotes": [
541
+ State.WARN,
542
+ "double",
543
+ {
544
+ avoidEscape: true,
545
+ allowTemplateLiterals: "always",
546
+ },
547
+ ],
548
+ "stylistic/rest-spread-spacing": State.WARN,
549
+ "stylistic/semi": State.WARN,
550
+ "stylistic/semi-spacing": State.WARN,
551
+ "stylistic/semi-style": State.WARN,
552
+ "stylistic/space-before-blocks": State.WARN,
553
+ "stylistic/space-before-function-paren": [
554
+ State.WARN,
555
+ {
556
+ named: "never",
557
+ },
558
+ ],
559
+ "stylistic/space-in-parens": State.WARN,
560
+ "stylistic/space-infix-ops": State.WARN,
561
+ "stylistic/space-unary-ops": State.WARN,
562
+ "stylistic/spaced-comment": [
563
+ State.WARN,
564
+ "always",
565
+ {
566
+ line: {
567
+ exceptions: [
568
+ "/",
569
+ "-",
570
+ "+",
571
+ "=",
572
+ ],
573
+ markers: [
574
+ "!",
575
+ "@",
576
+ "#",
577
+ "/",
578
+ "#region",
579
+ "#endregion",
580
+ "#part",
581
+ "/#region",
582
+ "/#endregion",
583
+ "/#part",
584
+ ],
585
+ },
586
+ block: {
587
+ exceptions: ["*"],
588
+ markers: ["*"],
589
+ balanced: true,
590
+ },
591
+ },
592
+ ],
593
+ "stylistic/switch-colon-spacing": State.WARN,
594
+ "stylistic/template-curly-spacing": State.WARN,
595
+ "stylistic/template-tag-spacing": State.WARN,
596
+ "stylistic/type-annotation-spacing": [
597
+ State.WARN,
598
+ {
599
+ before: true,
600
+ after: true,
601
+ overrides: {
602
+ colon: {
603
+ before: false,
604
+ after: true,
605
+ },
606
+ },
607
+ } /* BUG: non-overriden rule affects all type annotations (arrows, "as" keyword, "satisfies" keyword) except colons */,
608
+ ],
609
+ "stylistic/type-generic-spacing": State.WARN,
610
+ "stylistic/type-named-tuple-spacing": State.WARN,
611
+ "stylistic/wrap-iife": [
612
+ State.WARN,
613
+ "inside",
614
+ {
615
+ functionPrototypeMethods: true,
616
+ },
617
+ ],
618
+ "stylistic/wrap-regex": State.WARN,
619
+ "stylistic/yield-star-spacing": State.WARN,
620
+ //#endregion
621
+ } as const,
622
+ };
@@ -1,8 +1,14 @@
1
- import { State } from "../state";
1
+ import { State } from "./_state";
2
2
 
3
3
  // DOC: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/
4
4
  export default {
5
5
  rules: {
6
+ // "json/no-duplicate-keys": State.OFF /* jsonc/no-dupe-keys */,
7
+ // "json/no-empty-keys": State.OFF,
8
+ "json/no-unsafe-values": State.ON,
9
+ "json/no-unnormalized-keys": State.ON,
10
+ // "json/sort-keys": State.OFF /* jsonc/sort-keys */,
11
+ // "json/top-level-interop": State.OFF /* rarely useful */,
6
12
  // "jsonc/auto": State.OFF,
7
13
  // "jsonc/key-name-casing": State.OFF,
8
14
  // "jsonc/no-bigint-literals": State.OFF,
@@ -0,0 +1,11 @@
1
+ import { State } from "./_state";
2
+
3
+ export default {
4
+ rules: {
5
+ "jsonc/comma-dangle": [
6
+ State.WARN,
7
+ "always-multiline",
8
+ ],
9
+ "jsonc/no-comments": State.OFF,
10
+ } as const,
11
+ };