@comment-labs/oxlint-config 1.0.0-beta.9 → 1.0.2
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/README.md +11 -0
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +374 -225
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/i18next.d.mts +13 -2
- package/dist/plugins/i18next.mjs +899 -2
- package/dist/plugins/i18next.mjs.map +1 -0
- package/dist/plugins/labs.d.mts +1 -1
- package/dist/plugins/labs.mjs +42 -35
- package/dist/plugins/labs.mjs.map +1 -1
- package/package.json +21 -20
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "oxlint";
|
|
2
1
|
import globalsPkg from "globals";
|
|
3
2
|
import { access, readFile } from "node:fs/promises";
|
|
4
3
|
import { join } from "node:path";
|
|
@@ -76,6 +75,7 @@ const baseRules = {
|
|
|
76
75
|
"no-unassigned-import": "off",
|
|
77
76
|
"no-use-before-define": ["warn", { functions: false }],
|
|
78
77
|
"no-warning-comments": "off",
|
|
78
|
+
"one-var": "off",
|
|
79
79
|
"prefer-default-export": "off",
|
|
80
80
|
"prefer-destructuring": "off",
|
|
81
81
|
"require-await": "off",
|
|
@@ -91,16 +91,30 @@ const baseRules = {
|
|
|
91
91
|
"typescript/require-await": "warn",
|
|
92
92
|
"typescript/non-nullable-type-assertion-style": "warn",
|
|
93
93
|
"typescript/explicit-member-accessibility": "off",
|
|
94
|
+
"typescript/method-signature-style": "off",
|
|
94
95
|
"typescript/return-await": ["warn", "always"],
|
|
96
|
+
"typescript/no-confusing-void-expression": ["warn", { ignoreArrowShorthand: true }],
|
|
95
97
|
"import/no-unassigned-import": "warn",
|
|
96
98
|
"import/consistent-type-specifier-style": "off",
|
|
97
99
|
"import/no-anonymous-default-export": "off",
|
|
98
100
|
"import/no-cycle": "off",
|
|
99
101
|
"import/no-nodejs-modules": "off",
|
|
100
102
|
"import/unambiguous": "off",
|
|
103
|
+
"node/no-top-level-await": "off",
|
|
104
|
+
"node/no-sync": "off",
|
|
105
|
+
"react/react-in-jsx-scope": "off",
|
|
106
|
+
"react/jsx-filename-extension": ["error", { extensions: ["jsx", "tsx"] }],
|
|
101
107
|
"jest/require-hook": "off",
|
|
102
108
|
"jest/no-conditional-in-test": "off",
|
|
109
|
+
"jest/prefer-expect-assertions": "off",
|
|
110
|
+
"vitest/prefer-called-times": "off",
|
|
111
|
+
"vitest/prefer-expect-assertions": "off",
|
|
103
112
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
113
|
+
"vitest/require-hook": "off",
|
|
114
|
+
"vitest/require-test-timeout": "off",
|
|
115
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
116
|
+
"vitest/no-conditional-in-test": "off",
|
|
117
|
+
"vitest/no-hooks": "off",
|
|
104
118
|
"jsdoc/require-param-type": "off",
|
|
105
119
|
"jsdoc/require-returns": "off",
|
|
106
120
|
"jsdoc/require-param": "off",
|
|
@@ -108,7 +122,21 @@ const baseRules = {
|
|
|
108
122
|
"unicorn/switch-case-braces": ["warn", "avoid"],
|
|
109
123
|
"unicorn/no-array-method-this-argument": "warn",
|
|
110
124
|
"unicorn/no-await-expression-member": "warn",
|
|
111
|
-
"
|
|
125
|
+
"unicorn/no-invalid-fetch-options": "off",
|
|
126
|
+
"unicorn/import-style": ["warn", {
|
|
127
|
+
extendDefaultStyles: false,
|
|
128
|
+
styles: {
|
|
129
|
+
"path": {
|
|
130
|
+
named: true,
|
|
131
|
+
default: false
|
|
132
|
+
},
|
|
133
|
+
"util": {
|
|
134
|
+
named: true,
|
|
135
|
+
default: false
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}],
|
|
139
|
+
"unicorn/max-nested-calls": ["warn", { max: 5 }],
|
|
112
140
|
"comment-labs-js/no-self-assign": "error",
|
|
113
141
|
"brettz9-js/arrow-parens": "off",
|
|
114
142
|
"brettz9-js/block-scoped-var": "off",
|
|
@@ -118,7 +146,6 @@ const baseRules = {
|
|
|
118
146
|
"brettz9-js/no-use-ignored-vars": "warn",
|
|
119
147
|
"brettz9-js/no-useless-rest-spread": "warn",
|
|
120
148
|
"brettz9-js/prefer-for-of": "off",
|
|
121
|
-
"i18next-js/no-literal-string": "warn",
|
|
122
149
|
"import-zod-js/prefer-zod-namespace": "warn",
|
|
123
150
|
"security-js/detect-unsafe-regex": "error",
|
|
124
151
|
"security-js/detect-non-literal-regexp": "error",
|
|
@@ -134,16 +161,172 @@ const baseRules = {
|
|
|
134
161
|
"security-js/detect-object-injection": "off",
|
|
135
162
|
"security-js/detect-new-buffer": "error",
|
|
136
163
|
"security-js/detect-bidi-characters": "error",
|
|
137
|
-
"unicorn-js/
|
|
164
|
+
"unicorn-js/class-reference-in-static-methods": "warn",
|
|
165
|
+
"unicorn-js/consistent-conditional-object-spread": "warn",
|
|
138
166
|
"unicorn-js/consistent-destructuring": "warn",
|
|
167
|
+
"unicorn-js/consistent-json-file-read": "warn",
|
|
139
168
|
"unicorn-js/consistent-template-literal-escape": "warn",
|
|
169
|
+
"unicorn-js/consistent-tuple-labels": "warn",
|
|
170
|
+
"unicorn-js/default-export-style": "warn",
|
|
171
|
+
"unicorn-js/no-array-concat-in-loop": "warn",
|
|
172
|
+
"unicorn-js/no-array-splice": "warn",
|
|
173
|
+
"unicorn-js/no-computed-property-existence-check": "warn",
|
|
174
|
+
"unicorn-js/no-confusing-array-splice": "warn",
|
|
175
|
+
"unicorn-js/no-duplicate-if-branches": "warn",
|
|
176
|
+
"unicorn-js/no-duplicate-loops": "warn",
|
|
177
|
+
"unicorn-js/no-duplicate-set-values": "warn",
|
|
140
178
|
"unicorn-js/no-for-loop": "warn",
|
|
179
|
+
"unicorn-js/no-incorrect-query-selector": "warn",
|
|
180
|
+
"unicorn-js/no-incorrect-template-string-interpolation": "warn",
|
|
181
|
+
"unicorn-js/no-late-current-target-access": "warn",
|
|
182
|
+
"unicorn-js/no-late-event-control": "warn",
|
|
183
|
+
"unicorn-js/no-loop-iterable-mutation": "warn",
|
|
184
|
+
"unicorn-js/no-mismatched-map-key": "warn",
|
|
185
|
+
"unicorn-js/no-non-function-verb-prefix": "warn",
|
|
186
|
+
"unicorn-js/no-object-methods-with-collections": "warn",
|
|
187
|
+
"unicorn-js/no-optional-chaining-on-undeclared-variable": "warn",
|
|
188
|
+
"unicorn-js/no-return-array-push": "warn",
|
|
189
|
+
"unicorn-js/no-selector-as-dom-name": "warn",
|
|
190
|
+
"unicorn-js/no-this-outside-of-class": "warn",
|
|
191
|
+
"unicorn-js/no-top-level-assignment-in-function": "warn",
|
|
192
|
+
"unicorn-js/no-uncalled-method": "warn",
|
|
193
|
+
"unicorn-js/no-undeclared-class-members": "warn",
|
|
194
|
+
"unicorn-js/no-unnecessary-array-flat-map": "warn",
|
|
195
|
+
"unicorn-js/no-unnecessary-boolean-comparison": "warn",
|
|
196
|
+
"unicorn-js/no-unnecessary-splice": "warn",
|
|
197
|
+
"unicorn-js/no-unsafe-property-key": "warn",
|
|
198
|
+
"unicorn-js/no-useless-else": "warn",
|
|
141
199
|
"unicorn-js/no-useless-iterator-to-array": "warn",
|
|
200
|
+
"unicorn-js/prefer-abort-signal-any": "warn",
|
|
201
|
+
"unicorn-js/prefer-abort-signal-timeout": "warn",
|
|
202
|
+
"unicorn-js/prefer-array-from-async": "warn",
|
|
203
|
+
"unicorn-js/prefer-array-iterable-methods": "warn",
|
|
204
|
+
"unicorn-js/prefer-array-slice": "warn",
|
|
205
|
+
"unicorn-js/prefer-continue": "warn",
|
|
206
|
+
"unicorn-js/prefer-dom-node-html-methods": "warn",
|
|
207
|
+
"unicorn-js/prefer-else-if": "warn",
|
|
142
208
|
"unicorn-js/prefer-export-from": "warn",
|
|
209
|
+
"unicorn-js/prefer-get-or-insert-computed": "warn",
|
|
210
|
+
"unicorn-js/prefer-group-by": "warn",
|
|
211
|
+
"unicorn-js/prefer-hoisting-branch-code": "warn",
|
|
212
|
+
"unicorn-js/prefer-includes-over-repeated-comparisons": "warn",
|
|
213
|
+
"unicorn-js/prefer-iterator-to-array": "warn",
|
|
214
|
+
"unicorn-js/prefer-location-assign": "warn",
|
|
215
|
+
"unicorn-js/prefer-number-is-safe-integer": "warn",
|
|
216
|
+
"unicorn-js/prefer-object-destructuring-defaults": "warn",
|
|
217
|
+
"unicorn-js/prefer-observer-apis": "warn",
|
|
218
|
+
"unicorn-js/prefer-private-class-fields": "warn",
|
|
219
|
+
"unicorn-js/prefer-promise-try": "warn",
|
|
220
|
+
"unicorn-js/prefer-scoped-selector": "warn",
|
|
221
|
+
"unicorn-js/prefer-set-methods": "warn",
|
|
143
222
|
"unicorn-js/prefer-simple-condition-first": "warn",
|
|
223
|
+
"unicorn-js/prefer-single-call": "warn",
|
|
224
|
+
"unicorn-js/prefer-single-object-destructuring": "warn",
|
|
225
|
+
"unicorn-js/prefer-smaller-scope": "warn",
|
|
144
226
|
"unicorn-js/prefer-switch": "warn",
|
|
227
|
+
"unicorn-js/prefer-then-catch": "warn",
|
|
228
|
+
"unicorn-js/prefer-type-literal-last": "warn",
|
|
145
229
|
"unicorn-js/switch-case-break-position": "warn",
|
|
146
|
-
"
|
|
230
|
+
"jsdoc-js/check-alignment": "warn",
|
|
231
|
+
"jsdoc-js/check-indentation": "warn",
|
|
232
|
+
"jsdoc-js/check-line-alignment": "warn",
|
|
233
|
+
"jsdoc-js/check-param-names": "warn",
|
|
234
|
+
"jsdoc-js/check-types": "warn",
|
|
235
|
+
"jsdoc-js/check-values": "warn",
|
|
236
|
+
"jsdoc-js/multiline-blocks": "warn",
|
|
237
|
+
"jsdoc-js/no-multi-asterisks": "warn",
|
|
238
|
+
"jsdoc-js/no-undefined-types": "warn",
|
|
239
|
+
"jsdoc-js/require-returns-check": "warn",
|
|
240
|
+
"jsdoc-js/require-yields-check": "warn",
|
|
241
|
+
"jsdoc-js/tag-lines": "warn",
|
|
242
|
+
"jsdoc-js/valid-types": "warn",
|
|
243
|
+
"e18e-js/prefer-array-at": "error",
|
|
244
|
+
"e18e-js/prefer-array-fill": "error",
|
|
245
|
+
"e18e-js/prefer-includes": "error",
|
|
246
|
+
"e18e-js/prefer-array-to-reversed": "error",
|
|
247
|
+
"e18e-js/prefer-array-to-sorted": "error",
|
|
248
|
+
"e18e-js/prefer-array-to-spliced": "error",
|
|
249
|
+
"e18e-js/prefer-nullish-coalescing": "error",
|
|
250
|
+
"e18e-js/prefer-object-has-own": "error",
|
|
251
|
+
"e18e-js/prefer-spread-syntax": "error",
|
|
252
|
+
"e18e-js/prefer-url-canparse": "error",
|
|
253
|
+
"e18e-js/ban-dependencies": "error",
|
|
254
|
+
"e18e-js/prefer-array-from-map": "error",
|
|
255
|
+
"e18e-js/prefer-timer-args": "error",
|
|
256
|
+
"e18e-js/prefer-date-now": "error",
|
|
257
|
+
"e18e-js/prefer-regex-test": "error",
|
|
258
|
+
"e18e-js/prefer-array-some": "error",
|
|
259
|
+
"e18e-js/prefer-static-regex": "error",
|
|
260
|
+
"no-control-regex": "error",
|
|
261
|
+
"no-misleading-character-class": "error",
|
|
262
|
+
"no-regex-spaces": "error",
|
|
263
|
+
"no-invalid-regexp": "off",
|
|
264
|
+
"no-useless-backreference": "off",
|
|
265
|
+
"no-empty-character-class": "off",
|
|
266
|
+
"regexp-js/confusing-quantifier": "warn",
|
|
267
|
+
"regexp-js/control-character-escape": "error",
|
|
268
|
+
"regexp-js/match-any": "error",
|
|
269
|
+
"regexp-js/negation": "error",
|
|
270
|
+
"regexp-js/no-contradiction-with-assertion": "error",
|
|
271
|
+
"regexp-js/no-dupe-characters-character-class": "error",
|
|
272
|
+
"regexp-js/no-dupe-disjunctions": "error",
|
|
273
|
+
"regexp-js/no-empty-alternative": "warn",
|
|
274
|
+
"regexp-js/no-empty-capturing-group": "error",
|
|
275
|
+
"regexp-js/no-empty-character-class": "error",
|
|
276
|
+
"regexp-js/no-empty-group": "error",
|
|
277
|
+
"regexp-js/no-empty-lookarounds-assertion": "error",
|
|
278
|
+
"regexp-js/no-empty-string-literal": "error",
|
|
279
|
+
"regexp-js/no-escape-backspace": "error",
|
|
280
|
+
"regexp-js/no-extra-lookaround-assertions": "error",
|
|
281
|
+
"regexp-js/no-invalid-regexp": "error",
|
|
282
|
+
"regexp-js/no-invisible-character": "error",
|
|
283
|
+
"regexp-js/no-lazy-ends": "warn",
|
|
284
|
+
"regexp-js/no-legacy-features": "error",
|
|
285
|
+
"regexp-js/no-misleading-capturing-group": "error",
|
|
286
|
+
"regexp-js/no-misleading-unicode-character": "error",
|
|
287
|
+
"regexp-js/no-missing-g-flag": "error",
|
|
288
|
+
"regexp-js/no-non-standard-flag": "error",
|
|
289
|
+
"regexp-js/no-obscure-range": "error",
|
|
290
|
+
"regexp-js/no-optional-assertion": "error",
|
|
291
|
+
"regexp-js/no-potentially-useless-backreference": "warn",
|
|
292
|
+
"regexp-js/no-super-linear-backtracking": "error",
|
|
293
|
+
"regexp-js/no-trivially-nested-assertion": "error",
|
|
294
|
+
"regexp-js/no-trivially-nested-quantifier": "error",
|
|
295
|
+
"regexp-js/no-unused-capturing-group": "error",
|
|
296
|
+
"regexp-js/no-useless-assertions": "error",
|
|
297
|
+
"regexp-js/no-useless-backreference": "error",
|
|
298
|
+
"regexp-js/no-useless-character-class": "error",
|
|
299
|
+
"regexp-js/no-useless-dollar-replacements": "error",
|
|
300
|
+
"regexp-js/no-useless-escape": "error",
|
|
301
|
+
"regexp-js/no-useless-flag": "warn",
|
|
302
|
+
"regexp-js/no-useless-lazy": "error",
|
|
303
|
+
"regexp-js/no-useless-non-capturing-group": "error",
|
|
304
|
+
"regexp-js/no-useless-quantifier": "error",
|
|
305
|
+
"regexp-js/no-useless-range": "error",
|
|
306
|
+
"regexp-js/no-useless-set-operand": "error",
|
|
307
|
+
"regexp-js/no-useless-string-literal": "error",
|
|
308
|
+
"regexp-js/no-useless-two-nums-quantifier": "error",
|
|
309
|
+
"regexp-js/no-zero-quantifier": "error",
|
|
310
|
+
"regexp-js/optimal-lookaround-quantifier": "warn",
|
|
311
|
+
"regexp-js/optimal-quantifier-concatenation": "error",
|
|
312
|
+
"regexp-js/prefer-character-class": "error",
|
|
313
|
+
"regexp-js/prefer-d": "error",
|
|
314
|
+
"regexp-js/prefer-plus-quantifier": "error",
|
|
315
|
+
"regexp-js/prefer-predefined-assertion": "error",
|
|
316
|
+
"regexp-js/prefer-question-quantifier": "error",
|
|
317
|
+
"regexp-js/prefer-range": "error",
|
|
318
|
+
"regexp-js/prefer-set-operation": "error",
|
|
319
|
+
"regexp-js/prefer-star-quantifier": "error",
|
|
320
|
+
"regexp-js/prefer-unicode-codepoint-escapes": "error",
|
|
321
|
+
"regexp-js/prefer-w": "error",
|
|
322
|
+
"regexp-js/simplify-set-operations": "error",
|
|
323
|
+
"regexp-js/sort-flags": "error",
|
|
324
|
+
"regexp-js/strict": "error",
|
|
325
|
+
"regexp-js/use-ignore-case": "error"
|
|
326
|
+
};
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/stylistic-rules.ts
|
|
329
|
+
const stylisticRules = {
|
|
147
330
|
"stylistic-js/type-generic-spacing": "warn",
|
|
148
331
|
"stylistic-js/type-named-tuple-spacing": "warn",
|
|
149
332
|
"stylistic-js/function-call-spacing": ["warn", "never"],
|
|
@@ -388,103 +571,7 @@ const baseRules = {
|
|
|
388
571
|
prev: "multiline-block-like",
|
|
389
572
|
next: "*"
|
|
390
573
|
}
|
|
391
|
-
]
|
|
392
|
-
"jsdoc-js/check-alignment": "warn",
|
|
393
|
-
"jsdoc-js/check-indentation": "warn",
|
|
394
|
-
"jsdoc-js/check-line-alignment": "warn",
|
|
395
|
-
"jsdoc-js/check-param-names": "warn",
|
|
396
|
-
"jsdoc-js/check-types": "warn",
|
|
397
|
-
"jsdoc-js/check-values": "warn",
|
|
398
|
-
"jsdoc-js/multiline-blocks": "warn",
|
|
399
|
-
"jsdoc-js/no-multi-asterisks": "warn",
|
|
400
|
-
"jsdoc-js/no-undefined-types": "warn",
|
|
401
|
-
"jsdoc-js/require-returns-check": "warn",
|
|
402
|
-
"jsdoc-js/require-yields-check": "warn",
|
|
403
|
-
"jsdoc-js/tag-lines": "warn",
|
|
404
|
-
"jsdoc-js/valid-types": "warn",
|
|
405
|
-
"e18e-js/prefer-array-at": "error",
|
|
406
|
-
"e18e-js/prefer-array-fill": "error",
|
|
407
|
-
"e18e-js/prefer-includes": "error",
|
|
408
|
-
"e18e-js/prefer-array-to-reversed": "error",
|
|
409
|
-
"e18e-js/prefer-array-to-sorted": "error",
|
|
410
|
-
"e18e-js/prefer-array-to-spliced": "error",
|
|
411
|
-
"e18e-js/prefer-nullish-coalescing": "error",
|
|
412
|
-
"e18e-js/prefer-object-has-own": "error",
|
|
413
|
-
"e18e-js/prefer-spread-syntax": "error",
|
|
414
|
-
"e18e-js/prefer-url-canparse": "error",
|
|
415
|
-
"e18e-js/ban-dependencies": "error",
|
|
416
|
-
"e18e-js/prefer-array-from-map": "error",
|
|
417
|
-
"e18e-js/prefer-timer-args": "error",
|
|
418
|
-
"e18e-js/prefer-date-now": "error",
|
|
419
|
-
"e18e-js/prefer-regex-test": "error",
|
|
420
|
-
"e18e-js/prefer-array-some": "error",
|
|
421
|
-
"e18e-js/prefer-static-regex": "error",
|
|
422
|
-
"no-control-regex": "error",
|
|
423
|
-
"no-misleading-character-class": "error",
|
|
424
|
-
"no-regex-spaces": "error",
|
|
425
|
-
"no-invalid-regexp": "off",
|
|
426
|
-
"no-useless-backreference": "off",
|
|
427
|
-
"no-empty-character-class": "off",
|
|
428
|
-
"regexp-js/confusing-quantifier": "warn",
|
|
429
|
-
"regexp-js/control-character-escape": "error",
|
|
430
|
-
"regexp-js/match-any": "error",
|
|
431
|
-
"regexp-js/negation": "error",
|
|
432
|
-
"regexp-js/no-contradiction-with-assertion": "error",
|
|
433
|
-
"regexp-js/no-dupe-characters-character-class": "error",
|
|
434
|
-
"regexp-js/no-dupe-disjunctions": "error",
|
|
435
|
-
"regexp-js/no-empty-alternative": "warn",
|
|
436
|
-
"regexp-js/no-empty-capturing-group": "error",
|
|
437
|
-
"regexp-js/no-empty-character-class": "error",
|
|
438
|
-
"regexp-js/no-empty-group": "error",
|
|
439
|
-
"regexp-js/no-empty-lookarounds-assertion": "error",
|
|
440
|
-
"regexp-js/no-empty-string-literal": "error",
|
|
441
|
-
"regexp-js/no-escape-backspace": "error",
|
|
442
|
-
"regexp-js/no-extra-lookaround-assertions": "error",
|
|
443
|
-
"regexp-js/no-invalid-regexp": "error",
|
|
444
|
-
"regexp-js/no-invisible-character": "error",
|
|
445
|
-
"regexp-js/no-lazy-ends": "warn",
|
|
446
|
-
"regexp-js/no-legacy-features": "error",
|
|
447
|
-
"regexp-js/no-misleading-capturing-group": "error",
|
|
448
|
-
"regexp-js/no-misleading-unicode-character": "error",
|
|
449
|
-
"regexp-js/no-missing-g-flag": "error",
|
|
450
|
-
"regexp-js/no-non-standard-flag": "error",
|
|
451
|
-
"regexp-js/no-obscure-range": "error",
|
|
452
|
-
"regexp-js/no-optional-assertion": "error",
|
|
453
|
-
"regexp-js/no-potentially-useless-backreference": "warn",
|
|
454
|
-
"regexp-js/no-super-linear-backtracking": "error",
|
|
455
|
-
"regexp-js/no-trivially-nested-assertion": "error",
|
|
456
|
-
"regexp-js/no-trivially-nested-quantifier": "error",
|
|
457
|
-
"regexp-js/no-unused-capturing-group": "error",
|
|
458
|
-
"regexp-js/no-useless-assertions": "error",
|
|
459
|
-
"regexp-js/no-useless-backreference": "error",
|
|
460
|
-
"regexp-js/no-useless-character-class": "error",
|
|
461
|
-
"regexp-js/no-useless-dollar-replacements": "error",
|
|
462
|
-
"regexp-js/no-useless-escape": "error",
|
|
463
|
-
"regexp-js/no-useless-flag": "warn",
|
|
464
|
-
"regexp-js/no-useless-lazy": "error",
|
|
465
|
-
"regexp-js/no-useless-non-capturing-group": "error",
|
|
466
|
-
"regexp-js/no-useless-quantifier": "error",
|
|
467
|
-
"regexp-js/no-useless-range": "error",
|
|
468
|
-
"regexp-js/no-useless-set-operand": "error",
|
|
469
|
-
"regexp-js/no-useless-string-literal": "error",
|
|
470
|
-
"regexp-js/no-useless-two-nums-quantifier": "error",
|
|
471
|
-
"regexp-js/no-zero-quantifier": "error",
|
|
472
|
-
"regexp-js/optimal-lookaround-quantifier": "warn",
|
|
473
|
-
"regexp-js/optimal-quantifier-concatenation": "error",
|
|
474
|
-
"regexp-js/prefer-character-class": "error",
|
|
475
|
-
"regexp-js/prefer-d": "error",
|
|
476
|
-
"regexp-js/prefer-plus-quantifier": "error",
|
|
477
|
-
"regexp-js/prefer-predefined-assertion": "error",
|
|
478
|
-
"regexp-js/prefer-question-quantifier": "error",
|
|
479
|
-
"regexp-js/prefer-range": "error",
|
|
480
|
-
"regexp-js/prefer-set-operation": "error",
|
|
481
|
-
"regexp-js/prefer-star-quantifier": "error",
|
|
482
|
-
"regexp-js/prefer-unicode-codepoint-escapes": "error",
|
|
483
|
-
"regexp-js/prefer-w": "error",
|
|
484
|
-
"regexp-js/simplify-set-operations": "error",
|
|
485
|
-
"regexp-js/sort-flags": "error",
|
|
486
|
-
"regexp-js/strict": "error",
|
|
487
|
-
"regexp-js/use-ignore-case": "error"
|
|
574
|
+
]
|
|
488
575
|
};
|
|
489
576
|
//#endregion
|
|
490
577
|
//#region src/plugins.ts
|
|
@@ -506,7 +593,7 @@ const plugins = [
|
|
|
506
593
|
//#endregion
|
|
507
594
|
//#region src/utils.ts
|
|
508
595
|
async function enableMode(configFiles, dependencies) {
|
|
509
|
-
if ((await Promise.all(configFiles.map(async (file) => access(join(cwd(), file)).then(() => true).catch(() => false)))).some(Boolean)) return true;
|
|
596
|
+
if ((await Promise.all(configFiles.map(async (file) => await access(join(cwd(), file)).then(() => true).catch(() => false)))).some(Boolean)) return true;
|
|
510
597
|
const packageJson = up("package.json", { cwd: cwd() });
|
|
511
598
|
if (typeof packageJson === "string") {
|
|
512
599
|
const json = JSON.parse(await readFile(packageJson, "utf8"));
|
|
@@ -551,10 +638,178 @@ async function getGlobals() {
|
|
|
551
638
|
if (await enableMode([
|
|
552
639
|
"wrangler.toml",
|
|
553
640
|
"wrangler.json",
|
|
554
|
-
"wrangler.jsonc"
|
|
555
|
-
|
|
641
|
+
"wrangler.jsonc",
|
|
642
|
+
"cloudflare.config.ts"
|
|
643
|
+
], [
|
|
644
|
+
"@cloudflare/workers-types",
|
|
645
|
+
"wrangler",
|
|
646
|
+
"@cloudflare/vite-plugin",
|
|
647
|
+
"@cloudflare/vitest-plugin"
|
|
648
|
+
])) return cloudflare;
|
|
556
649
|
return base;
|
|
557
650
|
}
|
|
651
|
+
const globals = await getGlobals();
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region src/js-plugins.ts
|
|
654
|
+
const jsPlugins = [
|
|
655
|
+
{
|
|
656
|
+
name: "comment-labs-js",
|
|
657
|
+
specifier: "@comment-labs/oxlint-config/plugins/labs"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "brettz9-js",
|
|
661
|
+
specifier: "@comment-labs/oxlint-config/plugins/brettz9"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
name: "i18next-js",
|
|
665
|
+
specifier: "@comment-labs/oxlint-config/plugins/i18next"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
name: "import-zod-js",
|
|
669
|
+
specifier: "@comment-labs/oxlint-config/plugins/import-zod"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
name: "playwright-js",
|
|
673
|
+
specifier: "@comment-labs/oxlint-config/plugins/playwright"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: "react-hooks-js",
|
|
677
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-hooks"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "react-native-js",
|
|
681
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-native"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
name: "react-refresh-js",
|
|
685
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-refresh"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
name: "security-js",
|
|
689
|
+
specifier: "@comment-labs/oxlint-config/plugins/security"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: "unicorn-js",
|
|
693
|
+
specifier: "@comment-labs/oxlint-config/plugins/unicorn"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: "stylistic-js",
|
|
697
|
+
specifier: "@comment-labs/oxlint-config/plugins/stylistic"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "jsdoc-js",
|
|
701
|
+
specifier: "@comment-labs/oxlint-config/plugins/jsdoc"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "e18e-js",
|
|
705
|
+
specifier: "@comment-labs/oxlint-config/plugins/e18e"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
name: "regexp-js",
|
|
709
|
+
specifier: "@comment-labs/oxlint-config/plugins/regexp"
|
|
710
|
+
}
|
|
711
|
+
];
|
|
712
|
+
const i18nextOverrides = {
|
|
713
|
+
files: [await enableMode([], ["i18next"]) ? "**/*" : "___disabled"],
|
|
714
|
+
rules: { "i18next-js/no-literal-string": "warn" }
|
|
715
|
+
};
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/overrides/playwright.ts
|
|
718
|
+
const playwrightOverrides = {
|
|
719
|
+
files: ["**/e2e/**/*"],
|
|
720
|
+
rules: {
|
|
721
|
+
"playwright-js/consistent-spacing-between-blocks": "warn",
|
|
722
|
+
"playwright-js/expect-expect": "warn",
|
|
723
|
+
"playwright-js/max-nested-describe": "warn",
|
|
724
|
+
"playwright-js/missing-playwright-await": "error",
|
|
725
|
+
"playwright-js/no-conditional-expect": "warn",
|
|
726
|
+
"playwright-js/no-conditional-in-test": "warn",
|
|
727
|
+
"playwright-js/no-duplicate-hooks": "warn",
|
|
728
|
+
"playwright-js/no-duplicate-slow": "warn",
|
|
729
|
+
"playwright-js/no-element-handle": "warn",
|
|
730
|
+
"playwright-js/no-eval": "warn",
|
|
731
|
+
"playwright-js/no-focused-test": "error",
|
|
732
|
+
"playwright-js/no-force-option": "warn",
|
|
733
|
+
"playwright-js/no-nested-step": "warn",
|
|
734
|
+
"playwright-js/no-networkidle": "error",
|
|
735
|
+
"playwright-js/no-page-pause": "warn",
|
|
736
|
+
"playwright-js/no-skipped-test": "warn",
|
|
737
|
+
"playwright-js/no-standalone-expect": "error",
|
|
738
|
+
"playwright-js/no-unsafe-references": "error",
|
|
739
|
+
"playwright-js/no-unused-locators": "error",
|
|
740
|
+
"playwright-js/no-useless-await": "warn",
|
|
741
|
+
"playwright-js/no-useless-not": "warn",
|
|
742
|
+
"playwright-js/no-wait-for-navigation": "error",
|
|
743
|
+
"playwright-js/no-wait-for-selector": "warn",
|
|
744
|
+
"playwright-js/no-wait-for-timeout": "warn",
|
|
745
|
+
"playwright-js/prefer-hooks-in-order": "warn",
|
|
746
|
+
"playwright-js/prefer-hooks-on-top": "warn",
|
|
747
|
+
"playwright-js/prefer-locator": "warn",
|
|
748
|
+
"playwright-js/prefer-to-have-count": "warn",
|
|
749
|
+
"playwright-js/prefer-to-have-length": "warn",
|
|
750
|
+
"playwright-js/prefer-web-first-assertions": "error",
|
|
751
|
+
"playwright-js/valid-describe-callback": "error",
|
|
752
|
+
"playwright-js/valid-expect": "error",
|
|
753
|
+
"playwright-js/valid-expect-in-promise": "error",
|
|
754
|
+
"playwright-js/valid-test-tags": "error",
|
|
755
|
+
"playwright-js/valid-title": "error"
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
//#endregion
|
|
759
|
+
//#region src/overrides/react.ts
|
|
760
|
+
const reactOverrides = {
|
|
761
|
+
files: ["**/*.?(c|m)@(j|t)sx"],
|
|
762
|
+
rules: {
|
|
763
|
+
"react-hooks-js/exhaustive-deps": "error",
|
|
764
|
+
"react-hooks-js/rules-of-hooks": "warn",
|
|
765
|
+
"react-refresh-js/only-export-components": "warn"
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
const reactNativeOverrides = {
|
|
769
|
+
files: [await enableMode([], ["react-native"]) ? "**/*.?(m)@(j|t)sx" : "___disabled"],
|
|
770
|
+
rules: {
|
|
771
|
+
"react-native-js/no-color-literals": "warn",
|
|
772
|
+
"react-native-js/no-inline-styles": "warn",
|
|
773
|
+
"react-native-js/no-raw-text": "off",
|
|
774
|
+
"react-native-js/no-single-element-style-arrays": "warn",
|
|
775
|
+
"react-native-js/no-unused-styles": "warn",
|
|
776
|
+
"react-native-js/sort-styles": "off",
|
|
777
|
+
"react-native-js/split-platform-components": "error"
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/overrides/scripts.ts
|
|
782
|
+
const scriptsOverrides = {
|
|
783
|
+
files: ["scripts/**/*.?(m)@(j|t)s"],
|
|
784
|
+
rules: { "unicorn/no-process-exit": "warn" }
|
|
785
|
+
};
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/overrides/declarations.ts
|
|
788
|
+
const declarationsOverrides = {
|
|
789
|
+
files: ["**/*.d.ts"],
|
|
790
|
+
rules: {
|
|
791
|
+
"typescript/no-empty-interface": "off",
|
|
792
|
+
"typescript/no-empty-object-type": "off"
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region src/overrides/ambient.ts
|
|
797
|
+
const ambientOverrides = {
|
|
798
|
+
files: ["**/src/env.d.ts", "**/src/environment.d.ts"],
|
|
799
|
+
rules: { "no-redeclare": "off" }
|
|
800
|
+
};
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/overrides/vitest.ts
|
|
803
|
+
const vitestOverrides = {
|
|
804
|
+
files: ["**/{test,tests}/**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}", "**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"],
|
|
805
|
+
rules: {
|
|
806
|
+
"vitest/prefer-expect-assertions": ["warn", {
|
|
807
|
+
onlyFunctionsWithExpectInCallback: true,
|
|
808
|
+
onlyFunctionsWithExpectInLoop: true
|
|
809
|
+
}],
|
|
810
|
+
"vitest/require-hook": "warn"
|
|
811
|
+
}
|
|
812
|
+
};
|
|
558
813
|
//#endregion
|
|
559
814
|
//#region src/index.ts
|
|
560
815
|
const config = {
|
|
@@ -564,129 +819,23 @@ const config = {
|
|
|
564
819
|
typeCheck: true
|
|
565
820
|
},
|
|
566
821
|
plugins,
|
|
567
|
-
jsPlugins
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
name: "brettz9-js",
|
|
574
|
-
specifier: "@comment-labs/oxlint-config/plugins/brettz9"
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
name: "i18next-js",
|
|
578
|
-
specifier: "@comment-labs/oxlint-config/plugins/i18next"
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
name: "import-zod-js",
|
|
582
|
-
specifier: "@comment-labs/oxlint-config/plugins/import-zod"
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
name: "playwright-js",
|
|
586
|
-
specifier: "@comment-labs/oxlint-config/plugins/playwright"
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
name: "react-hooks-js",
|
|
590
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-hooks"
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
name: "react-native-js",
|
|
594
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-native"
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
name: "react-refresh-js",
|
|
598
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-refresh"
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
name: "security-js",
|
|
602
|
-
specifier: "@comment-labs/oxlint-config/plugins/security"
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
name: "unicorn-js",
|
|
606
|
-
specifier: "@comment-labs/oxlint-config/plugins/unicorn"
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
name: "stylistic-js",
|
|
610
|
-
specifier: "@comment-labs/oxlint-config/plugins/stylistic"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
name: "jsdoc-js",
|
|
614
|
-
specifier: "@comment-labs/oxlint-config/plugins/jsdoc"
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
name: "e18e-js",
|
|
618
|
-
specifier: "@comment-labs/oxlint-config/plugins/e18e"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
name: "regexp-js",
|
|
622
|
-
specifier: "@comment-labs/oxlint-config/plugins/regexp"
|
|
623
|
-
}
|
|
624
|
-
],
|
|
625
|
-
rules: baseRules,
|
|
626
|
-
globals: await getGlobals(),
|
|
822
|
+
jsPlugins,
|
|
823
|
+
rules: {
|
|
824
|
+
...baseRules,
|
|
825
|
+
...stylisticRules
|
|
826
|
+
},
|
|
827
|
+
globals,
|
|
627
828
|
categories,
|
|
628
829
|
settings: { vitest: { typecheck: true } },
|
|
629
830
|
overrides: [
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
"playwright-js/no-conditional-in-test": "warn",
|
|
639
|
-
"playwright-js/no-duplicate-hooks": "warn",
|
|
640
|
-
"playwright-js/no-duplicate-slow": "warn",
|
|
641
|
-
"playwright-js/no-element-handle": "warn",
|
|
642
|
-
"playwright-js/no-eval": "warn",
|
|
643
|
-
"playwright-js/no-focused-test": "error",
|
|
644
|
-
"playwright-js/no-force-option": "warn",
|
|
645
|
-
"playwright-js/no-nested-step": "warn",
|
|
646
|
-
"playwright-js/no-networkidle": "error",
|
|
647
|
-
"playwright-js/no-page-pause": "warn",
|
|
648
|
-
"playwright-js/no-skipped-test": "warn",
|
|
649
|
-
"playwright-js/no-standalone-expect": "error",
|
|
650
|
-
"playwright-js/no-unsafe-references": "error",
|
|
651
|
-
"playwright-js/no-unused-locators": "error",
|
|
652
|
-
"playwright-js/no-useless-await": "warn",
|
|
653
|
-
"playwright-js/no-useless-not": "warn",
|
|
654
|
-
"playwright-js/no-wait-for-navigation": "error",
|
|
655
|
-
"playwright-js/no-wait-for-selector": "warn",
|
|
656
|
-
"playwright-js/no-wait-for-timeout": "warn",
|
|
657
|
-
"playwright-js/prefer-hooks-in-order": "warn",
|
|
658
|
-
"playwright-js/prefer-hooks-on-top": "warn",
|
|
659
|
-
"playwright-js/prefer-locator": "warn",
|
|
660
|
-
"playwright-js/prefer-to-have-count": "warn",
|
|
661
|
-
"playwright-js/prefer-to-have-length": "warn",
|
|
662
|
-
"playwright-js/prefer-web-first-assertions": "error",
|
|
663
|
-
"playwright-js/valid-describe-callback": "error",
|
|
664
|
-
"playwright-js/valid-expect": "error",
|
|
665
|
-
"playwright-js/valid-expect-in-promise": "error",
|
|
666
|
-
"playwright-js/valid-test-tags": "error",
|
|
667
|
-
"playwright-js/valid-title": "error"
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
files: ["**/*.?(c|m)@(j|t)sx"],
|
|
672
|
-
rules: {
|
|
673
|
-
"react-hooks-js/exhaustive-deps": "error",
|
|
674
|
-
"react-hooks-js/rules-of-hooks": "warn",
|
|
675
|
-
"react-refresh-js/only-export-components": "warn"
|
|
676
|
-
}
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
files: [await enableMode([], ["react-native"]) ? "**/*.?(m)@(j|t)sx" : "___disabled"],
|
|
680
|
-
rules: {
|
|
681
|
-
"react-native-js/no-color-literals": "warn",
|
|
682
|
-
"react-native-js/no-inline-styles": "warn",
|
|
683
|
-
"react-native-js/no-raw-text": "off",
|
|
684
|
-
"react-native-js/no-single-element-style-arrays": "warn",
|
|
685
|
-
"react-native-js/no-unused-styles": "warn",
|
|
686
|
-
"react-native-js/sort-styles": "off",
|
|
687
|
-
"react-native-js/split-platform-components": "error"
|
|
688
|
-
}
|
|
689
|
-
}
|
|
831
|
+
declarationsOverrides,
|
|
832
|
+
ambientOverrides,
|
|
833
|
+
i18nextOverrides,
|
|
834
|
+
playwrightOverrides,
|
|
835
|
+
reactOverrides,
|
|
836
|
+
reactNativeOverrides,
|
|
837
|
+
scriptsOverrides,
|
|
838
|
+
vitestOverrides
|
|
690
839
|
],
|
|
691
840
|
ignorePatterns: [
|
|
692
841
|
"coverage/**",
|