@comment-labs/oxlint-config 1.0.0-beta.8 → 1.0.0
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 +298 -221
- 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 +32 -33
- package/dist/plugins/labs.mjs.map +1 -1
- package/package.json +20 -19
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Create an `oxlint.config.ts` file in your project root:
|
|
|
16
16
|
import { defineConfig } from 'oxlint'
|
|
17
17
|
import { config } from '@comment-labs/oxlint-config'
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
export default defineConfig(config)
|
|
20
21
|
```
|
|
21
22
|
|
|
@@ -26,6 +27,16 @@ export default defineConfig(config)
|
|
|
26
27
|
- Vitest compatibility
|
|
27
28
|
- Optimized for correctness and performance
|
|
28
29
|
|
|
30
|
+
Add a lint script to `package.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"scripts": {
|
|
35
|
+
"lint": "oxlint"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
29
40
|
## License
|
|
30
41
|
|
|
31
42
|
[Apache-2.0](https://github.com/comment-team/comment-labs/blob/main/LICENSE)
|
package/dist/index.d.mts
CHANGED
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,15 +91,32 @@ 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",
|
|
95
|
+
"typescript/return-await": ["warn", "always"],
|
|
96
|
+
"typescript/no-confusing-void-expression": ["warn", { ignoreArrowShorthand: true }],
|
|
94
97
|
"import/no-unassigned-import": "warn",
|
|
95
98
|
"import/consistent-type-specifier-style": "off",
|
|
96
99
|
"import/no-anonymous-default-export": "off",
|
|
97
100
|
"import/no-cycle": "off",
|
|
98
101
|
"import/no-nodejs-modules": "off",
|
|
99
102
|
"import/unambiguous": "off",
|
|
103
|
+
"node/no-top-level-await": "off",
|
|
104
|
+
"node/no-sync": ["warn", { ignores: ["execSync"] }],
|
|
105
|
+
"react/react-in-jsx-scope": "off",
|
|
106
|
+
"react/jsx-filename-extension": ["error", { extensions: ["jsx", "tsx"] }],
|
|
100
107
|
"jest/require-hook": "off",
|
|
101
108
|
"jest/no-conditional-in-test": "off",
|
|
109
|
+
"jest/prefer-expect-assertions": "off",
|
|
110
|
+
"vitest/prefer-called-times": "off",
|
|
102
111
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
112
|
+
"vitest/prefer-expect-assertions": ["warn", {
|
|
113
|
+
onlyFunctionsWithExpectInCallback: true,
|
|
114
|
+
onlyFunctionsWithExpectInLoop: true
|
|
115
|
+
}],
|
|
116
|
+
"vitest/require-test-timeout": "off",
|
|
117
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
118
|
+
"vitest/no-conditional-in-test": "off",
|
|
119
|
+
"vitest/no-hooks": "off",
|
|
103
120
|
"jsdoc/require-param-type": "off",
|
|
104
121
|
"jsdoc/require-returns": "off",
|
|
105
122
|
"jsdoc/require-param": "off",
|
|
@@ -107,7 +124,21 @@ const baseRules = {
|
|
|
107
124
|
"unicorn/switch-case-braces": ["warn", "avoid"],
|
|
108
125
|
"unicorn/no-array-method-this-argument": "warn",
|
|
109
126
|
"unicorn/no-await-expression-member": "warn",
|
|
110
|
-
"
|
|
127
|
+
"unicorn/no-invalid-fetch-options": "off",
|
|
128
|
+
"unicorn/import-style": ["warn", {
|
|
129
|
+
extendDefaultStyles: false,
|
|
130
|
+
styles: {
|
|
131
|
+
"path": {
|
|
132
|
+
named: true,
|
|
133
|
+
default: false
|
|
134
|
+
},
|
|
135
|
+
"util": {
|
|
136
|
+
named: true,
|
|
137
|
+
default: false
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}],
|
|
141
|
+
"unicorn/max-nested-calls": ["warn", { max: 5 }],
|
|
111
142
|
"comment-labs-js/no-self-assign": "error",
|
|
112
143
|
"brettz9-js/arrow-parens": "off",
|
|
113
144
|
"brettz9-js/block-scoped-var": "off",
|
|
@@ -117,7 +148,6 @@ const baseRules = {
|
|
|
117
148
|
"brettz9-js/no-use-ignored-vars": "warn",
|
|
118
149
|
"brettz9-js/no-useless-rest-spread": "warn",
|
|
119
150
|
"brettz9-js/prefer-for-of": "off",
|
|
120
|
-
"i18next-js/no-literal-string": "warn",
|
|
121
151
|
"import-zod-js/prefer-zod-namespace": "warn",
|
|
122
152
|
"security-js/detect-unsafe-regex": "error",
|
|
123
153
|
"security-js/detect-non-literal-regexp": "error",
|
|
@@ -143,6 +173,106 @@ const baseRules = {
|
|
|
143
173
|
"unicorn-js/prefer-switch": "warn",
|
|
144
174
|
"unicorn-js/switch-case-break-position": "warn",
|
|
145
175
|
"unicorn-js/prefer-single-call": "warn",
|
|
176
|
+
"jsdoc-js/check-alignment": "warn",
|
|
177
|
+
"jsdoc-js/check-indentation": "warn",
|
|
178
|
+
"jsdoc-js/check-line-alignment": "warn",
|
|
179
|
+
"jsdoc-js/check-param-names": "warn",
|
|
180
|
+
"jsdoc-js/check-types": "warn",
|
|
181
|
+
"jsdoc-js/check-values": "warn",
|
|
182
|
+
"jsdoc-js/multiline-blocks": "warn",
|
|
183
|
+
"jsdoc-js/no-multi-asterisks": "warn",
|
|
184
|
+
"jsdoc-js/no-undefined-types": "warn",
|
|
185
|
+
"jsdoc-js/require-returns-check": "warn",
|
|
186
|
+
"jsdoc-js/require-yields-check": "warn",
|
|
187
|
+
"jsdoc-js/tag-lines": "warn",
|
|
188
|
+
"jsdoc-js/valid-types": "warn",
|
|
189
|
+
"e18e-js/prefer-array-at": "error",
|
|
190
|
+
"e18e-js/prefer-array-fill": "error",
|
|
191
|
+
"e18e-js/prefer-includes": "error",
|
|
192
|
+
"e18e-js/prefer-array-to-reversed": "error",
|
|
193
|
+
"e18e-js/prefer-array-to-sorted": "error",
|
|
194
|
+
"e18e-js/prefer-array-to-spliced": "error",
|
|
195
|
+
"e18e-js/prefer-nullish-coalescing": "error",
|
|
196
|
+
"e18e-js/prefer-object-has-own": "error",
|
|
197
|
+
"e18e-js/prefer-spread-syntax": "error",
|
|
198
|
+
"e18e-js/prefer-url-canparse": "error",
|
|
199
|
+
"e18e-js/ban-dependencies": "error",
|
|
200
|
+
"e18e-js/prefer-array-from-map": "error",
|
|
201
|
+
"e18e-js/prefer-timer-args": "error",
|
|
202
|
+
"e18e-js/prefer-date-now": "error",
|
|
203
|
+
"e18e-js/prefer-regex-test": "error",
|
|
204
|
+
"e18e-js/prefer-array-some": "error",
|
|
205
|
+
"e18e-js/prefer-static-regex": "error",
|
|
206
|
+
"no-control-regex": "error",
|
|
207
|
+
"no-misleading-character-class": "error",
|
|
208
|
+
"no-regex-spaces": "error",
|
|
209
|
+
"no-invalid-regexp": "off",
|
|
210
|
+
"no-useless-backreference": "off",
|
|
211
|
+
"no-empty-character-class": "off",
|
|
212
|
+
"regexp-js/confusing-quantifier": "warn",
|
|
213
|
+
"regexp-js/control-character-escape": "error",
|
|
214
|
+
"regexp-js/match-any": "error",
|
|
215
|
+
"regexp-js/negation": "error",
|
|
216
|
+
"regexp-js/no-contradiction-with-assertion": "error",
|
|
217
|
+
"regexp-js/no-dupe-characters-character-class": "error",
|
|
218
|
+
"regexp-js/no-dupe-disjunctions": "error",
|
|
219
|
+
"regexp-js/no-empty-alternative": "warn",
|
|
220
|
+
"regexp-js/no-empty-capturing-group": "error",
|
|
221
|
+
"regexp-js/no-empty-character-class": "error",
|
|
222
|
+
"regexp-js/no-empty-group": "error",
|
|
223
|
+
"regexp-js/no-empty-lookarounds-assertion": "error",
|
|
224
|
+
"regexp-js/no-empty-string-literal": "error",
|
|
225
|
+
"regexp-js/no-escape-backspace": "error",
|
|
226
|
+
"regexp-js/no-extra-lookaround-assertions": "error",
|
|
227
|
+
"regexp-js/no-invalid-regexp": "error",
|
|
228
|
+
"regexp-js/no-invisible-character": "error",
|
|
229
|
+
"regexp-js/no-lazy-ends": "warn",
|
|
230
|
+
"regexp-js/no-legacy-features": "error",
|
|
231
|
+
"regexp-js/no-misleading-capturing-group": "error",
|
|
232
|
+
"regexp-js/no-misleading-unicode-character": "error",
|
|
233
|
+
"regexp-js/no-missing-g-flag": "error",
|
|
234
|
+
"regexp-js/no-non-standard-flag": "error",
|
|
235
|
+
"regexp-js/no-obscure-range": "error",
|
|
236
|
+
"regexp-js/no-optional-assertion": "error",
|
|
237
|
+
"regexp-js/no-potentially-useless-backreference": "warn",
|
|
238
|
+
"regexp-js/no-super-linear-backtracking": "error",
|
|
239
|
+
"regexp-js/no-trivially-nested-assertion": "error",
|
|
240
|
+
"regexp-js/no-trivially-nested-quantifier": "error",
|
|
241
|
+
"regexp-js/no-unused-capturing-group": "error",
|
|
242
|
+
"regexp-js/no-useless-assertions": "error",
|
|
243
|
+
"regexp-js/no-useless-backreference": "error",
|
|
244
|
+
"regexp-js/no-useless-character-class": "error",
|
|
245
|
+
"regexp-js/no-useless-dollar-replacements": "error",
|
|
246
|
+
"regexp-js/no-useless-escape": "error",
|
|
247
|
+
"regexp-js/no-useless-flag": "warn",
|
|
248
|
+
"regexp-js/no-useless-lazy": "error",
|
|
249
|
+
"regexp-js/no-useless-non-capturing-group": "error",
|
|
250
|
+
"regexp-js/no-useless-quantifier": "error",
|
|
251
|
+
"regexp-js/no-useless-range": "error",
|
|
252
|
+
"regexp-js/no-useless-set-operand": "error",
|
|
253
|
+
"regexp-js/no-useless-string-literal": "error",
|
|
254
|
+
"regexp-js/no-useless-two-nums-quantifier": "error",
|
|
255
|
+
"regexp-js/no-zero-quantifier": "error",
|
|
256
|
+
"regexp-js/optimal-lookaround-quantifier": "warn",
|
|
257
|
+
"regexp-js/optimal-quantifier-concatenation": "error",
|
|
258
|
+
"regexp-js/prefer-character-class": "error",
|
|
259
|
+
"regexp-js/prefer-d": "error",
|
|
260
|
+
"regexp-js/prefer-plus-quantifier": "error",
|
|
261
|
+
"regexp-js/prefer-predefined-assertion": "error",
|
|
262
|
+
"regexp-js/prefer-question-quantifier": "error",
|
|
263
|
+
"regexp-js/prefer-range": "error",
|
|
264
|
+
"regexp-js/prefer-set-operation": "error",
|
|
265
|
+
"regexp-js/prefer-star-quantifier": "error",
|
|
266
|
+
"regexp-js/prefer-unicode-codepoint-escapes": "error",
|
|
267
|
+
"regexp-js/prefer-w": "error",
|
|
268
|
+
"regexp-js/simplify-set-operations": "error",
|
|
269
|
+
"regexp-js/sort-flags": "error",
|
|
270
|
+
"regexp-js/strict": "error",
|
|
271
|
+
"regexp-js/use-ignore-case": "error"
|
|
272
|
+
};
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/stylistic-rules.ts
|
|
275
|
+
const stylisticRules = {
|
|
146
276
|
"stylistic-js/type-generic-spacing": "warn",
|
|
147
277
|
"stylistic-js/type-named-tuple-spacing": "warn",
|
|
148
278
|
"stylistic-js/function-call-spacing": ["warn", "never"],
|
|
@@ -387,103 +517,7 @@ const baseRules = {
|
|
|
387
517
|
prev: "multiline-block-like",
|
|
388
518
|
next: "*"
|
|
389
519
|
}
|
|
390
|
-
]
|
|
391
|
-
"jsdoc-js/check-alignment": "warn",
|
|
392
|
-
"jsdoc-js/check-indentation": "warn",
|
|
393
|
-
"jsdoc-js/check-line-alignment": "warn",
|
|
394
|
-
"jsdoc-js/check-param-names": "warn",
|
|
395
|
-
"jsdoc-js/check-types": "warn",
|
|
396
|
-
"jsdoc-js/check-values": "warn",
|
|
397
|
-
"jsdoc-js/multiline-blocks": "warn",
|
|
398
|
-
"jsdoc-js/no-multi-asterisks": "warn",
|
|
399
|
-
"jsdoc-js/no-undefined-types": "warn",
|
|
400
|
-
"jsdoc-js/require-returns-check": "warn",
|
|
401
|
-
"jsdoc-js/require-yields-check": "warn",
|
|
402
|
-
"jsdoc-js/tag-lines": "warn",
|
|
403
|
-
"jsdoc-js/valid-types": "warn",
|
|
404
|
-
"e18e-js/prefer-array-at": "error",
|
|
405
|
-
"e18e-js/prefer-array-fill": "error",
|
|
406
|
-
"e18e-js/prefer-includes": "error",
|
|
407
|
-
"e18e-js/prefer-array-to-reversed": "error",
|
|
408
|
-
"e18e-js/prefer-array-to-sorted": "error",
|
|
409
|
-
"e18e-js/prefer-array-to-spliced": "error",
|
|
410
|
-
"e18e-js/prefer-nullish-coalescing": "error",
|
|
411
|
-
"e18e-js/prefer-object-has-own": "error",
|
|
412
|
-
"e18e-js/prefer-spread-syntax": "error",
|
|
413
|
-
"e18e-js/prefer-url-canparse": "error",
|
|
414
|
-
"e18e-js/ban-dependencies": "error",
|
|
415
|
-
"e18e-js/prefer-array-from-map": "error",
|
|
416
|
-
"e18e-js/prefer-timer-args": "error",
|
|
417
|
-
"e18e-js/prefer-date-now": "error",
|
|
418
|
-
"e18e-js/prefer-regex-test": "error",
|
|
419
|
-
"e18e-js/prefer-array-some": "error",
|
|
420
|
-
"e18e-js/prefer-static-regex": "error",
|
|
421
|
-
"no-control-regex": "error",
|
|
422
|
-
"no-misleading-character-class": "error",
|
|
423
|
-
"no-regex-spaces": "error",
|
|
424
|
-
"no-invalid-regexp": "off",
|
|
425
|
-
"no-useless-backreference": "off",
|
|
426
|
-
"no-empty-character-class": "off",
|
|
427
|
-
"regexp-js/confusing-quantifier": "warn",
|
|
428
|
-
"regexp-js/control-character-escape": "error",
|
|
429
|
-
"regexp-js/match-any": "error",
|
|
430
|
-
"regexp-js/negation": "error",
|
|
431
|
-
"regexp-js/no-contradiction-with-assertion": "error",
|
|
432
|
-
"regexp-js/no-dupe-characters-character-class": "error",
|
|
433
|
-
"regexp-js/no-dupe-disjunctions": "error",
|
|
434
|
-
"regexp-js/no-empty-alternative": "warn",
|
|
435
|
-
"regexp-js/no-empty-capturing-group": "error",
|
|
436
|
-
"regexp-js/no-empty-character-class": "error",
|
|
437
|
-
"regexp-js/no-empty-group": "error",
|
|
438
|
-
"regexp-js/no-empty-lookarounds-assertion": "error",
|
|
439
|
-
"regexp-js/no-empty-string-literal": "error",
|
|
440
|
-
"regexp-js/no-escape-backspace": "error",
|
|
441
|
-
"regexp-js/no-extra-lookaround-assertions": "error",
|
|
442
|
-
"regexp-js/no-invalid-regexp": "error",
|
|
443
|
-
"regexp-js/no-invisible-character": "error",
|
|
444
|
-
"regexp-js/no-lazy-ends": "warn",
|
|
445
|
-
"regexp-js/no-legacy-features": "error",
|
|
446
|
-
"regexp-js/no-misleading-capturing-group": "error",
|
|
447
|
-
"regexp-js/no-misleading-unicode-character": "error",
|
|
448
|
-
"regexp-js/no-missing-g-flag": "error",
|
|
449
|
-
"regexp-js/no-non-standard-flag": "error",
|
|
450
|
-
"regexp-js/no-obscure-range": "error",
|
|
451
|
-
"regexp-js/no-optional-assertion": "error",
|
|
452
|
-
"regexp-js/no-potentially-useless-backreference": "warn",
|
|
453
|
-
"regexp-js/no-super-linear-backtracking": "error",
|
|
454
|
-
"regexp-js/no-trivially-nested-assertion": "error",
|
|
455
|
-
"regexp-js/no-trivially-nested-quantifier": "error",
|
|
456
|
-
"regexp-js/no-unused-capturing-group": "error",
|
|
457
|
-
"regexp-js/no-useless-assertions": "error",
|
|
458
|
-
"regexp-js/no-useless-backreference": "error",
|
|
459
|
-
"regexp-js/no-useless-character-class": "error",
|
|
460
|
-
"regexp-js/no-useless-dollar-replacements": "error",
|
|
461
|
-
"regexp-js/no-useless-escape": "error",
|
|
462
|
-
"regexp-js/no-useless-flag": "warn",
|
|
463
|
-
"regexp-js/no-useless-lazy": "error",
|
|
464
|
-
"regexp-js/no-useless-non-capturing-group": "error",
|
|
465
|
-
"regexp-js/no-useless-quantifier": "error",
|
|
466
|
-
"regexp-js/no-useless-range": "error",
|
|
467
|
-
"regexp-js/no-useless-set-operand": "error",
|
|
468
|
-
"regexp-js/no-useless-string-literal": "error",
|
|
469
|
-
"regexp-js/no-useless-two-nums-quantifier": "error",
|
|
470
|
-
"regexp-js/no-zero-quantifier": "error",
|
|
471
|
-
"regexp-js/optimal-lookaround-quantifier": "warn",
|
|
472
|
-
"regexp-js/optimal-quantifier-concatenation": "error",
|
|
473
|
-
"regexp-js/prefer-character-class": "error",
|
|
474
|
-
"regexp-js/prefer-d": "error",
|
|
475
|
-
"regexp-js/prefer-plus-quantifier": "error",
|
|
476
|
-
"regexp-js/prefer-predefined-assertion": "error",
|
|
477
|
-
"regexp-js/prefer-question-quantifier": "error",
|
|
478
|
-
"regexp-js/prefer-range": "error",
|
|
479
|
-
"regexp-js/prefer-set-operation": "error",
|
|
480
|
-
"regexp-js/prefer-star-quantifier": "error",
|
|
481
|
-
"regexp-js/prefer-unicode-codepoint-escapes": "error",
|
|
482
|
-
"regexp-js/prefer-w": "error",
|
|
483
|
-
"regexp-js/simplify-set-operations": "error",
|
|
484
|
-
"regexp-js/sort-flags": "error",
|
|
485
|
-
"regexp-js/strict": "error",
|
|
486
|
-
"regexp-js/use-ignore-case": "error"
|
|
520
|
+
]
|
|
487
521
|
};
|
|
488
522
|
//#endregion
|
|
489
523
|
//#region src/plugins.ts
|
|
@@ -505,7 +539,7 @@ const plugins = [
|
|
|
505
539
|
//#endregion
|
|
506
540
|
//#region src/utils.ts
|
|
507
541
|
async function enableMode(configFiles, dependencies) {
|
|
508
|
-
if ((await Promise.all(configFiles.map(async (file) => access(join(cwd(), file)).then(() => true).catch(() => false)))).some(Boolean)) return true;
|
|
542
|
+
if ((await Promise.all(configFiles.map(async (file) => await access(join(cwd(), file)).then(() => true).catch(() => false)))).some(Boolean)) return true;
|
|
509
543
|
const packageJson = up("package.json", { cwd: cwd() });
|
|
510
544
|
if (typeof packageJson === "string") {
|
|
511
545
|
const json = JSON.parse(await readFile(packageJson, "utf8"));
|
|
@@ -554,6 +588,156 @@ async function getGlobals() {
|
|
|
554
588
|
], ["@cloudflare/workers-types", "wrangler"])) return cloudflare;
|
|
555
589
|
return base;
|
|
556
590
|
}
|
|
591
|
+
const globals = await getGlobals();
|
|
592
|
+
//#endregion
|
|
593
|
+
//#region src/js-plugins.ts
|
|
594
|
+
const jsPlugins = [
|
|
595
|
+
{
|
|
596
|
+
name: "comment-labs-js",
|
|
597
|
+
specifier: "@comment-labs/oxlint-config/plugins/labs"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: "brettz9-js",
|
|
601
|
+
specifier: "@comment-labs/oxlint-config/plugins/brettz9"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "i18next-js",
|
|
605
|
+
specifier: "@comment-labs/oxlint-config/plugins/i18next"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
name: "import-zod-js",
|
|
609
|
+
specifier: "@comment-labs/oxlint-config/plugins/import-zod"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: "playwright-js",
|
|
613
|
+
specifier: "@comment-labs/oxlint-config/plugins/playwright"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
name: "react-hooks-js",
|
|
617
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-hooks"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "react-native-js",
|
|
621
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-native"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: "react-refresh-js",
|
|
625
|
+
specifier: "@comment-labs/oxlint-config/plugins/react-refresh"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: "security-js",
|
|
629
|
+
specifier: "@comment-labs/oxlint-config/plugins/security"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: "unicorn-js",
|
|
633
|
+
specifier: "@comment-labs/oxlint-config/plugins/unicorn"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
name: "stylistic-js",
|
|
637
|
+
specifier: "@comment-labs/oxlint-config/plugins/stylistic"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: "jsdoc-js",
|
|
641
|
+
specifier: "@comment-labs/oxlint-config/plugins/jsdoc"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
name: "e18e-js",
|
|
645
|
+
specifier: "@comment-labs/oxlint-config/plugins/e18e"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: "regexp-js",
|
|
649
|
+
specifier: "@comment-labs/oxlint-config/plugins/regexp"
|
|
650
|
+
}
|
|
651
|
+
];
|
|
652
|
+
const i18nextOverrides = {
|
|
653
|
+
files: [await enableMode([], ["i18next"]) ? "**/*" : "___disabled"],
|
|
654
|
+
rules: { "i18next-js/no-literal-string": "warn" }
|
|
655
|
+
};
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/overrides/playwright.ts
|
|
658
|
+
const playwrightOverrides = {
|
|
659
|
+
files: ["**/e2e/**/*"],
|
|
660
|
+
rules: {
|
|
661
|
+
"playwright-js/consistent-spacing-between-blocks": "warn",
|
|
662
|
+
"playwright-js/expect-expect": "warn",
|
|
663
|
+
"playwright-js/max-nested-describe": "warn",
|
|
664
|
+
"playwright-js/missing-playwright-await": "error",
|
|
665
|
+
"playwright-js/no-conditional-expect": "warn",
|
|
666
|
+
"playwright-js/no-conditional-in-test": "warn",
|
|
667
|
+
"playwright-js/no-duplicate-hooks": "warn",
|
|
668
|
+
"playwright-js/no-duplicate-slow": "warn",
|
|
669
|
+
"playwright-js/no-element-handle": "warn",
|
|
670
|
+
"playwright-js/no-eval": "warn",
|
|
671
|
+
"playwright-js/no-focused-test": "error",
|
|
672
|
+
"playwright-js/no-force-option": "warn",
|
|
673
|
+
"playwright-js/no-nested-step": "warn",
|
|
674
|
+
"playwright-js/no-networkidle": "error",
|
|
675
|
+
"playwright-js/no-page-pause": "warn",
|
|
676
|
+
"playwright-js/no-skipped-test": "warn",
|
|
677
|
+
"playwright-js/no-standalone-expect": "error",
|
|
678
|
+
"playwright-js/no-unsafe-references": "error",
|
|
679
|
+
"playwright-js/no-unused-locators": "error",
|
|
680
|
+
"playwright-js/no-useless-await": "warn",
|
|
681
|
+
"playwright-js/no-useless-not": "warn",
|
|
682
|
+
"playwright-js/no-wait-for-navigation": "error",
|
|
683
|
+
"playwright-js/no-wait-for-selector": "warn",
|
|
684
|
+
"playwright-js/no-wait-for-timeout": "warn",
|
|
685
|
+
"playwright-js/prefer-hooks-in-order": "warn",
|
|
686
|
+
"playwright-js/prefer-hooks-on-top": "warn",
|
|
687
|
+
"playwright-js/prefer-locator": "warn",
|
|
688
|
+
"playwright-js/prefer-to-have-count": "warn",
|
|
689
|
+
"playwright-js/prefer-to-have-length": "warn",
|
|
690
|
+
"playwright-js/prefer-web-first-assertions": "error",
|
|
691
|
+
"playwright-js/valid-describe-callback": "error",
|
|
692
|
+
"playwright-js/valid-expect": "error",
|
|
693
|
+
"playwright-js/valid-expect-in-promise": "error",
|
|
694
|
+
"playwright-js/valid-test-tags": "error",
|
|
695
|
+
"playwright-js/valid-title": "error"
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/overrides/react.ts
|
|
700
|
+
const reactOverrides = {
|
|
701
|
+
files: ["**/*.?(c|m)@(j|t)sx"],
|
|
702
|
+
rules: {
|
|
703
|
+
"react-hooks-js/exhaustive-deps": "error",
|
|
704
|
+
"react-hooks-js/rules-of-hooks": "warn",
|
|
705
|
+
"react-refresh-js/only-export-components": "warn"
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
const reactNativeOverrides = {
|
|
709
|
+
files: [await enableMode([], ["react-native"]) ? "**/*.?(m)@(j|t)sx" : "___disabled"],
|
|
710
|
+
rules: {
|
|
711
|
+
"react-native-js/no-color-literals": "warn",
|
|
712
|
+
"react-native-js/no-inline-styles": "warn",
|
|
713
|
+
"react-native-js/no-raw-text": "off",
|
|
714
|
+
"react-native-js/no-single-element-style-arrays": "warn",
|
|
715
|
+
"react-native-js/no-unused-styles": "warn",
|
|
716
|
+
"react-native-js/sort-styles": "off",
|
|
717
|
+
"react-native-js/split-platform-components": "error"
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
//#endregion
|
|
721
|
+
//#region src/overrides/scripts.ts
|
|
722
|
+
const scriptsOverrides = {
|
|
723
|
+
files: ["scripts/**/*.?(m)@(j|t)s"],
|
|
724
|
+
rules: { "unicorn/no-process-exit": "warn" }
|
|
725
|
+
};
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/overrides/declarations.ts
|
|
728
|
+
const declarationsOverrides = {
|
|
729
|
+
files: ["**/*.d.ts"],
|
|
730
|
+
rules: {
|
|
731
|
+
"typescript/no-empty-interface": "off",
|
|
732
|
+
"typescript/no-empty-object-type": "off"
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
//#endregion
|
|
736
|
+
//#region src/overrides/ambient.ts
|
|
737
|
+
const ambientOverrides = {
|
|
738
|
+
files: ["**/src/env.d.ts", "**/src/environment.d.ts"],
|
|
739
|
+
rules: { "no-redeclare": "off" }
|
|
740
|
+
};
|
|
557
741
|
//#endregion
|
|
558
742
|
//#region src/index.ts
|
|
559
743
|
const config = {
|
|
@@ -563,129 +747,22 @@ const config = {
|
|
|
563
747
|
typeCheck: true
|
|
564
748
|
},
|
|
565
749
|
plugins,
|
|
566
|
-
jsPlugins
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
name: "brettz9-js",
|
|
573
|
-
specifier: "@comment-labs/oxlint-config/plugins/brettz9"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
name: "i18next-js",
|
|
577
|
-
specifier: "@comment-labs/oxlint-config/plugins/i18next"
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
name: "import-zod-js",
|
|
581
|
-
specifier: "@comment-labs/oxlint-config/plugins/import-zod"
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
name: "playwright-js",
|
|
585
|
-
specifier: "@comment-labs/oxlint-config/plugins/playwright"
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
name: "react-hooks-js",
|
|
589
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-hooks"
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
name: "react-native-js",
|
|
593
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-native"
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
name: "react-refresh-js",
|
|
597
|
-
specifier: "@comment-labs/oxlint-config/plugins/react-refresh"
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
name: "security-js",
|
|
601
|
-
specifier: "@comment-labs/oxlint-config/plugins/security"
|
|
602
|
-
},
|
|
603
|
-
{
|
|
604
|
-
name: "unicorn-js",
|
|
605
|
-
specifier: "@comment-labs/oxlint-config/plugins/unicorn"
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
name: "stylistic-js",
|
|
609
|
-
specifier: "@comment-labs/oxlint-config/plugins/stylistic"
|
|
610
|
-
},
|
|
611
|
-
{
|
|
612
|
-
name: "jsdoc-js",
|
|
613
|
-
specifier: "@comment-labs/oxlint-config/plugins/jsdoc"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
name: "e18e-js",
|
|
617
|
-
specifier: "@comment-labs/oxlint-config/plugins/e18e"
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
name: "regexp-js",
|
|
621
|
-
specifier: "@comment-labs/oxlint-config/plugins/regexp"
|
|
622
|
-
}
|
|
623
|
-
],
|
|
624
|
-
rules: baseRules,
|
|
625
|
-
globals: await getGlobals(),
|
|
750
|
+
jsPlugins,
|
|
751
|
+
rules: {
|
|
752
|
+
...baseRules,
|
|
753
|
+
...stylisticRules
|
|
754
|
+
},
|
|
755
|
+
globals,
|
|
626
756
|
categories,
|
|
627
757
|
settings: { vitest: { typecheck: true } },
|
|
628
758
|
overrides: [
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"playwright-js/no-conditional-expect": "warn",
|
|
637
|
-
"playwright-js/no-conditional-in-test": "warn",
|
|
638
|
-
"playwright-js/no-duplicate-hooks": "warn",
|
|
639
|
-
"playwright-js/no-duplicate-slow": "warn",
|
|
640
|
-
"playwright-js/no-element-handle": "warn",
|
|
641
|
-
"playwright-js/no-eval": "warn",
|
|
642
|
-
"playwright-js/no-focused-test": "error",
|
|
643
|
-
"playwright-js/no-force-option": "warn",
|
|
644
|
-
"playwright-js/no-nested-step": "warn",
|
|
645
|
-
"playwright-js/no-networkidle": "error",
|
|
646
|
-
"playwright-js/no-page-pause": "warn",
|
|
647
|
-
"playwright-js/no-skipped-test": "warn",
|
|
648
|
-
"playwright-js/no-standalone-expect": "error",
|
|
649
|
-
"playwright-js/no-unsafe-references": "error",
|
|
650
|
-
"playwright-js/no-unused-locators": "error",
|
|
651
|
-
"playwright-js/no-useless-await": "warn",
|
|
652
|
-
"playwright-js/no-useless-not": "warn",
|
|
653
|
-
"playwright-js/no-wait-for-navigation": "error",
|
|
654
|
-
"playwright-js/no-wait-for-selector": "warn",
|
|
655
|
-
"playwright-js/no-wait-for-timeout": "warn",
|
|
656
|
-
"playwright-js/prefer-hooks-in-order": "warn",
|
|
657
|
-
"playwright-js/prefer-hooks-on-top": "warn",
|
|
658
|
-
"playwright-js/prefer-locator": "warn",
|
|
659
|
-
"playwright-js/prefer-to-have-count": "warn",
|
|
660
|
-
"playwright-js/prefer-to-have-length": "warn",
|
|
661
|
-
"playwright-js/prefer-web-first-assertions": "error",
|
|
662
|
-
"playwright-js/valid-describe-callback": "error",
|
|
663
|
-
"playwright-js/valid-expect": "error",
|
|
664
|
-
"playwright-js/valid-expect-in-promise": "error",
|
|
665
|
-
"playwright-js/valid-test-tags": "error",
|
|
666
|
-
"playwright-js/valid-title": "error"
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
files: ["**/*.?(c|m)@(j|t)sx"],
|
|
671
|
-
rules: {
|
|
672
|
-
"react-hooks-js/exhaustive-deps": "error",
|
|
673
|
-
"react-hooks-js/rules-of-hooks": "warn",
|
|
674
|
-
"react-refresh-js/only-export-components": "warn"
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
files: [await enableMode([], ["react-native"]) ? "**/*.?(m)@(j|t)sx" : "___disabled"],
|
|
679
|
-
rules: {
|
|
680
|
-
"react-native-js/no-color-literals": "warn",
|
|
681
|
-
"react-native-js/no-inline-styles": "warn",
|
|
682
|
-
"react-native-js/no-raw-text": "off",
|
|
683
|
-
"react-native-js/no-single-element-style-arrays": "warn",
|
|
684
|
-
"react-native-js/no-unused-styles": "warn",
|
|
685
|
-
"react-native-js/sort-styles": "off",
|
|
686
|
-
"react-native-js/split-platform-components": "error"
|
|
687
|
-
}
|
|
688
|
-
}
|
|
759
|
+
declarationsOverrides,
|
|
760
|
+
ambientOverrides,
|
|
761
|
+
i18nextOverrides,
|
|
762
|
+
playwrightOverrides,
|
|
763
|
+
reactOverrides,
|
|
764
|
+
reactNativeOverrides,
|
|
765
|
+
scriptsOverrides
|
|
689
766
|
],
|
|
690
767
|
ignorePatterns: [
|
|
691
768
|
"coverage/**",
|