@nelsonlaidev/oxlint-config 0.3.2 → 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/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { mergeWith, pick } from "es-toolkit/object";
2
- import { isPackageExists } from "local-pkg";
1
+ import { merge } from "ts-deepmerge";
3
2
  //#region src/globs.ts
4
3
  const GLOB_SRC_EXT = "{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
5
4
  const GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
@@ -9,134 +8,138 @@ const GLOB_TS = "**/*.{ts,cts,mts}";
9
8
  const GLOB_TSX = "**/*.{tsx,ctsx,mtsx}";
10
9
  //#endregion
11
10
  //#region src/configs/command.ts
12
- const command = () => [{
11
+ const command = () => ({
13
12
  files: [GLOB_SRC],
14
- jsPlugins: ["eslint-plugin-command"],
13
+ jsPlugins: [{
14
+ name: "command",
15
+ specifier: "eslint-plugin-command"
16
+ }],
15
17
  rules: { "command/command": "error" }
16
- }];
18
+ });
17
19
  //#endregion
18
20
  //#region src/configs/de-morgan.ts
19
- const deMorgan = () => [{
21
+ const deMorgan = () => ({
20
22
  files: [GLOB_SRC],
21
- jsPlugins: ["eslint-plugin-de-morgan"],
23
+ jsPlugins: [{
24
+ name: "de-morgan",
25
+ specifier: "eslint-plugin-de-morgan"
26
+ }],
22
27
  rules: {
23
28
  "de-morgan/no-negated-conjunction": "error",
24
29
  "de-morgan/no-negated-disjunction": "error"
25
30
  }
26
- }];
31
+ });
27
32
  //#endregion
28
33
  //#region src/configs/eslint.ts
29
- const eslint = () => [{
34
+ const eslint = () => ({
30
35
  files: [GLOB_SRC],
31
36
  plugins: ["eslint"],
32
37
  rules: {
33
- "array-callback-return": "error",
34
- "constructor-super": "error",
35
- eqeqeq: "error",
36
- "for-direction": "error",
37
- "getter-return": "error",
38
- "no-alert": "error",
39
- "no-async-promise-executor": "error",
40
- "no-await-in-loop": "error",
41
- "no-caller": "off",
42
- "no-case-declarations": "error",
43
- "no-class-assign": "error",
44
- "no-compare-neg-zero": "error",
45
- "no-cond-assign": "error",
46
- "no-const-assign": "error",
47
- "no-constant-binary-expression": "error",
48
- "no-constant-condition": "error",
49
- "no-control-regex": "error",
50
- "no-debugger": "error",
51
- "no-delete-var": "error",
52
- "no-dupe-class-members": "error",
53
- "no-dupe-else-if": "error",
54
- "no-dupe-keys": "error",
55
- "no-duplicate-case": "error",
56
- "no-empty": "error",
57
- "no-empty-character-class": "error",
58
- "no-empty-pattern": "error",
59
- "no-empty-static-block": "error",
60
- "no-eval": "error",
61
- "no-ex-assign": "error",
62
- "no-extra-bind": "error",
63
- "no-extra-boolean-cast": "error",
64
- "no-fallthrough": "error",
65
- "no-func-assign": "error",
66
- "no-global-assign": "error",
67
- "no-import-assign": "error",
68
- "no-invalid-regexp": "error",
69
- "no-irregular-whitespace": "error",
70
- "no-iterator": "off",
71
- "no-label-var": "error",
72
- "no-labels": "error",
73
- "no-lone-blocks": "error",
74
- "no-loss-of-precision": "error",
75
- "no-misleading-character-class": "error",
76
- "no-new": "error",
77
- "no-new-func": "error",
78
- "no-new-native-nonconstructor": "error",
79
- "no-nonoctal-decimal-escape": "error",
80
- "no-obj-calls": "error",
81
- "no-param-reassign": "error",
82
- "no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
83
- "no-promise-executor-return": "error",
84
- "no-prototype-builtins": "error",
85
- "no-redeclare": "error",
86
- "no-regex-spaces": "error",
87
- "no-return-assign": "error",
88
- "no-script-url": "error",
89
- "no-self-assign": "error",
90
- "no-self-compare": "error",
91
- "no-sequences": "error",
92
- "no-setter-return": "error",
93
- "no-shadow-restricted-names": "error",
94
- "no-sparse-arrays": "error",
95
- "no-template-curly-in-string": "error",
96
- "no-this-before-super": "error",
97
- "no-unassigned-vars": "error",
98
- "no-undef": "error",
99
- "no-unexpected-multiline": "error",
100
- "no-unneeded-ternary": "error",
101
- "no-unreachable": "error",
102
- "no-unsafe-finally": "error",
103
- "no-unsafe-negation": "error",
104
- "no-unsafe-optional-chaining": "error",
105
- "no-unused-expressions": "off",
106
- "no-unused-labels": "error",
107
- "no-unused-private-class-members": "error",
108
- "no-unused-vars": ["error", { fix: { imports: "safe-fix" } }],
109
- "no-useless-assignment": "error",
110
- "no-useless-backreference": "error",
111
- "no-useless-call": "error",
112
- "no-useless-catch": "error",
113
- "no-useless-computed-key": "error",
114
- "no-useless-concat": "error",
115
- "no-useless-escape": "error",
116
- "no-useless-rename": "error",
117
- "no-useless-return": "error",
118
- "no-var": "error",
119
- "no-void": ["error", { allowAsStatement: true }],
120
- "no-with": "error",
121
- "prefer-object-has-own": "error",
122
- "prefer-object-spread": "error",
123
- "prefer-template": "error",
124
- "preserve-caught-error": "error",
125
- "require-yield": "error",
126
- "symbol-description": "error",
127
- "use-isnan": "error",
128
- "valid-typeof": "error"
38
+ "eslint/array-callback-return": "error",
39
+ "eslint/constructor-super": "error",
40
+ "eslint/eqeqeq": "error",
41
+ "eslint/for-direction": "error",
42
+ "eslint/getter-return": "error",
43
+ "eslint/no-alert": "error",
44
+ "eslint/no-async-promise-executor": "error",
45
+ "eslint/no-await-in-loop": "error",
46
+ "eslint/no-case-declarations": "error",
47
+ "eslint/no-class-assign": "error",
48
+ "eslint/no-compare-neg-zero": "error",
49
+ "eslint/no-cond-assign": "error",
50
+ "eslint/no-const-assign": "error",
51
+ "eslint/no-constant-binary-expression": "error",
52
+ "eslint/no-constant-condition": "error",
53
+ "eslint/no-control-regex": "error",
54
+ "eslint/no-debugger": "error",
55
+ "eslint/no-delete-var": "error",
56
+ "eslint/no-dupe-class-members": "error",
57
+ "eslint/no-dupe-else-if": "error",
58
+ "eslint/no-dupe-keys": "error",
59
+ "eslint/no-duplicate-case": "error",
60
+ "eslint/no-empty": "error",
61
+ "eslint/no-empty-character-class": "error",
62
+ "eslint/no-empty-pattern": "error",
63
+ "eslint/no-empty-static-block": "error",
64
+ "eslint/no-eval": "error",
65
+ "eslint/no-ex-assign": "error",
66
+ "eslint/no-extra-bind": "error",
67
+ "eslint/no-extra-boolean-cast": "error",
68
+ "eslint/no-fallthrough": "error",
69
+ "eslint/no-func-assign": "error",
70
+ "eslint/no-global-assign": "error",
71
+ "eslint/no-import-assign": "error",
72
+ "eslint/no-invalid-regexp": "error",
73
+ "eslint/no-irregular-whitespace": "error",
74
+ "eslint/no-label-var": "error",
75
+ "eslint/no-labels": "error",
76
+ "eslint/no-lone-blocks": "error",
77
+ "eslint/no-loss-of-precision": "error",
78
+ "eslint/no-misleading-character-class": "error",
79
+ "eslint/no-new": "error",
80
+ "eslint/no-new-func": "error",
81
+ "eslint/no-new-native-nonconstructor": "error",
82
+ "eslint/no-nonoctal-decimal-escape": "error",
83
+ "eslint/no-obj-calls": "error",
84
+ "eslint/no-param-reassign": "error",
85
+ "eslint/no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
86
+ "eslint/no-promise-executor-return": "error",
87
+ "eslint/no-prototype-builtins": "error",
88
+ "eslint/no-redeclare": "error",
89
+ "eslint/no-regex-spaces": "error",
90
+ "eslint/no-return-assign": "error",
91
+ "eslint/no-script-url": "error",
92
+ "eslint/no-self-assign": "error",
93
+ "eslint/no-self-compare": "error",
94
+ "eslint/no-sequences": "error",
95
+ "eslint/no-setter-return": "error",
96
+ "eslint/no-shadow-restricted-names": "error",
97
+ "eslint/no-sparse-arrays": "error",
98
+ "eslint/no-template-curly-in-string": "error",
99
+ "eslint/no-this-before-super": "error",
100
+ "eslint/no-unassigned-vars": "error",
101
+ "eslint/no-undef": "error",
102
+ "eslint/no-unexpected-multiline": "error",
103
+ "eslint/no-unneeded-ternary": "error",
104
+ "eslint/no-unreachable": "error",
105
+ "eslint/no-unsafe-finally": "error",
106
+ "eslint/no-unsafe-negation": "error",
107
+ "eslint/no-unsafe-optional-chaining": "error",
108
+ "eslint/no-unused-labels": "error",
109
+ "eslint/no-unused-private-class-members": "error",
110
+ "eslint/no-unused-vars": ["error", { fix: { imports: "safe-fix" } }],
111
+ "eslint/no-useless-assignment": "error",
112
+ "eslint/no-useless-backreference": "error",
113
+ "eslint/no-useless-call": "error",
114
+ "eslint/no-useless-catch": "error",
115
+ "eslint/no-useless-computed-key": "error",
116
+ "eslint/no-useless-concat": "error",
117
+ "eslint/no-useless-escape": "error",
118
+ "eslint/no-useless-rename": "error",
119
+ "eslint/no-useless-return": "error",
120
+ "eslint/no-var": "error",
121
+ "eslint/no-void": ["error", { allowAsStatement: true }],
122
+ "eslint/no-with": "error",
123
+ "eslint/prefer-object-has-own": "error",
124
+ "eslint/prefer-object-spread": "error",
125
+ "eslint/prefer-template": "error",
126
+ "eslint/preserve-caught-error": "error",
127
+ "eslint/require-yield": "error",
128
+ "eslint/symbol-description": "error",
129
+ "eslint/use-isnan": "error",
130
+ "eslint/valid-typeof": "error"
129
131
  }
130
- }];
132
+ });
131
133
  //#endregion
132
134
  //#region src/configs/import-sort.ts
133
- const importSort = () => [{
135
+ const importSort = () => ({
134
136
  files: [GLOB_SRC],
135
137
  jsPlugins: [{
136
138
  name: "import-sort",
137
139
  specifier: "eslint-plugin-simple-import-sort"
138
140
  }],
139
141
  rules: {
142
+ "import-sort/exports": "error",
140
143
  "import-sort/imports": ["error", { groups: [
141
144
  ["^\\u0000"],
142
145
  [
@@ -154,13 +157,12 @@ const importSort = () => [{
154
157
  "^[^.]"
155
158
  ],
156
159
  ["^\\.\\.", "^\\."]
157
- ] }],
158
- "import-sort/exports": "error"
160
+ ] }]
159
161
  }
160
- }];
162
+ });
161
163
  //#endregion
162
164
  //#region src/configs/imports.ts
163
- const imports = () => [{
165
+ const imports = () => ({
164
166
  files: [GLOB_SRC],
165
167
  plugins: ["import"],
166
168
  rules: {
@@ -168,6 +170,7 @@ const imports = () => [{
168
170
  "import/default": "error",
169
171
  "import/export": "error",
170
172
  "import/first": "error",
173
+ "import/named": "off",
171
174
  "import/namespace": "error",
172
175
  "import/newline-after-import": ["error", { count: 1 }],
173
176
  "import/no-absolute-path": "error",
@@ -178,36 +181,31 @@ const imports = () => [{
178
181
  "import/no-dynamic-require": "error",
179
182
  "import/no-empty-named-blocks": "error",
180
183
  "import/no-mutable-exports": "error",
184
+ "import/no-named-as-default": "off",
185
+ "import/no-named-as-default-member": "off",
181
186
  "import/no-named-default": "error",
182
187
  "import/no-self-import": "error",
183
188
  "import/no-webpack-loader-syntax": "error"
184
189
  }
185
- }];
190
+ });
186
191
  //#endregion
187
192
  //#region src/configs/jsdoc.ts
188
- const jsdoc = () => [{
193
+ const jsdoc = () => ({
189
194
  files: [GLOB_SRC],
190
195
  plugins: ["jsdoc"],
191
196
  rules: {
192
- "jsdoc/check-property-names": "off",
193
197
  "jsdoc/check-tag-names": "error",
194
- "jsdoc/empty-tags": "error",
195
- "jsdoc/implements-on-classes": "off",
196
- "jsdoc/no-defaults": "off",
197
- "jsdoc/require-property": "off",
198
- "jsdoc/require-property-description": "off",
199
- "jsdoc/require-property-name": "off",
200
- "jsdoc/require-property-type": "off",
201
- "jsdoc/require-yields": "off"
198
+ "jsdoc/empty-tags": "error"
202
199
  }
203
- }];
200
+ });
204
201
  //#endregion
205
202
  //#region src/configs/jsx-a11y.ts
206
- const jsxA11y = () => [{
203
+ const jsxA11y = () => ({
207
204
  files: [GLOB_SRC],
208
205
  plugins: ["jsx-a11y"],
209
206
  rules: {
210
207
  "jsx-a11y/alt-text": "error",
208
+ "jsx-a11y/anchor-ambiguous-text": "off",
211
209
  "jsx-a11y/anchor-has-content": "error",
212
210
  "jsx-a11y/anchor-is-valid": ["error", {
213
211
  components: ["Link"],
@@ -225,7 +223,29 @@ const jsxA11y = () => [{
225
223
  "jsx-a11y/aria-unsupported-elements": "error",
226
224
  "jsx-a11y/autocomplete-valid": "error",
227
225
  "jsx-a11y/click-events-have-key-events": "error",
228
- "jsx-a11y/control-has-associated-label": "off",
226
+ "jsx-a11y/control-has-associated-label": ["off", {
227
+ ignoreElements: [
228
+ "audio",
229
+ "canvas",
230
+ "embed",
231
+ "input",
232
+ "textarea",
233
+ "tr",
234
+ "video"
235
+ ],
236
+ ignoreRoles: [
237
+ "grid",
238
+ "listbox",
239
+ "menu",
240
+ "menubar",
241
+ "radiogroup",
242
+ "row",
243
+ "tablist",
244
+ "toolbar",
245
+ "tree",
246
+ "treegrid"
247
+ ]
248
+ }],
229
249
  "jsx-a11y/heading-has-content": "error",
230
250
  "jsx-a11y/html-has-lang": "error",
231
251
  "jsx-a11y/iframe-has-title": "error",
@@ -325,16 +345,15 @@ const jsxA11y = () => [{
325
345
  "onKeyUp"
326
346
  ]
327
347
  }],
328
- "jsx-a11y/prefer-tag-over-role": "off",
329
348
  "jsx-a11y/role-has-required-aria-props": "error",
330
349
  "jsx-a11y/role-supports-aria-props": "error",
331
350
  "jsx-a11y/scope": "error",
332
351
  "jsx-a11y/tabindex-no-positive": "error"
333
352
  }
334
- }];
353
+ });
335
354
  //#endregion
336
355
  //#region src/configs/nelsonlaidev.ts
337
- const nelsonlaidev = () => [{
356
+ const nelsonlaidev = () => ({
338
357
  files: [GLOB_SRC],
339
358
  jsPlugins: [{
340
359
  name: "nelsonlaidev",
@@ -347,846 +366,54 @@ const nelsonlaidev = () => [{
347
366
  "nelsonlaidev/shadcn-cva-variants-suffix": "error",
348
367
  "nelsonlaidev/shadcn-prefer-spinner": "error"
349
368
  }
350
- }];
351
- //#endregion
352
- //#region src/configs/nextjs.ts
353
- const nextjs = () => [{
354
- files: [GLOB_SRC],
355
- plugins: ["nextjs"],
356
- rules: {
357
- "nextjs/google-font-display": "error",
358
- "nextjs/google-font-preconnect": "error",
359
- "nextjs/inline-script-id": "error",
360
- "nextjs/next-script-for-ga": "error",
361
- "nextjs/no-assign-module-variable": "error",
362
- "nextjs/no-async-client-component": "error",
363
- "nextjs/no-before-interactive-script-outside-document": "error",
364
- "nextjs/no-css-tags": "error",
365
- "nextjs/no-document-import-in-page": "error",
366
- "nextjs/no-duplicate-head": "error",
367
- "nextjs/no-head-element": "error",
368
- "nextjs/no-head-import-in-document": "error",
369
- "nextjs/no-html-link-for-pages": "error",
370
- "nextjs/no-img-element": "error",
371
- "nextjs/no-page-custom-font": "error",
372
- "nextjs/no-script-component-in-head": "error",
373
- "nextjs/no-styled-jsx-in-document": "error",
374
- "nextjs/no-sync-scripts": "error",
375
- "nextjs/no-title-in-document-head": "error",
376
- "nextjs/no-typos": "error",
377
- "nextjs/no-unwanted-polyfillio": "error"
378
- }
379
- }];
369
+ });
380
370
  //#endregion
381
371
  //#region src/configs/node.ts
382
- const node = () => [{
372
+ const node = () => ({
383
373
  files: [GLOB_SRC],
384
374
  plugins: ["node"],
385
375
  rules: {
386
376
  "node/no-exports-assign": "error",
387
377
  "node/no-path-concat": "error"
388
378
  }
389
- }];
379
+ });
390
380
  //#endregion
391
381
  //#region src/configs/oxc.ts
392
- const oxc = () => [{
382
+ const oxc = () => ({
393
383
  files: [GLOB_SRC],
394
384
  plugins: ["oxc"],
395
385
  rules: {
396
- "approx-constant": "error",
397
- "bad-array-method-on-arguments": "error",
398
- "bad-bitwise-operator": "error",
399
- "bad-char-at-comparison": "error",
400
- "bad-comparison-sequence": "error",
401
- "bad-min-max-func": "error",
402
- "bad-object-literal-comparison": "error",
403
- "bad-replace-all-arg": "error",
404
- "const-comparisons": "error",
405
- "double-comparisons": "error",
406
- "erasing-op": "error",
407
- "misrefactored-assign-op": "error",
408
- "missing-throw": "error",
409
- "no-accumulating-spread": "error",
410
- "no-async-endpoint-handlers": "error",
411
- "no-barrel-file": "error",
412
- "no-const-enum": "error",
413
- "no-this-in-exported-function": "error",
414
- "number-arg-out-of-range": "error",
415
- "only-used-in-recursion": "error",
416
- "uninvoked-array-callback": "error"
417
- }
418
- }];
419
- //#endregion
420
- //#region src/generated/plugin-snapshots.ts
421
- const reactHooksRecommendedLatestRules = {
422
- "react-hooks/rules-of-hooks": "error",
423
- "react-hooks/exhaustive-deps": "warn",
424
- "react-hooks/static-components": "error",
425
- "react-hooks/use-memo": "error",
426
- "react-hooks/void-use-memo": "error",
427
- "react-hooks/preserve-manual-memoization": "error",
428
- "react-hooks/incompatible-library": "warn",
429
- "react-hooks/immutability": "error",
430
- "react-hooks/globals": "error",
431
- "react-hooks/refs": "error",
432
- "react-hooks/set-state-in-effect": "error",
433
- "react-hooks/error-boundaries": "error",
434
- "react-hooks/purity": "error",
435
- "react-hooks/set-state-in-render": "error",
436
- "react-hooks/unsupported-syntax": "warn",
437
- "react-hooks/config": "error",
438
- "react-hooks/gating": "error"
439
- };
440
- const reactAllRules = {
441
- "@eslint-react/component-hook-factories": "error",
442
- "@eslint-react/error-boundaries": "error",
443
- "@eslint-react/exhaustive-deps": "warn",
444
- "@eslint-react/immutability": "error",
445
- "@eslint-react/no-access-state-in-setstate": "error",
446
- "@eslint-react/no-array-index-key": "warn",
447
- "@eslint-react/no-children-count": "warn",
448
- "@eslint-react/no-children-for-each": "warn",
449
- "@eslint-react/no-children-map": "warn",
450
- "@eslint-react/no-children-only": "warn",
451
- "@eslint-react/no-children-to-array": "warn",
452
- "@eslint-react/no-class-component": "warn",
453
- "@eslint-react/no-clone-element": "warn",
454
- "@eslint-react/no-component-will-mount": "error",
455
- "@eslint-react/no-component-will-receive-props": "error",
456
- "@eslint-react/no-component-will-update": "error",
457
- "@eslint-react/no-context-provider": "warn",
458
- "@eslint-react/no-create-ref": "error",
459
- "@eslint-react/no-direct-mutation-state": "error",
460
- "@eslint-react/no-duplicate-key": "error",
461
- "@eslint-react/no-forward-ref": "warn",
462
- "@eslint-react/no-missing-component-display-name": "warn",
463
- "@eslint-react/no-missing-context-display-name": "warn",
464
- "@eslint-react/no-missing-key": "error",
465
- "@eslint-react/no-misused-capture-owner-stack": "error",
466
- "@eslint-react/no-nested-component-definitions": "error",
467
- "@eslint-react/no-nested-lazy-component-declarations": "error",
468
- "@eslint-react/no-redundant-should-component-update": "error",
469
- "@eslint-react/no-set-state-in-component-did-mount": "warn",
470
- "@eslint-react/no-set-state-in-component-did-update": "warn",
471
- "@eslint-react/no-set-state-in-component-will-update": "warn",
472
- "@eslint-react/no-unnecessary-use-callback": "warn",
473
- "@eslint-react/no-unnecessary-use-memo": "warn",
474
- "@eslint-react/no-unnecessary-use-prefix": "warn",
475
- "@eslint-react/no-unsafe-component-will-mount": "warn",
476
- "@eslint-react/no-unsafe-component-will-receive-props": "warn",
477
- "@eslint-react/no-unsafe-component-will-update": "warn",
478
- "@eslint-react/no-unstable-context-value": "warn",
479
- "@eslint-react/no-unstable-default-props": "warn",
480
- "@eslint-react/no-unused-class-component-members": "warn",
481
- "@eslint-react/no-unused-state": "warn",
482
- "@eslint-react/no-use-context": "warn",
483
- "@eslint-react/prefer-destructuring-assignment": "warn",
484
- "@eslint-react/prefer-namespace-import": "warn",
485
- "@eslint-react/purity": "warn",
486
- "@eslint-react/refs": "error",
487
- "@eslint-react/rules-of-hooks": "error",
488
- "@eslint-react/set-state-in-effect": "warn",
489
- "@eslint-react/set-state-in-render": "error",
490
- "@eslint-react/unsupported-syntax": "error",
491
- "@eslint-react/use-memo": "error",
492
- "@eslint-react/use-state": "warn",
493
- "@eslint-react/jsx-no-children-prop": "warn",
494
- "@eslint-react/jsx-no-children-prop-with-children": "error",
495
- "@eslint-react/jsx-no-comment-textnodes": "warn",
496
- "@eslint-react/jsx-no-deoptimization": "error",
497
- "@eslint-react/jsx-no-namespace": "error",
498
- "@eslint-react/jsx-no-useless-fragment": "warn",
499
- "@eslint-react/rsc-function-definition": "error",
500
- "@eslint-react/dom-no-dangerously-set-innerhtml": "warn",
501
- "@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
502
- "@eslint-react/dom-no-find-dom-node": "error",
503
- "@eslint-react/dom-no-flush-sync": "error",
504
- "@eslint-react/dom-no-hydrate": "error",
505
- "@eslint-react/dom-no-missing-button-type": "warn",
506
- "@eslint-react/dom-no-missing-iframe-sandbox": "warn",
507
- "@eslint-react/dom-no-render": "error",
508
- "@eslint-react/dom-no-render-return-value": "error",
509
- "@eslint-react/dom-no-script-url": "warn",
510
- "@eslint-react/dom-no-string-style-prop": "error",
511
- "@eslint-react/dom-no-unknown-property": "warn",
512
- "@eslint-react/dom-no-unsafe-iframe-sandbox": "warn",
513
- "@eslint-react/dom-no-unsafe-target-blank": "warn",
514
- "@eslint-react/dom-no-use-form-state": "warn",
515
- "@eslint-react/dom-no-void-elements-with-children": "error",
516
- "@eslint-react/dom-prefer-namespace-import": "warn",
517
- "@eslint-react/web-api-no-leaked-event-listener": "warn",
518
- "@eslint-react/web-api-no-leaked-interval": "warn",
519
- "@eslint-react/web-api-no-leaked-resize-observer": "warn",
520
- "@eslint-react/web-api-no-leaked-timeout": "warn",
521
- "@eslint-react/naming-convention-context-name": "warn",
522
- "@eslint-react/naming-convention-id-name": "warn",
523
- "@eslint-react/naming-convention-ref-name": "warn"
524
- };
525
- const reactDisableConflictReactHooksRules = {
526
- "react-hooks/exhaustive-deps": "off",
527
- "react-hooks/rules-of-hooks": "off",
528
- "react-hooks/component-hook-factories": "off",
529
- "react-hooks/error-boundaries": "off",
530
- "react-hooks/immutability": "off",
531
- "react-hooks/purity": "off",
532
- "react-hooks/refs": "off",
533
- "react-hooks/set-state-in-effect": "off",
534
- "react-hooks/set-state-in-render": "off",
535
- "react-hooks/static-components": "off",
536
- "react-hooks/unsupported-syntax": "off",
537
- "react-hooks/use-memo": "off"
538
- };
539
- const playwrightRecommendedRules = {
540
- "no-empty-pattern": "off",
541
- "playwright/consistent-spacing-between-blocks": "warn",
542
- "playwright/expect-expect": "warn",
543
- "playwright/max-nested-describe": "warn",
544
- "playwright/missing-playwright-await": "error",
545
- "playwright/no-conditional-expect": "warn",
546
- "playwright/no-conditional-in-test": "warn",
547
- "playwright/no-duplicate-hooks": "warn",
548
- "playwright/no-duplicate-slow": "warn",
549
- "playwright/no-element-handle": "warn",
550
- "playwright/no-eval": "warn",
551
- "playwright/no-focused-test": "error",
552
- "playwright/no-force-option": "warn",
553
- "playwright/no-nested-step": "warn",
554
- "playwright/no-networkidle": "error",
555
- "playwright/no-page-pause": "warn",
556
- "playwright/no-skipped-test": "warn",
557
- "playwright/no-standalone-expect": "error",
558
- "playwright/no-unsafe-references": "error",
559
- "playwright/no-unused-locators": "error",
560
- "playwright/no-useless-await": "warn",
561
- "playwright/no-useless-not": "warn",
562
- "playwright/no-wait-for-navigation": "error",
563
- "playwright/no-wait-for-selector": "warn",
564
- "playwright/no-wait-for-timeout": "warn",
565
- "playwright/prefer-hooks-in-order": "warn",
566
- "playwright/prefer-hooks-on-top": "warn",
567
- "playwright/prefer-locator": "warn",
568
- "playwright/prefer-to-have-count": "warn",
569
- "playwright/prefer-to-have-length": "warn",
570
- "playwright/prefer-web-first-assertions": "error",
571
- "playwright/valid-describe-callback": "error",
572
- "playwright/valid-expect": "error",
573
- "playwright/valid-expect-in-promise": "error",
574
- "playwright/valid-test-tags": "error",
575
- "playwright/valid-title": "error"
576
- };
577
- const regexpRecommendedRules = {
578
- "no-control-regex": "error",
579
- "no-misleading-character-class": "error",
580
- "no-regex-spaces": "error",
581
- "prefer-regex-literals": "error",
582
- "no-invalid-regexp": "off",
583
- "no-useless-backreference": "off",
584
- "no-empty-character-class": "off",
585
- "regexp/confusing-quantifier": "warn",
586
- "regexp/control-character-escape": "error",
587
- "regexp/match-any": "error",
588
- "regexp/negation": "error",
589
- "regexp/no-contradiction-with-assertion": "error",
590
- "regexp/no-dupe-characters-character-class": "error",
591
- "regexp/no-dupe-disjunctions": "error",
592
- "regexp/no-empty-alternative": "warn",
593
- "regexp/no-empty-capturing-group": "error",
594
- "regexp/no-empty-character-class": "error",
595
- "regexp/no-empty-group": "error",
596
- "regexp/no-empty-lookarounds-assertion": "error",
597
- "regexp/no-empty-string-literal": "error",
598
- "regexp/no-escape-backspace": "error",
599
- "regexp/no-extra-lookaround-assertions": "error",
600
- "regexp/no-invalid-regexp": "error",
601
- "regexp/no-invisible-character": "error",
602
- "regexp/no-lazy-ends": "warn",
603
- "regexp/no-legacy-features": "error",
604
- "regexp/no-misleading-capturing-group": "error",
605
- "regexp/no-misleading-unicode-character": "error",
606
- "regexp/no-missing-g-flag": "error",
607
- "regexp/no-non-standard-flag": "error",
608
- "regexp/no-obscure-range": "error",
609
- "regexp/no-optional-assertion": "error",
610
- "regexp/no-potentially-useless-backreference": "warn",
611
- "regexp/no-super-linear-backtracking": "error",
612
- "regexp/no-trivially-nested-assertion": "error",
613
- "regexp/no-trivially-nested-quantifier": "error",
614
- "regexp/no-unused-capturing-group": "error",
615
- "regexp/no-useless-assertions": "error",
616
- "regexp/no-useless-backreference": "error",
617
- "regexp/no-useless-character-class": "error",
618
- "regexp/no-useless-dollar-replacements": "error",
619
- "regexp/no-useless-escape": "error",
620
- "regexp/no-useless-flag": "warn",
621
- "regexp/no-useless-lazy": "error",
622
- "regexp/no-useless-non-capturing-group": "error",
623
- "regexp/no-useless-quantifier": "error",
624
- "regexp/no-useless-range": "error",
625
- "regexp/no-useless-set-operand": "error",
626
- "regexp/no-useless-string-literal": "error",
627
- "regexp/no-useless-two-nums-quantifier": "error",
628
- "regexp/no-zero-quantifier": "error",
629
- "regexp/optimal-lookaround-quantifier": "warn",
630
- "regexp/optimal-quantifier-concatenation": "error",
631
- "regexp/prefer-character-class": "error",
632
- "regexp/prefer-d": "error",
633
- "regexp/prefer-plus-quantifier": "error",
634
- "regexp/prefer-predefined-assertion": "error",
635
- "regexp/prefer-question-quantifier": "error",
636
- "regexp/prefer-range": "error",
637
- "regexp/prefer-set-operation": "error",
638
- "regexp/prefer-star-quantifier": "error",
639
- "regexp/prefer-unicode-codepoint-escapes": "error",
640
- "regexp/prefer-w": "error",
641
- "regexp/simplify-set-operations": "error",
642
- "regexp/sort-flags": "error",
643
- "regexp/strict": "error",
644
- "regexp/use-ignore-case": "error"
645
- };
646
- const sonarjsRecommendedRules = {
647
- "sonarjs/function-name": "off",
648
- "sonarjs/class-name": "error",
649
- "sonarjs/max-lines": "off",
650
- "sonarjs/no-tab": "off",
651
- "sonarjs/variable-name": "off",
652
- "sonarjs/comment-regex": "off",
653
- "sonarjs/no-commented-code": "off",
654
- "sonarjs/elseif-without-else": "off",
655
- "sonarjs/no-fallthrough": "error",
656
- "sonarjs/nested-control-flow": "off",
657
- "sonarjs/too-many-break-or-continue-in-loop": "off",
658
- "sonarjs/max-lines-per-function": "off",
659
- "sonarjs/no-nested-incdec": "off",
660
- "sonarjs/no-equals-in-for-termination": "error",
661
- "sonarjs/no-extra-arguments": "error",
662
- "sonarjs/no-collapsible-if": "off",
663
- "sonarjs/expression-complexity": "off",
664
- "sonarjs/no-redundant-parentheses": "off",
665
- "sonarjs/no-labels": "error",
666
- "sonarjs/no-nested-assignment": "error",
667
- "sonarjs/no-redundant-boolean": "error",
668
- "sonarjs/prefer-single-boolean-return": "error",
669
- "sonarjs/unused-import": "error",
670
- "sonarjs/fixme-tag": "error",
671
- "sonarjs/todo-tag": "error",
672
- "sonarjs/useless-string-operation": "off",
673
- "sonarjs/no-unused-function-argument": "off",
674
- "sonarjs/no-duplicate-string": "off",
675
- "sonarjs/no-case-label-in-switch": "error",
676
- "sonarjs/no-parameter-reassignment": "error",
677
- "sonarjs/no-floating-point-equality": "error",
678
- "sonarjs/prefer-while": "error",
679
- "sonarjs/no-sonar-comments": "off",
680
- "sonarjs/no-small-switch": "error",
681
- "sonarjs/no-hardcoded-ip": "error",
682
- "sonarjs/label-position": "error",
683
- "sonarjs/public-static-readonly": "error",
684
- "sonarjs/file-header": "off",
685
- "sonarjs/call-argument-line": "error",
686
- "sonarjs/max-switch-cases": "error",
687
- "sonarjs/no-unused-vars": "error",
688
- "sonarjs/prefer-immediate-return": "off",
689
- "sonarjs/function-inside-loop": "error",
690
- "sonarjs/code-eval": "error",
691
- "sonarjs/no-variable-usage-before-declaration": "off",
692
- "sonarjs/future-reserved-words": "error",
693
- "sonarjs/array-constructor": "off",
694
- "sonarjs/bitwise-operators": "error",
695
- "sonarjs/no-function-declaration-in-block": "off",
696
- "sonarjs/no-primitive-wrappers": "error",
697
- "sonarjs/for-in": "off",
698
- "sonarjs/cyclomatic-complexity": "off",
699
- "sonarjs/no-skipped-tests": "error",
700
- "sonarjs/no-identical-expressions": "error",
701
- "sonarjs/no-nested-switch": "off",
702
- "sonarjs/constructor-for-side-effects": "error",
703
- "sonarjs/no-dead-store": "error",
704
- "sonarjs/no-identical-conditions": "error",
705
- "sonarjs/no-duplicated-branches": "error",
706
- "sonarjs/deprecation": "error",
707
- "sonarjs/no-inverted-boolean-check": "error",
708
- "sonarjs/misplaced-loop-counter": "error",
709
- "sonarjs/no-nested-functions": "error",
710
- "sonarjs/no-hardcoded-passwords": "error",
711
- "sonarjs/sql-queries": "error",
712
- "sonarjs/insecure-cookie": "error",
713
- "sonarjs/no-useless-increment": "error",
714
- "sonarjs/no-globals-shadowing": "error",
715
- "sonarjs/no-undefined-assignment": "off",
716
- "sonarjs/no-empty-test-file": "error",
717
- "sonarjs/no-ignored-return": "error",
718
- "sonarjs/no-wildcard-import": "off",
719
- "sonarjs/arguments-order": "error",
720
- "sonarjs/pseudo-random": "error",
721
- "sonarjs/for-loop-increment-sign": "error",
722
- "sonarjs/null-dereference": "error",
723
- "sonarjs/no-selector-parameter": "error",
724
- "sonarjs/updated-loop-counter": "error",
725
- "sonarjs/block-scoped-var": "error",
726
- "sonarjs/no-built-in-override": "off",
727
- "sonarjs/prefer-object-literal": "off",
728
- "sonarjs/no-ignored-exceptions": "error",
729
- "sonarjs/no-gratuitous-expressions": "error",
730
- "sonarjs/file-uploads": "error",
731
- "sonarjs/file-permissions": "error",
732
- "sonarjs/no-empty-character-class": "error",
733
- "sonarjs/no-unenclosed-multiline-block": "error",
734
- "sonarjs/index-of-compare-to-positive-number": "error",
735
- "sonarjs/assertions-in-tests": "error",
736
- "sonarjs/no-implicit-global": "error",
737
- "sonarjs/no-useless-catch": "error",
738
- "sonarjs/xml-parser-xxe": "error",
739
- "sonarjs/non-existent-operator": "error",
740
- "sonarjs/web-sql-database": "off",
741
- "sonarjs/post-message": "error",
742
- "sonarjs/no-array-delete": "error",
743
- "sonarjs/no-alphabetical-sort": "error",
744
- "sonarjs/no-incomplete-assertions": "error",
745
- "sonarjs/no-global-this": "error",
746
- "sonarjs/new-operator-misuse": "error",
747
- "sonarjs/no-delete-var": "error",
748
- "sonarjs/strings-comparison": "off",
749
- "sonarjs/file-name-differ-from-class": "off",
750
- "sonarjs/cookie-no-httponly": "error",
751
- "sonarjs/no-nested-conditional": "error",
752
- "sonarjs/no-incorrect-string-concat": "off",
753
- "sonarjs/different-types-comparison": "error",
754
- "sonarjs/inverted-assertion-arguments": "error",
755
- "sonarjs/shorthand-property-grouping": "off",
756
- "sonarjs/updated-const-var": "error",
757
- "sonarjs/arguments-usage": "off",
758
- "sonarjs/destructuring-assignment-syntax": "off",
759
- "sonarjs/no-invariant-returns": "error",
760
- "sonarjs/arrow-function-convention": "off",
761
- "sonarjs/class-prototype": "off",
762
- "sonarjs/generator-without-yield": "error",
763
- "sonarjs/no-require-or-define": "off",
764
- "sonarjs/no-associative-arrays": "error",
765
- "sonarjs/comma-or-logical-or-case": "error",
766
- "sonarjs/no-redundant-jump": "error",
767
- "sonarjs/inconsistent-function-call": "error",
768
- "sonarjs/no-use-of-empty-return-value": "error",
769
- "sonarjs/void-use": "error",
770
- "sonarjs/operation-returning-nan": "off",
771
- "sonarjs/values-not-convertible-to-numbers": "off",
772
- "sonarjs/non-number-in-arithmetic-expression": "off",
773
- "sonarjs/cognitive-complexity": "error",
774
- "sonarjs/argument-type": "error",
775
- "sonarjs/in-operator-type-error": "error",
776
- "sonarjs/array-callback-without-return": "error",
777
- "sonarjs/declarations-in-global-scope": "off",
778
- "sonarjs/function-return-type": "error",
779
- "sonarjs/no-inconsistent-returns": "off",
780
- "sonarjs/no-reference-error": "off",
781
- "sonarjs/no-all-duplicated-branches": "error",
782
- "sonarjs/no-same-line-conditional": "error",
783
- "sonarjs/conditional-indentation": "off",
784
- "sonarjs/no-collection-size-mischeck": "error",
785
- "sonarjs/no-unthrown-error": "error",
786
- "sonarjs/no-unused-collection": "error",
787
- "sonarjs/no-os-command-from-path": "error",
788
- "sonarjs/no-misleading-array-reverse": "error",
789
- "sonarjs/no-for-in-iterable": "off",
790
- "sonarjs/no-element-overwrite": "error",
791
- "sonarjs/no-identical-functions": "error",
792
- "sonarjs/no-empty-collection": "error",
793
- "sonarjs/no-redundant-assignments": "error",
794
- "sonarjs/prefer-type-guard": "error",
795
- "sonarjs/use-type-alias": "error",
796
- "sonarjs/no-return-type-any": "off",
797
- "sonarjs/no-implicit-dependencies": "off",
798
- "sonarjs/no-useless-intersection": "error",
799
- "sonarjs/weak-ssl": "error",
800
- "sonarjs/no-weak-keys": "error",
801
- "sonarjs/csrf": "error",
802
- "sonarjs/production-debug": "error",
803
- "sonarjs/prefer-default-last": "error",
804
- "sonarjs/no-in-misuse": "error",
805
- "sonarjs/no-duplicate-in-composite": "error",
806
- "sonarjs/max-union-size": "off",
807
- "sonarjs/no-undefined-argument": "error",
808
- "sonarjs/no-nested-template-literals": "error",
809
- "sonarjs/prefer-promise-shorthand": "error",
810
- "sonarjs/os-command": "off",
811
- "sonarjs/no-redundant-optional": "error",
812
- "sonarjs/hashing": "error",
813
- "sonarjs/bool-param-default": "off",
814
- "sonarjs/no-try-promise": "error",
815
- "sonarjs/unverified-certificate": "error",
816
- "sonarjs/no-unsafe-unzip": "off",
817
- "sonarjs/cors": "error",
818
- "sonarjs/link-with-target-blank": "error",
819
- "sonarjs/disabled-auto-escaping": "error",
820
- "sonarjs/table-header": "error",
821
- "sonarjs/no-table-as-layout": "error",
822
- "sonarjs/table-header-reference": "error",
823
- "sonarjs/object-alt-content": "error",
824
- "sonarjs/no-clear-text-protocols": "error",
825
- "sonarjs/publicly-writable-directories": "error",
826
- "sonarjs/unverified-hostname": "error",
827
- "sonarjs/encryption-secure-mode": "error",
828
- "sonarjs/no-weak-cipher": "error",
829
- "sonarjs/no-intrusive-permissions": "off",
830
- "sonarjs/insecure-jwt-token": "error",
831
- "sonarjs/x-powered-by": "error",
832
- "sonarjs/hidden-files": "off",
833
- "sonarjs/content-length": "error",
834
- "sonarjs/disabled-resource-integrity": "error",
835
- "sonarjs/content-security-policy": "error",
836
- "sonarjs/no-mixed-content": "off",
837
- "sonarjs/frame-ancestors": "off",
838
- "sonarjs/no-mime-sniff": "error",
839
- "sonarjs/no-referrer-policy": "error",
840
- "sonarjs/strict-transport-security": "error",
841
- "sonarjs/confidential-information-logging": "off",
842
- "sonarjs/no-ip-forward": "off",
843
- "sonarjs/empty-string-repetition": "error",
844
- "sonarjs/regex-complexity": "error",
845
- "sonarjs/no-incompatible-assertion-types": "error",
846
- "sonarjs/anchor-precedence": "error",
847
- "sonarjs/slow-regex": "error",
848
- "sonarjs/no-invalid-regexp": "error",
849
- "sonarjs/unused-named-groups": "error",
850
- "sonarjs/no-same-argument-assert": "error",
851
- "sonarjs/unicode-aware-regex": "off",
852
- "sonarjs/no-misleading-character-class": "error",
853
- "sonarjs/duplicates-in-character-class": "error",
854
- "sonarjs/session-regeneration": "error",
855
- "sonarjs/prefer-specific-assertions": "error",
856
- "sonarjs/no-trivial-assertions": "error",
857
- "sonarjs/test-check-exception": "error",
858
- "sonarjs/stable-tests": "error",
859
- "sonarjs/no-empty-after-reluctant": "error",
860
- "sonarjs/single-character-alternation": "error",
861
- "sonarjs/no-code-after-done": "error",
862
- "sonarjs/disabled-timeout": "error",
863
- "sonarjs/chai-determinate-assertion": "error",
864
- "sonarjs/aws-s3-bucket-insecure-http": "error",
865
- "sonarjs/aws-s3-bucket-versioning": "error",
866
- "sonarjs/aws-s3-bucket-granted-access": "error",
867
- "sonarjs/no-angular-bypass-sanitization": "error",
868
- "sonarjs/aws-iam-public-access": "error",
869
- "sonarjs/aws-ec2-unencrypted-ebs-volume": "error",
870
- "sonarjs/aws-s3-bucket-public-access": "error",
871
- "sonarjs/aws-iam-all-privileges": "error",
872
- "sonarjs/aws-rds-unencrypted-databases": "error",
873
- "sonarjs/aws-iam-all-resources-accessible": "off",
874
- "sonarjs/aws-opensearchservice-domain": "error",
875
- "sonarjs/aws-iam-privilege-escalation": "error",
876
- "sonarjs/aws-sagemaker-unencrypted-notebook": "error",
877
- "sonarjs/aws-restricted-ip-admin-access": "error",
878
- "sonarjs/no-empty-alternatives": "error",
879
- "sonarjs/no-control-regex": "error",
880
- "sonarjs/no-regex-spaces": "error",
881
- "sonarjs/aws-sns-unencrypted-topics": "error",
882
- "sonarjs/existing-groups": "error",
883
- "sonarjs/aws-ec2-rds-dms-public": "error",
884
- "sonarjs/aws-sqs-unencrypted-queue": "error",
885
- "sonarjs/no-empty-group": "error",
886
- "sonarjs/aws-efs-unencrypted": "error",
887
- "sonarjs/aws-apigateway-public-api": "error",
888
- "sonarjs/stateful-regex": "error",
889
- "sonarjs/concise-regex": "error",
890
- "sonarjs/single-char-in-character-classes": "error",
891
- "sonarjs/no-hardcoded-secrets": "error",
892
- "sonarjs/no-exclusive-tests": "error",
893
- "sonarjs/hardcoded-secret-signatures": "error",
894
- "sonarjs/jsx-no-leaked-render": "error",
895
- "sonarjs/no-hook-setter-in-body": "error",
896
- "sonarjs/no-useless-react-setstate": "error",
897
- "sonarjs/no-uniq-key": "error",
898
- "sonarjs/redundant-type-aliases": "error",
899
- "sonarjs/prefer-regexp-exec": "error",
900
- "sonarjs/no-internal-api-use": "error",
901
- "sonarjs/prefer-read-only-props": "error",
902
- "sonarjs/no-literal-call": "error",
903
- "sonarjs/reduce-initial-value": "error",
904
- "sonarjs/no-async-constructor": "error",
905
- "sonarjs/review-blockchain-mnemonic": "error",
906
- "sonarjs/dynamically-constructed-templates": "error",
907
- "sonarjs/no-session-cookies-on-static-assets": "error",
908
- "sonarjs/dompurify-unsafe-config": "error",
909
- "sonarjs/no-duplicate-test-title": "error",
910
- "sonarjs/async-test-assertions": "error",
911
- "sonarjs/no-empty-test-title": "error",
912
- "sonarjs/hooks-before-test-cases": "error",
913
- "sonarjs/no-forced-browser-interaction": "error",
914
- "sonarjs/super-linear-regex": "error"
915
- };
916
- const betterTailwindcssDefaultSelectors = [
917
- {
918
- kind: "attribute",
919
- name: "^class(?:Name)?$"
920
- },
921
- {
922
- kind: "attribute",
923
- match: [{ type: "strings" }],
924
- name: "^class(?:Name)?$"
925
- },
926
- {
927
- kind: "attribute",
928
- match: [{ type: "strings" }],
929
- name: "^class:.*$"
930
- },
931
- {
932
- kind: "attribute",
933
- name: "(?:^\\[class\\]$)|(?:^\\[ngClass\\]$)"
934
- },
935
- {
936
- kind: "attribute",
937
- match: [{ type: "strings" }],
938
- name: "(?:^\\[class\\..*\\]$)"
939
- },
940
- {
941
- kind: "attribute",
942
- match: [{ type: "strings" }, { type: "objectKeys" }],
943
- name: "(?:^\\[class\\]$)|(?:^\\[ngClass\\]$)"
944
- },
945
- {
946
- kind: "attribute",
947
- match: [{ type: "strings" }, { type: "objectKeys" }],
948
- name: "^v-bind:class$"
949
- },
950
- {
951
- kind: "attribute",
952
- match: [{ type: "strings" }, { type: "objectKeys" }],
953
- name: "^class:list$"
954
- },
955
- {
956
- kind: "attribute",
957
- match: [{ type: "objectKeys" }],
958
- name: "^classList$"
959
- },
960
- {
961
- kind: "callee",
962
- match: [{ type: "strings" }],
963
- name: "^cc$"
964
- },
965
- {
966
- kind: "callee",
967
- match: [{ type: "objectKeys" }],
968
- name: "^cc$"
969
- },
970
- {
971
- kind: "callee",
972
- match: [{
973
- path: "^base$",
974
- type: "objectValues"
975
- }],
976
- name: "^clb$"
977
- },
978
- {
979
- kind: "callee",
980
- match: [{
981
- path: "^variants.*$",
982
- type: "objectValues"
983
- }],
984
- name: "^clb$"
985
- },
986
- {
987
- kind: "callee",
988
- match: [{
989
- path: "^compoundVariants\\[\\d+\\]\\.classes$",
990
- type: "objectValues"
991
- }],
992
- name: "^clb$"
993
- },
994
- {
995
- kind: "callee",
996
- match: [{ type: "strings" }],
997
- name: "^clsx$"
998
- },
999
- {
1000
- kind: "callee",
1001
- match: [{ type: "objectKeys" }],
1002
- name: "^clsx$"
1003
- },
1004
- {
1005
- kind: "callee",
1006
- match: [{ type: "strings" }],
1007
- name: "^cn$"
1008
- },
1009
- {
1010
- kind: "callee",
1011
- match: [{ type: "objectKeys" }],
1012
- name: "^cn$"
1013
- },
1014
- {
1015
- kind: "callee",
1016
- match: [{ type: "strings" }],
1017
- name: "^cnb$"
1018
- },
1019
- {
1020
- kind: "callee",
1021
- match: [{ type: "objectKeys" }],
1022
- name: "^cnb$"
1023
- },
1024
- {
1025
- kind: "callee",
1026
- match: [{ type: "strings" }],
1027
- name: "^ctl$"
1028
- },
1029
- {
1030
- kind: "callee",
1031
- match: [{ type: "strings" }],
1032
- name: "^cva$"
1033
- },
1034
- {
1035
- kind: "callee",
1036
- match: [{
1037
- path: "^variants.*$",
1038
- type: "objectValues"
1039
- }],
1040
- name: "^cva$"
1041
- },
1042
- {
1043
- kind: "callee",
1044
- match: [{
1045
- path: "^compoundVariants\\[\\d+\\]\\.(?:className|class)$",
1046
- type: "objectValues"
1047
- }],
1048
- name: "^cva$"
1049
- },
1050
- {
1051
- kind: "callee",
1052
- match: [{ type: "strings" }],
1053
- name: "^cx$"
1054
- },
1055
- {
1056
- kind: "callee",
1057
- match: [{ type: "objectKeys" }],
1058
- name: "^cx$"
1059
- },
1060
- {
1061
- kind: "callee",
1062
- match: [{ type: "strings" }],
1063
- name: "^dcnb$"
1064
- },
1065
- {
1066
- kind: "callee",
1067
- match: [{ type: "objectKeys" }],
1068
- name: "^dcnb$"
1069
- },
1070
- {
1071
- kind: "callee",
1072
- match: [{ type: "objectKeys" }],
1073
- name: "^objstr$"
1074
- },
1075
- {
1076
- kind: "callee",
1077
- match: [{ type: "strings" }],
1078
- name: "^tv$"
1079
- },
1080
- {
1081
- kind: "callee",
1082
- match: [{
1083
- path: "^variants.*$",
1084
- type: "objectValues"
1085
- }],
1086
- name: "^tv$"
1087
- },
1088
- {
1089
- kind: "callee",
1090
- match: [{
1091
- path: "^compoundVariants\\[\\d+\\]\\.(?:className|class).*$",
1092
- type: "objectValues"
1093
- }],
1094
- name: "^tv$"
1095
- },
1096
- {
1097
- kind: "callee",
1098
- match: [{
1099
- path: "^base$",
1100
- type: "objectValues"
1101
- }],
1102
- name: "^tv$"
1103
- },
1104
- {
1105
- kind: "callee",
1106
- match: [{
1107
- path: "^slots.*$",
1108
- type: "objectValues"
1109
- }],
1110
- name: "^tv$"
1111
- },
1112
- {
1113
- kind: "callee",
1114
- match: [{
1115
- path: "^compoundSlots\\[\\d+\\]\\.(?:className|class).*$",
1116
- type: "objectValues"
1117
- }],
1118
- name: "^tv$"
1119
- },
1120
- {
1121
- kind: "callee",
1122
- match: [{ type: "strings" }],
1123
- name: "^twJoin$"
1124
- },
1125
- {
1126
- kind: "callee",
1127
- match: [{ type: "strings" }],
1128
- name: "^twMerge$"
1129
- },
1130
- {
1131
- kind: "variable",
1132
- match: [{ type: "strings" }],
1133
- name: "^classNames?$"
1134
- },
1135
- {
1136
- kind: "variable",
1137
- match: [{ type: "strings" }],
1138
- name: "^classes$"
1139
- },
1140
- {
1141
- kind: "variable",
1142
- match: [{ type: "strings" }],
1143
- name: "^styles?$"
1144
- },
1145
- {
1146
- kind: "tag",
1147
- path: "twc(\\.\\w+)?"
1148
- },
1149
- {
1150
- kind: "callee",
1151
- match: [{ type: "strings" }, {
1152
- match: [{ type: "strings" }],
1153
- type: "anonymousFunctionReturn"
1154
- }],
1155
- path: "^twc\\.\\w+"
1156
- },
1157
- {
1158
- kind: "tag",
1159
- path: "twx(\\.\\w+)?"
1160
- },
1161
- {
1162
- kind: "callee",
1163
- match: [{ type: "strings" }, {
1164
- match: [{ type: "strings" }],
1165
- type: "anonymousFunctionReturn"
1166
- }],
1167
- path: "^twx\\.\\w+"
1168
- }
1169
- ];
1170
- //#endregion
1171
- //#region src/configs/playwright.ts
1172
- const playwright = (config) => [{
1173
- files: config.files,
1174
- jsPlugins: ["eslint-plugin-playwright"],
1175
- rules: {
1176
- ...playwrightRecommendedRules,
1177
- "playwright/expect-expect": ["error", {
1178
- assertFunctionNames: config.assertFunctionNames ?? [],
1179
- assertFunctionPatterns: config.assertFunctionPatterns ?? []
1180
- }]
386
+ "oxc/approx-constant": "error",
387
+ "oxc/bad-array-method-on-arguments": "error",
388
+ "oxc/bad-bitwise-operator": "error",
389
+ "oxc/bad-char-at-comparison": "error",
390
+ "oxc/bad-comparison-sequence": "error",
391
+ "oxc/bad-min-max-func": "error",
392
+ "oxc/bad-object-literal-comparison": "error",
393
+ "oxc/bad-replace-all-arg": "error",
394
+ "oxc/const-comparisons": "error",
395
+ "oxc/double-comparisons": "error",
396
+ "oxc/erasing-op": "error",
397
+ "oxc/misrefactored-assign-op": "error",
398
+ "oxc/missing-throw": "error",
399
+ "oxc/no-accumulating-spread": "error",
400
+ "oxc/no-async-endpoint-handlers": "error",
401
+ "oxc/no-barrel-file": "error",
402
+ "oxc/no-const-enum": "error",
403
+ "oxc/no-this-in-exported-function": "error",
404
+ "oxc/number-arg-out-of-range": "error",
405
+ "oxc/only-used-in-recursion": "error",
406
+ "oxc/uninvoked-array-callback": "error"
1181
407
  }
1182
- }];
408
+ });
1183
409
  //#endregion
1184
410
  //#region src/configs/promise.ts
1185
- const promise = () => [{
411
+ const promise = () => ({
1186
412
  files: [GLOB_SRC],
1187
413
  plugins: ["promise"],
1188
414
  rules: {
1189
415
  "promise/always-return": "error",
416
+ "promise/avoid-new": "off",
1190
417
  "promise/catch-or-return": "error",
1191
418
  "promise/no-callback-in-promise": "error",
1192
419
  "promise/no-multiple-resolved": "error",
@@ -1202,127 +429,396 @@ const promise = () => [{
1202
429
  "promise/spec-only": "error",
1203
430
  "promise/valid-params": "error"
1204
431
  }
1205
- }];
432
+ });
1206
433
  //#endregion
1207
- //#region src/utils.ts
1208
- function remapRuleNames(rules, from, to) {
1209
- return Object.fromEntries(Object.entries(rules).map(([name, value]) => [name.startsWith(from) ? to + name.slice(from.length) : name, value]));
1210
- }
1211
- //#endregion
1212
- //#region src/configs/react.ts
1213
- const react = () => [{
434
+ //#region src/configs/regexp.ts
435
+ const regexp = () => ({
1214
436
  files: [GLOB_SRC],
1215
437
  jsPlugins: [{
1216
- name: "@eslint-react",
1217
- specifier: "@eslint-react/eslint-plugin"
1218
- }, {
1219
- name: "react-hooks-js",
1220
- specifier: "eslint-plugin-react-hooks"
438
+ name: "regexp",
439
+ specifier: "eslint-plugin-regexp"
1221
440
  }],
1222
441
  rules: {
1223
- ...remapRuleNames(reactHooksRecommendedLatestRules, "react-hooks", "react-hooks-js"),
1224
- ...reactAllRules,
1225
- ...remapRuleNames(reactDisableConflictReactHooksRules, "react-hooks", "react-hooks-js"),
1226
- "@eslint-react/immutability": "error",
1227
- "@eslint-react/refs": "error"
442
+ "eslint/no-control-regex": "error",
443
+ "eslint/no-empty-character-class": "off",
444
+ "eslint/no-invalid-regexp": "off",
445
+ "eslint/no-misleading-character-class": "error",
446
+ "eslint/no-regex-spaces": "error",
447
+ "eslint/no-useless-backreference": "off",
448
+ "eslint/prefer-regex-literals": "error",
449
+ "regexp/confusing-quantifier": "error",
450
+ "regexp/control-character-escape": "error",
451
+ "regexp/match-any": "error",
452
+ "regexp/negation": "error",
453
+ "regexp/no-contradiction-with-assertion": "error",
454
+ "regexp/no-dupe-characters-character-class": "error",
455
+ "regexp/no-dupe-disjunctions": "error",
456
+ "regexp/no-empty-alternative": "error",
457
+ "regexp/no-empty-capturing-group": "error",
458
+ "regexp/no-empty-character-class": "error",
459
+ "regexp/no-empty-group": "error",
460
+ "regexp/no-empty-lookarounds-assertion": "error",
461
+ "regexp/no-empty-string-literal": "error",
462
+ "regexp/no-escape-backspace": "error",
463
+ "regexp/no-extra-lookaround-assertions": "error",
464
+ "regexp/no-invalid-regexp": "error",
465
+ "regexp/no-invisible-character": "error",
466
+ "regexp/no-lazy-ends": "error",
467
+ "regexp/no-legacy-features": "error",
468
+ "regexp/no-misleading-capturing-group": "error",
469
+ "regexp/no-misleading-unicode-character": "error",
470
+ "regexp/no-missing-g-flag": "error",
471
+ "regexp/no-non-standard-flag": "error",
472
+ "regexp/no-obscure-range": "error",
473
+ "regexp/no-optional-assertion": "error",
474
+ "regexp/no-potentially-useless-backreference": "error",
475
+ "regexp/no-super-linear-backtracking": "error",
476
+ "regexp/no-trivially-nested-assertion": "error",
477
+ "regexp/no-trivially-nested-quantifier": "error",
478
+ "regexp/no-unused-capturing-group": "error",
479
+ "regexp/no-useless-assertions": "error",
480
+ "regexp/no-useless-backreference": "error",
481
+ "regexp/no-useless-character-class": "error",
482
+ "regexp/no-useless-dollar-replacements": "error",
483
+ "regexp/no-useless-escape": "error",
484
+ "regexp/no-useless-flag": "error",
485
+ "regexp/no-useless-lazy": "error",
486
+ "regexp/no-useless-non-capturing-group": "error",
487
+ "regexp/no-useless-quantifier": "error",
488
+ "regexp/no-useless-range": "error",
489
+ "regexp/no-useless-set-operand": "error",
490
+ "regexp/no-useless-string-literal": "error",
491
+ "regexp/no-useless-two-nums-quantifier": "error",
492
+ "regexp/no-zero-quantifier": "error",
493
+ "regexp/optimal-lookaround-quantifier": "error",
494
+ "regexp/optimal-quantifier-concatenation": "error",
495
+ "regexp/prefer-character-class": "error",
496
+ "regexp/prefer-d": "error",
497
+ "regexp/prefer-plus-quantifier": "error",
498
+ "regexp/prefer-predefined-assertion": "error",
499
+ "regexp/prefer-question-quantifier": "error",
500
+ "regexp/prefer-range": "error",
501
+ "regexp/prefer-set-operation": "error",
502
+ "regexp/prefer-star-quantifier": "error",
503
+ "regexp/prefer-unicode-codepoint-escapes": "error",
504
+ "regexp/prefer-w": "error",
505
+ "regexp/simplify-set-operations": "error",
506
+ "regexp/sort-flags": "error",
507
+ "regexp/strict": "error",
508
+ "regexp/use-ignore-case": "error"
1228
509
  }
1229
- }];
1230
- //#endregion
1231
- //#region src/configs/regexp.ts
1232
- const regexp = () => [{
1233
- files: [GLOB_SRC],
1234
- jsPlugins: ["eslint-plugin-regexp"],
1235
- rules: { ...regexpRecommendedRules }
1236
- }];
510
+ });
1237
511
  //#endregion
1238
512
  //#region src/configs/sonarjs.ts
1239
- const sonarjs = () => [{
513
+ const sonarjs = () => ({
1240
514
  files: [GLOB_SRC],
1241
- jsPlugins: ["eslint-plugin-sonarjs"],
515
+ jsPlugins: [{
516
+ name: "sonarjs",
517
+ specifier: "eslint-plugin-sonarjs"
518
+ }],
1242
519
  rules: {
1243
- ...sonarjsRecommendedRules,
1244
- "sonarjs/no-commented-code": "off",
1245
- "sonarjs/deprecation": "off",
520
+ "sonarjs/anchor-precedence": "error",
521
+ "sonarjs/argument-type": "off",
1246
522
  "sonarjs/arguments-order": "off",
1247
- "sonarjs/pseudo-random": "off",
523
+ "sonarjs/arguments-usage": "off",
524
+ "sonarjs/array-callback-without-return": "error",
525
+ "sonarjs/array-constructor": "off",
526
+ "sonarjs/arrow-function-convention": "off",
527
+ "sonarjs/assertions-in-tests": "off",
528
+ "sonarjs/async-test-assertions": "error",
529
+ "sonarjs/aws-apigateway-public-api": "error",
530
+ "sonarjs/aws-ec2-rds-dms-public": "error",
531
+ "sonarjs/aws-ec2-unencrypted-ebs-volume": "error",
532
+ "sonarjs/aws-efs-unencrypted": "error",
533
+ "sonarjs/aws-iam-all-privileges": "error",
534
+ "sonarjs/aws-iam-all-resources-accessible": "off",
535
+ "sonarjs/aws-iam-privilege-escalation": "error",
536
+ "sonarjs/aws-iam-public-access": "error",
537
+ "sonarjs/aws-opensearchservice-domain": "error",
538
+ "sonarjs/aws-rds-unencrypted-databases": "error",
539
+ "sonarjs/aws-restricted-ip-admin-access": "error",
540
+ "sonarjs/aws-s3-bucket-granted-access": "error",
541
+ "sonarjs/aws-s3-bucket-insecure-http": "error",
542
+ "sonarjs/aws-s3-bucket-public-access": "error",
543
+ "sonarjs/aws-s3-bucket-versioning": "error",
544
+ "sonarjs/aws-sagemaker-unencrypted-notebook": "error",
545
+ "sonarjs/aws-sns-unencrypted-topics": "error",
546
+ "sonarjs/aws-sqs-unencrypted-queue": "error",
547
+ "sonarjs/bitwise-operators": "error",
548
+ "sonarjs/block-scoped-var": "error",
549
+ "sonarjs/bool-param-default": "off",
550
+ "sonarjs/call-argument-line": "error",
551
+ "sonarjs/chai-determinate-assertion": "error",
552
+ "sonarjs/class-name": "error",
553
+ "sonarjs/class-prototype": "off",
554
+ "sonarjs/code-eval": "error",
555
+ "sonarjs/cognitive-complexity": "off",
556
+ "sonarjs/comma-or-logical-or-case": "error",
557
+ "sonarjs/comment-regex": "off",
558
+ "sonarjs/concise-regex": "error",
559
+ "sonarjs/conditional-indentation": "off",
560
+ "sonarjs/confidential-information-logging": "off",
561
+ "sonarjs/constructor-for-side-effects": "error",
562
+ "sonarjs/content-length": "error",
563
+ "sonarjs/content-security-policy": "error",
564
+ "sonarjs/cookie-no-httponly": "error",
565
+ "sonarjs/cors": "error",
566
+ "sonarjs/csrf": "error",
567
+ "sonarjs/cyclomatic-complexity": "off",
568
+ "sonarjs/declarations-in-global-scope": "off",
569
+ "sonarjs/deprecation": "off",
570
+ "sonarjs/destructuring-assignment-syntax": "off",
571
+ "sonarjs/different-types-comparison": "error",
572
+ "sonarjs/disabled-auto-escaping": "error",
573
+ "sonarjs/disabled-resource-integrity": "error",
574
+ "sonarjs/disabled-timeout": "error",
575
+ "sonarjs/dompurify-unsafe-config": "error",
576
+ "sonarjs/duplicates-in-character-class": "error",
577
+ "sonarjs/dynamically-constructed-templates": "error",
578
+ "sonarjs/elseif-without-else": "off",
579
+ "sonarjs/empty-string-repetition": "error",
580
+ "sonarjs/encryption-secure-mode": "error",
581
+ "sonarjs/existing-groups": "error",
582
+ "sonarjs/expression-complexity": "off",
583
+ "sonarjs/file-header": "off",
584
+ "sonarjs/file-name-differ-from-class": "off",
585
+ "sonarjs/file-permissions": "error",
586
+ "sonarjs/file-uploads": "error",
587
+ "sonarjs/fixme-tag": "error",
588
+ "sonarjs/for-in": "off",
589
+ "sonarjs/for-loop-increment-sign": "error",
590
+ "sonarjs/frame-ancestors": "off",
591
+ "sonarjs/function-inside-loop": "error",
592
+ "sonarjs/function-name": "off",
1248
593
  "sonarjs/function-return-type": "off",
594
+ "sonarjs/future-reserved-words": "error",
595
+ "sonarjs/generator-without-yield": "error",
596
+ "sonarjs/hardcoded-secret-signatures": "error",
597
+ "sonarjs/hashing": "error",
598
+ "sonarjs/hidden-files": "off",
599
+ "sonarjs/hooks-before-test-cases": "error",
600
+ "sonarjs/in-operator-type-error": "error",
601
+ "sonarjs/inconsistent-function-call": "error",
602
+ "sonarjs/index-of-compare-to-positive-number": "error",
603
+ "sonarjs/insecure-cookie": "error",
604
+ "sonarjs/insecure-jwt-token": "error",
605
+ "sonarjs/inverted-assertion-arguments": "error",
606
+ "sonarjs/jsx-no-leaked-render": "off",
607
+ "sonarjs/label-position": "error",
608
+ "sonarjs/link-with-target-blank": "error",
609
+ "sonarjs/max-lines": "off",
610
+ "sonarjs/max-lines-per-function": "off",
611
+ "sonarjs/max-switch-cases": "error",
612
+ "sonarjs/max-union-size": "off",
613
+ "sonarjs/misplaced-loop-counter": "error",
614
+ "sonarjs/nested-control-flow": "off",
615
+ "sonarjs/new-operator-misuse": "error",
616
+ "sonarjs/no-all-duplicated-branches": "error",
617
+ "sonarjs/no-alphabetical-sort": "error",
618
+ "sonarjs/no-angular-bypass-sanitization": "error",
619
+ "sonarjs/no-array-delete": "error",
620
+ "sonarjs/no-associative-arrays": "error",
621
+ "sonarjs/no-async-constructor": "error",
622
+ "sonarjs/no-built-in-override": "off",
623
+ "sonarjs/no-case-label-in-switch": "error",
624
+ "sonarjs/no-clear-text-protocols": "error",
625
+ "sonarjs/no-code-after-done": "error",
626
+ "sonarjs/no-collapsible-if": "off",
627
+ "sonarjs/no-collection-size-mischeck": "error",
628
+ "sonarjs/no-commented-code": "off",
629
+ "sonarjs/no-control-regex": "error",
630
+ "sonarjs/no-dead-store": "error",
631
+ "sonarjs/no-delete-var": "error",
632
+ "sonarjs/no-duplicate-in-composite": "error",
633
+ "sonarjs/no-duplicate-string": "off",
634
+ "sonarjs/no-duplicate-test-title": "error",
635
+ "sonarjs/no-duplicated-branches": "error",
636
+ "sonarjs/no-element-overwrite": "error",
637
+ "sonarjs/no-empty-after-reluctant": "error",
638
+ "sonarjs/no-empty-alternatives": "error",
639
+ "sonarjs/no-empty-character-class": "error",
640
+ "sonarjs/no-empty-collection": "error",
641
+ "sonarjs/no-empty-group": "error",
642
+ "sonarjs/no-empty-test-file": "error",
643
+ "sonarjs/no-empty-test-title": "error",
644
+ "sonarjs/no-equals-in-for-termination": "error",
645
+ "sonarjs/no-exclusive-tests": "error",
646
+ "sonarjs/no-extra-arguments": "error",
647
+ "sonarjs/no-fallthrough": "error",
648
+ "sonarjs/no-floating-point-equality": "error",
649
+ "sonarjs/no-for-in-iterable": "off",
650
+ "sonarjs/no-forced-browser-interaction": "error",
651
+ "sonarjs/no-function-declaration-in-block": "off",
652
+ "sonarjs/no-global-this": "error",
653
+ "sonarjs/no-globals-shadowing": "error",
654
+ "sonarjs/no-gratuitous-expressions": "error",
655
+ "sonarjs/no-hardcoded-ip": "error",
656
+ "sonarjs/no-hardcoded-passwords": "error",
657
+ "sonarjs/no-hardcoded-secrets": "error",
658
+ "sonarjs/no-hook-setter-in-body": "error",
659
+ "sonarjs/no-identical-conditions": "error",
660
+ "sonarjs/no-identical-expressions": "error",
661
+ "sonarjs/no-identical-functions": "error",
662
+ "sonarjs/no-ignored-exceptions": "error",
663
+ "sonarjs/no-ignored-return": "error",
664
+ "sonarjs/no-implicit-dependencies": "off",
665
+ "sonarjs/no-implicit-global": "error",
666
+ "sonarjs/no-in-misuse": "error",
667
+ "sonarjs/no-incompatible-assertion-types": "error",
668
+ "sonarjs/no-incomplete-assertions": "error",
669
+ "sonarjs/no-inconsistent-returns": "off",
670
+ "sonarjs/no-incorrect-string-concat": "off",
671
+ "sonarjs/no-internal-api-use": "error",
672
+ "sonarjs/no-intrusive-permissions": "off",
673
+ "sonarjs/no-invalid-regexp": "error",
674
+ "sonarjs/no-invariant-returns": "error",
675
+ "sonarjs/no-inverted-boolean-check": "error",
676
+ "sonarjs/no-ip-forward": "off",
677
+ "sonarjs/no-labels": "error",
678
+ "sonarjs/no-literal-call": "error",
679
+ "sonarjs/no-mime-sniff": "error",
680
+ "sonarjs/no-misleading-array-reverse": "error",
681
+ "sonarjs/no-misleading-character-class": "error",
682
+ "sonarjs/no-mixed-content": "off",
683
+ "sonarjs/no-nested-assignment": "error",
684
+ "sonarjs/no-nested-conditional": "error",
685
+ "sonarjs/no-nested-functions": "error",
686
+ "sonarjs/no-nested-incdec": "off",
687
+ "sonarjs/no-nested-switch": "off",
688
+ "sonarjs/no-nested-template-literals": "error",
689
+ "sonarjs/no-os-command-from-path": "error",
690
+ "sonarjs/no-parameter-reassignment": "error",
691
+ "sonarjs/no-primitive-wrappers": "error",
692
+ "sonarjs/no-redundant-assignments": "error",
693
+ "sonarjs/no-redundant-boolean": "error",
694
+ "sonarjs/no-redundant-jump": "error",
695
+ "sonarjs/no-redundant-optional": "error",
696
+ "sonarjs/no-redundant-parentheses": "off",
697
+ "sonarjs/no-reference-error": "off",
698
+ "sonarjs/no-referrer-policy": "error",
699
+ "sonarjs/no-regex-spaces": "error",
700
+ "sonarjs/no-require-or-define": "off",
701
+ "sonarjs/no-return-type-any": "off",
702
+ "sonarjs/no-same-argument-assert": "error",
703
+ "sonarjs/no-same-line-conditional": "error",
704
+ "sonarjs/no-selector-parameter": "error",
705
+ "sonarjs/no-session-cookies-on-static-assets": "error",
706
+ "sonarjs/no-skipped-tests": "error",
707
+ "sonarjs/no-small-switch": "error",
708
+ "sonarjs/no-sonar-comments": "off",
709
+ "sonarjs/no-tab": "off",
710
+ "sonarjs/no-table-as-layout": "error",
711
+ "sonarjs/no-trivial-assertions": "error",
712
+ "sonarjs/no-try-promise": "error",
713
+ "sonarjs/no-undefined-argument": "error",
714
+ "sonarjs/no-undefined-assignment": "off",
715
+ "sonarjs/no-unenclosed-multiline-block": "error",
716
+ "sonarjs/no-uniq-key": "error",
717
+ "sonarjs/no-unsafe-unzip": "off",
718
+ "sonarjs/no-unthrown-error": "error",
719
+ "sonarjs/no-unused-collection": "error",
720
+ "sonarjs/no-unused-function-argument": "off",
721
+ "sonarjs/no-unused-vars": "error",
722
+ "sonarjs/no-use-of-empty-return-value": "error",
723
+ "sonarjs/no-useless-catch": "error",
724
+ "sonarjs/no-useless-increment": "error",
725
+ "sonarjs/no-useless-intersection": "error",
726
+ "sonarjs/no-useless-react-setstate": "error",
727
+ "sonarjs/no-variable-usage-before-declaration": "off",
728
+ "sonarjs/no-weak-cipher": "error",
729
+ "sonarjs/no-weak-keys": "error",
730
+ "sonarjs/no-wildcard-import": "off",
731
+ "sonarjs/non-existent-operator": "error",
732
+ "sonarjs/non-number-in-arithmetic-expression": "off",
733
+ "sonarjs/null-dereference": "error",
734
+ "sonarjs/object-alt-content": "error",
735
+ "sonarjs/operation-returning-nan": "off",
736
+ "sonarjs/os-command": "off",
737
+ "sonarjs/post-message": "error",
738
+ "sonarjs/prefer-default-last": "error",
739
+ "sonarjs/prefer-immediate-return": "off",
740
+ "sonarjs/prefer-object-literal": "off",
741
+ "sonarjs/prefer-promise-shorthand": "error",
1249
742
  "sonarjs/prefer-read-only-props": "off",
1250
- "sonarjs/argument-type": "off",
1251
- "sonarjs/cognitive-complexity": "off",
1252
- "sonarjs/jsx-no-leaked-render": "off"
743
+ "sonarjs/prefer-regexp-exec": "error",
744
+ "sonarjs/prefer-single-boolean-return": "error",
745
+ "sonarjs/prefer-specific-assertions": "error",
746
+ "sonarjs/prefer-type-guard": "error",
747
+ "sonarjs/prefer-while": "error",
748
+ "sonarjs/production-debug": "error",
749
+ "sonarjs/pseudo-random": "off",
750
+ "sonarjs/public-static-readonly": "error",
751
+ "sonarjs/publicly-writable-directories": "error",
752
+ "sonarjs/reduce-initial-value": "error",
753
+ "sonarjs/redundant-type-aliases": "error",
754
+ "sonarjs/regex-complexity": "error",
755
+ "sonarjs/review-blockchain-mnemonic": "error",
756
+ "sonarjs/session-regeneration": "error",
757
+ "sonarjs/shorthand-property-grouping": "off",
758
+ "sonarjs/single-char-in-character-classes": "error",
759
+ "sonarjs/single-character-alternation": "error",
760
+ "sonarjs/slow-regex": "error",
761
+ "sonarjs/sql-queries": "error",
762
+ "sonarjs/stable-tests": "error",
763
+ "sonarjs/stateful-regex": "error",
764
+ "sonarjs/strict-transport-security": "error",
765
+ "sonarjs/strings-comparison": "off",
766
+ "sonarjs/super-linear-regex": "error",
767
+ "sonarjs/table-header": "error",
768
+ "sonarjs/table-header-reference": "error",
769
+ "sonarjs/test-check-exception": "error",
770
+ "sonarjs/todo-tag": "error",
771
+ "sonarjs/too-many-break-or-continue-in-loop": "off",
772
+ "sonarjs/unicode-aware-regex": "off",
773
+ "sonarjs/unused-import": "error",
774
+ "sonarjs/unused-named-groups": "error",
775
+ "sonarjs/unverified-certificate": "error",
776
+ "sonarjs/unverified-hostname": "error",
777
+ "sonarjs/updated-const-var": "error",
778
+ "sonarjs/updated-loop-counter": "error",
779
+ "sonarjs/use-type-alias": "error",
780
+ "sonarjs/useless-string-operation": "off",
781
+ "sonarjs/values-not-convertible-to-numbers": "off",
782
+ "sonarjs/variable-name": "off",
783
+ "sonarjs/void-use": "error",
784
+ "sonarjs/weak-ssl": "error",
785
+ "sonarjs/web-sql-database": "off",
786
+ "sonarjs/x-powered-by": "error",
787
+ "sonarjs/xml-parser-xxe": "error"
1253
788
  }
1254
- }];
789
+ });
1255
790
  //#endregion
1256
791
  //#region src/configs/stylistic.ts
1257
- const stylistic = () => [{
792
+ const stylistic = () => ({
1258
793
  files: [GLOB_SRC],
1259
- jsPlugins: ["@stylistic/eslint-plugin"],
794
+ jsPlugins: [{
795
+ name: "@stylistic",
796
+ specifier: "@stylistic/eslint-plugin"
797
+ }],
1260
798
  rules: { "@stylistic/multiline-comment-style": ["error", "separate-lines"] }
1261
- }];
1262
- //#endregion
1263
- //#region src/configs/tailwindcss.ts
1264
- const tailwindcss = (options) => {
1265
- const disableShorthand = options.canonical?.logical ?? true;
1266
- return [{
1267
- files: [GLOB_SRC],
1268
- jsPlugins: ["eslint-plugin-better-tailwindcss"],
1269
- rules: {
1270
- "better-tailwindcss/enforce-canonical-classes": ["error", {
1271
- collapse: options.canonical?.collapse ?? true,
1272
- logical: options.canonical?.logical ?? true
1273
- }],
1274
- "better-tailwindcss/enforce-consistent-important-position": "off",
1275
- "better-tailwindcss/enforce-consistent-variable-syntax": "off",
1276
- "better-tailwindcss/enforce-shorthand-classes": disableShorthand ? "off" : "error",
1277
- "better-tailwindcss/enforce-consistent-class-order": ["error", {
1278
- order: options.classOrder?.order ?? "official",
1279
- componentClassOrder: options.classOrder?.componentOrder ?? "preserve",
1280
- componentClassPosition: options.classOrder?.componentPosition ?? "start",
1281
- unknownClassOrder: options.classOrder?.unknownOrder ?? "preserve",
1282
- unknownClassPosition: options.classOrder?.unknownPosition ?? "start"
1283
- }],
1284
- "better-tailwindcss/no-conflicting-classes": "error",
1285
- "better-tailwindcss/no-deprecated-classes": "error",
1286
- "better-tailwindcss/no-duplicate-classes": "error",
1287
- "better-tailwindcss/no-restricted-classes": ["error", { restrict: options.restrict ?? [] }],
1288
- "better-tailwindcss/no-unknown-classes": ["error", { ignore: options.ignore ?? [] }],
1289
- "better-tailwindcss/no-unnecessary-whitespace": ["error", { allowMultiline: options.whitespace?.allowMultiline ?? true }]
1290
- }
1291
- }];
1292
- };
799
+ });
1293
800
  //#endregion
1294
801
  //#region src/configs/typescript.ts
1295
- const typescript = () => [{
802
+ const typescript = () => ({
1296
803
  files: [GLOB_SRC],
1297
- plugins: ["eslint", "typescript"],
804
+ plugins: ["typescript", "eslint"],
1298
805
  rules: {
1299
- "eslint/class-methods-use-this": "error",
1300
806
  "eslint/constructor-super": "off",
1301
- "eslint/default-param-last": "error",
1302
807
  "eslint/getter-return": "off",
1303
- "eslint/no-array-constructor": "error",
1304
808
  "eslint/no-class-assign": "off",
1305
809
  "eslint/no-const-assign": "off",
1306
- "eslint/no-dupe-class-members": "off",
1307
810
  "eslint/no-dupe-keys": "off",
1308
- "eslint/no-empty-function": "error",
1309
811
  "eslint/no-func-assign": "off",
1310
812
  "eslint/no-implied-eval": "off",
1311
813
  "eslint/no-import-assign": "off",
1312
- "eslint/no-loop-func": "error",
1313
814
  "eslint/no-new-native-nonconstructor": "off",
1314
815
  "eslint/no-obj-calls": "off",
1315
- "eslint/no-redeclare": "off",
1316
816
  "eslint/no-setter-return": "off",
1317
- "eslint/no-shadow": "error",
1318
817
  "eslint/no-this-before-super": "off",
1319
818
  "eslint/no-throw-literal": "off",
1320
819
  "eslint/no-undef": "off",
1321
820
  "eslint/no-unreachable": "off",
1322
821
  "eslint/no-unsafe-negation": "off",
1323
- "eslint/no-unused-expressions": "error",
1324
- "eslint/no-unused-vars": "error",
1325
- "eslint/no-useless-constructor": "error",
1326
822
  "eslint/no-var": "error",
1327
823
  "eslint/no-with": "off",
1328
824
  "eslint/prefer-const": "error",
@@ -1441,20 +937,24 @@ const typescript = () => [{
1441
937
  "typescript/unified-signatures": "error",
1442
938
  "typescript/use-unknown-in-catch-callback-variable": "error"
1443
939
  }
1444
- }, {
940
+ });
941
+ const typescriptDeclarations = () => ({
1445
942
  files: ["**/*.d.ts"],
1446
- plugins: ["eslint", "typescript"],
943
+ plugins: ["typescript"],
1447
944
  rules: {
1448
945
  "typescript/consistent-indexed-object-style": "off",
1449
946
  "typescript/consistent-type-definitions": "off"
1450
947
  }
1451
- }];
948
+ });
1452
949
  //#endregion
1453
950
  //#region src/configs/unicorn.ts
1454
- const unicorn = () => [{
951
+ const unicorn = () => ({
1455
952
  files: [GLOB_SRC],
1456
- plugins: ["unicorn"],
953
+ plugins: ["unicorn", "eslint"],
1457
954
  rules: {
955
+ "eslint/logical-assignment-operators": "off",
956
+ "eslint/no-negated-condition": "off",
957
+ "eslint/no-nested-ternary": "off",
1458
958
  "unicorn/catch-error-name": "error",
1459
959
  "unicorn/consistent-assert": "error",
1460
960
  "unicorn/consistent-date-clone": "error",
@@ -1462,18 +962,20 @@ const unicorn = () => [{
1462
962
  "unicorn/consistent-existence-index-check": "error",
1463
963
  "unicorn/consistent-function-scoping": "error",
1464
964
  "unicorn/consistent-template-literal-escape": "error",
965
+ "unicorn/custom-error-definition": "off",
1465
966
  "unicorn/empty-brace-spaces": "error",
1466
967
  "unicorn/error-message": "error",
1467
968
  "unicorn/escape-case": "error",
1468
969
  "unicorn/explicit-length-check": "error",
1469
970
  "unicorn/filename-case": "error",
1470
971
  "unicorn/import-style": "error",
972
+ "unicorn/max-nested-calls": "off",
1471
973
  "unicorn/new-for-builtins": "error",
1472
974
  "unicorn/no-abusive-eslint-disable": "error",
1473
975
  "unicorn/no-accessor-recursion": "error",
1474
976
  "unicorn/no-anonymous-default-export": "error",
1475
977
  "unicorn/no-array-callback-reference": "error",
1476
- "unicorn/no-array-for-each": "error",
978
+ "unicorn/no-array-fill-with-reference-type": "error",
1477
979
  "unicorn/no-array-method-this-argument": "error",
1478
980
  "unicorn/no-array-reduce": "error",
1479
981
  "unicorn/no-array-reverse": "error",
@@ -1481,8 +983,8 @@ const unicorn = () => [{
1481
983
  "unicorn/no-await-expression-member": "error",
1482
984
  "unicorn/no-await-in-promise-methods": "error",
1483
985
  "unicorn/no-console-spaces": "error",
986
+ "unicorn/no-document-cookie": "off",
1484
987
  "unicorn/no-empty-file": "error",
1485
- "unicorn/no-hex-escape": "error",
1486
988
  "unicorn/no-immediate-mutation": "error",
1487
989
  "unicorn/no-instanceof-builtins": "error",
1488
990
  "unicorn/no-invalid-fetch-options": "error",
@@ -1494,6 +996,7 @@ const unicorn = () => [{
1494
996
  "unicorn/no-nested-ternary": "error",
1495
997
  "unicorn/no-new-array": "error",
1496
998
  "unicorn/no-new-buffer": "error",
999
+ "unicorn/no-null": "off",
1497
1000
  "unicorn/no-object-as-default-parameter": "error",
1498
1001
  "unicorn/no-process-exit": "error",
1499
1002
  "unicorn/no-single-promise-in-promise-methods": "error",
@@ -1534,12 +1037,12 @@ const unicorn = () => [{
1534
1037
  "unicorn/prefer-date-now": "error",
1535
1038
  "unicorn/prefer-default-parameters": "error",
1536
1039
  "unicorn/prefer-dom-node-append": "error",
1537
- "unicorn/prefer-dom-node-dataset": "error",
1538
1040
  "unicorn/prefer-dom-node-remove": "error",
1539
1041
  "unicorn/prefer-dom-node-text-content": "error",
1540
1042
  "unicorn/prefer-event-target": "error",
1541
1043
  "unicorn/prefer-export-from": "error",
1542
1044
  "unicorn/prefer-global-this": "error",
1045
+ "unicorn/prefer-import-meta-properties": "off",
1543
1046
  "unicorn/prefer-includes": "error",
1544
1047
  "unicorn/prefer-keyboard-event-key": "error",
1545
1048
  "unicorn/prefer-logical-operator-over-ternary": "error",
@@ -1551,6 +1054,7 @@ const unicorn = () => [{
1551
1054
  "unicorn/prefer-native-coercion-functions": "error",
1552
1055
  "unicorn/prefer-negative-index": "error",
1553
1056
  "unicorn/prefer-node-protocol": "error",
1057
+ "unicorn/prefer-number-coercion": "off",
1554
1058
  "unicorn/prefer-number-properties": "error",
1555
1059
  "unicorn/prefer-object-from-entries": "error",
1556
1060
  "unicorn/prefer-optional-catch-binding": "error",
@@ -1563,6 +1067,7 @@ const unicorn = () => [{
1563
1067
  "unicorn/prefer-set-size": "error",
1564
1068
  "unicorn/prefer-single-call": "error",
1565
1069
  "unicorn/prefer-spread": "error",
1070
+ "unicorn/prefer-string-raw": "off",
1566
1071
  "unicorn/prefer-string-replace-all": "error",
1567
1072
  "unicorn/prefer-string-slice": "error",
1568
1073
  "unicorn/prefer-string-starts-ends-with": "error",
@@ -1576,89 +1081,27 @@ const unicorn = () => [{
1576
1081
  "unicorn/require-module-attributes": "error",
1577
1082
  "unicorn/require-module-specifiers": "error",
1578
1083
  "unicorn/require-number-to-fixed-digits-argument": "error",
1084
+ "unicorn/require-post-message-target-origin": "off",
1579
1085
  "unicorn/switch-case-braces": "error",
1580
1086
  "unicorn/switch-case-break-position": "error",
1581
1087
  "unicorn/text-encoding-identifier-case": ["error", { withDash: true }],
1582
1088
  "unicorn/throw-new-error": "error"
1583
1089
  }
1584
- }];
1585
- //#endregion
1586
- //#region src/configs/vitest.ts
1587
- const vitest = (config) => [{
1588
- files: config.files,
1589
- plugins: ["vitest"],
1590
- rules: {
1591
- "vitest/consistent-test-it": ["error", { fn: "test" }],
1592
- "vitest/expect-expect": "error",
1593
- "vitest/hoisted-apis-on-top": "off",
1594
- "vitest/no-commented-out-tests": "error",
1595
- "vitest/no-conditional-expect": "error",
1596
- "vitest/no-conditional-tests": "off",
1597
- "vitest/no-disabled-tests": "error",
1598
- "vitest/no-focused-tests": "error",
1599
- "vitest/no-identical-title": "error",
1600
- "vitest/no-import-node-test": "error",
1601
- "vitest/no-interpolation-in-snapshots": "error",
1602
- "vitest/no-mocks-import": "error",
1603
- "vitest/no-standalone-expect": "error",
1604
- "vitest/no-unneeded-async-expect-function": "error",
1605
- "vitest/prefer-called-exactly-once-with": "error",
1606
- "vitest/prefer-mock-return-shorthand": "error",
1607
- "vitest/prefer-snapshot-hint": "off",
1608
- "vitest/require-awaited-expect-poll": "off",
1609
- "vitest/require-local-test-context-for-concurrent-snapshots": "error",
1610
- "vitest/require-mock-type-parameters": "off",
1611
- "vitest/require-to-throw-message": "off",
1612
- "vitest/valid-describe-callback": "error",
1613
- "vitest/valid-expect": "error",
1614
- "vitest/valid-expect-in-promise": "error",
1615
- "vitest/valid-title": "error",
1616
- "vitest/warn-todo": "error"
1617
- }
1618
- }];
1090
+ });
1619
1091
  //#endregion
1620
1092
  //#region src/configs/zod.ts
1621
- const zod = () => [{
1093
+ const zod = () => ({
1622
1094
  files: [GLOB_SRC],
1623
- jsPlugins: ["eslint-plugin-import-zod"],
1095
+ jsPlugins: [{
1096
+ name: "import-zod",
1097
+ specifier: "eslint-plugin-import-zod"
1098
+ }],
1624
1099
  rules: { "import-zod/prefer-zod-namespace": "error" }
1625
- }];
1100
+ });
1626
1101
  //#endregion
1627
1102
  //#region src/base.ts
1628
- const createSelectors = (names, kind) => names.map((name) => ({
1629
- name,
1630
- kind,
1631
- match: [{ type: "strings" }, { type: "objectValues" }]
1632
- }));
1633
- const concatArrays = (target, source) => {
1634
- if (Array.isArray(target) && Array.isArray(source)) return [...target, ...source];
1635
- };
1636
- const defineConfig = ({ config = {}, custom: userConfig = {} } = {}) => {
1637
- const overrides = [
1638
- ...oxc(),
1639
- ...eslint(),
1640
- ...command(),
1641
- ...typescript(),
1642
- ...unicorn(),
1643
- ...promise(),
1644
- ...node(),
1645
- ...jsxA11y(),
1646
- ...imports(),
1647
- ...jsdoc(),
1648
- ...nelsonlaidev(),
1649
- ...stylistic(),
1650
- ...deMorgan(),
1651
- ...zod(),
1652
- ...regexp(),
1653
- ...sonarjs(),
1654
- ...importSort()
1655
- ];
1656
- if (userConfig.react ?? isPackageExists("react")) overrides.push(...react());
1657
- if (userConfig.nextjs ?? isPackageExists("next")) overrides.push(...nextjs());
1658
- if (userConfig.vitest) overrides.push(...vitest(userConfig.vitest));
1659
- if (userConfig.playwright) overrides.push(...playwright(userConfig.playwright));
1660
- if (userConfig.tailwindcss) overrides.push(...tailwindcss(userConfig.tailwindcss));
1661
- return mergeWith({
1103
+ const defineConfig = (config = {}) => {
1104
+ return merge({
1662
1105
  options: {
1663
1106
  typeAware: true,
1664
1107
  maxWarnings: 0,
@@ -1671,7 +1114,26 @@ const defineConfig = ({ config = {}, custom: userConfig = {} } = {}) => {
1671
1114
  es2022: true
1672
1115
  },
1673
1116
  ignorePatterns: ["**/routeTree.gen.ts"],
1674
- overrides,
1117
+ overrides: [
1118
+ oxc(),
1119
+ eslint(),
1120
+ command(),
1121
+ typescript(),
1122
+ typescriptDeclarations(),
1123
+ unicorn(),
1124
+ promise(),
1125
+ node(),
1126
+ jsxA11y(),
1127
+ imports(),
1128
+ jsdoc(),
1129
+ nelsonlaidev(),
1130
+ stylistic(),
1131
+ deMorgan(),
1132
+ zod(),
1133
+ regexp(),
1134
+ sonarjs(),
1135
+ importSort()
1136
+ ],
1675
1137
  settings: {
1676
1138
  "jsx-a11y": { components: {
1677
1139
  Button: "button",
@@ -1680,33 +1142,280 @@ const defineConfig = ({ config = {}, custom: userConfig = {} } = {}) => {
1680
1142
  Textarea: "textarea",
1681
1143
  Link: "a"
1682
1144
  } },
1683
- ...userConfig.tailwindcss && { "better-tailwindcss": {
1145
+ "better-tailwindcss": {
1684
1146
  detectComponentClasses: false,
1685
- rootFontSize: 16,
1686
- selectors: [
1687
- ...betterTailwindcssDefaultSelectors,
1688
- ...createSelectors(["classNames", ".+ClassNames"], "attribute"),
1689
- ...createSelectors([".+ClassName", ".+ClassNames"], "variable")
1690
- ]
1691
- } }
1147
+ rootFontSize: 16
1148
+ }
1692
1149
  }
1693
- }, {
1150
+ }, config);
1151
+ };
1152
+ //#endregion
1153
+ //#region src/utils.ts
1154
+ function mergeConfig(base, override) {
1155
+ const { plugins: basePlugins = [], jsPlugins: baseJsPlugins = [], ...baseConfig } = base;
1156
+ const { plugins: overridePlugins = [], jsPlugins: overrideJsPlugins, ...overrideConfig } = override;
1157
+ const config = merge.withOptions({
1158
+ allowUndefinedOverrides: false,
1159
+ mergeArrays: false
1160
+ }, baseConfig, overrideConfig);
1161
+ const plugins = [...new Set([...basePlugins, ...overridePlugins])];
1162
+ let jsPlugins = baseJsPlugins;
1163
+ if (overrideJsPlugins === null) jsPlugins = null;
1164
+ else if (overrideJsPlugins) jsPlugins = [...baseJsPlugins ?? [], ...overrideJsPlugins];
1165
+ return {
1694
1166
  ...config,
1695
- settings: {
1696
- ...config.settings,
1697
- ...userConfig.tailwindcss && { "better-tailwindcss": pick(userConfig.tailwindcss, [
1698
- "entryPoint",
1699
- "tailwindConfig",
1700
- "tsconfig",
1701
- "detectComponentClasses",
1702
- "rootFontSize",
1703
- "messageStyle",
1704
- "selectors"
1705
- ]) }
1167
+ plugins,
1168
+ jsPlugins
1169
+ };
1170
+ }
1171
+ //#endregion
1172
+ //#region src/configs/nextjs.ts
1173
+ const nextjs = (options = {}) => {
1174
+ return mergeConfig({
1175
+ files: [GLOB_SRC],
1176
+ plugins: ["nextjs"],
1177
+ rules: {
1178
+ "nextjs/google-font-display": "error",
1179
+ "nextjs/google-font-preconnect": "error",
1180
+ "nextjs/inline-script-id": "error",
1181
+ "nextjs/next-script-for-ga": "error",
1182
+ "nextjs/no-assign-module-variable": "error",
1183
+ "nextjs/no-async-client-component": "error",
1184
+ "nextjs/no-before-interactive-script-outside-document": "error",
1185
+ "nextjs/no-css-tags": "error",
1186
+ "nextjs/no-document-import-in-page": "error",
1187
+ "nextjs/no-duplicate-head": "error",
1188
+ "nextjs/no-head-element": "error",
1189
+ "nextjs/no-head-import-in-document": "error",
1190
+ "nextjs/no-html-link-for-pages": "error",
1191
+ "nextjs/no-img-element": "error",
1192
+ "nextjs/no-page-custom-font": "error",
1193
+ "nextjs/no-script-component-in-head": "error",
1194
+ "nextjs/no-styled-jsx-in-document": "error",
1195
+ "nextjs/no-sync-scripts": "error",
1196
+ "nextjs/no-title-in-document-head": "error",
1197
+ "nextjs/no-typos": "error",
1198
+ "nextjs/no-unwanted-polyfillio": "error"
1199
+ }
1200
+ }, options);
1201
+ };
1202
+ //#endregion
1203
+ //#region src/configs/playwright.ts
1204
+ const playwright = (options = {}) => {
1205
+ return mergeConfig({
1206
+ files: [GLOB_SRC],
1207
+ jsPlugins: [{
1208
+ name: "playwright",
1209
+ specifier: "eslint-plugin-playwright"
1210
+ }],
1211
+ rules: {
1212
+ "eslint/no-empty-pattern": "off",
1213
+ "playwright/consistent-spacing-between-blocks": "error",
1214
+ "playwright/expect-expect": "error",
1215
+ "playwright/max-nested-describe": "error",
1216
+ "playwright/missing-playwright-await": "error",
1217
+ "playwright/no-conditional-expect": "error",
1218
+ "playwright/no-conditional-in-test": "error",
1219
+ "playwright/no-duplicate-hooks": "error",
1220
+ "playwright/no-duplicate-slow": "error",
1221
+ "playwright/no-element-handle": "error",
1222
+ "playwright/no-eval": "error",
1223
+ "playwright/no-focused-test": "error",
1224
+ "playwright/no-force-option": "error",
1225
+ "playwright/no-nested-step": "error",
1226
+ "playwright/no-networkidle": "error",
1227
+ "playwright/no-page-pause": "error",
1228
+ "playwright/no-skipped-test": "error",
1229
+ "playwright/no-standalone-expect": "error",
1230
+ "playwright/no-unsafe-references": "error",
1231
+ "playwright/no-unused-locators": "error",
1232
+ "playwright/no-useless-await": "error",
1233
+ "playwright/no-useless-not": "error",
1234
+ "playwright/no-wait-for-navigation": "error",
1235
+ "playwright/no-wait-for-selector": "error",
1236
+ "playwright/no-wait-for-timeout": "error",
1237
+ "playwright/prefer-hooks-in-order": "error",
1238
+ "playwright/prefer-hooks-on-top": "error",
1239
+ "playwright/prefer-locator": "error",
1240
+ "playwright/prefer-to-have-count": "error",
1241
+ "playwright/prefer-to-have-length": "error",
1242
+ "playwright/prefer-web-first-assertions": "error",
1243
+ "playwright/valid-describe-callback": "error",
1244
+ "playwright/valid-expect": "error",
1245
+ "playwright/valid-expect-in-promise": "error",
1246
+ "playwright/valid-test-tags": "error",
1247
+ "playwright/valid-title": "error"
1248
+ }
1249
+ }, options);
1250
+ };
1251
+ //#endregion
1252
+ //#region src/configs/react.ts
1253
+ const react = (options = {}) => {
1254
+ return mergeConfig({
1255
+ files: [GLOB_SRC],
1256
+ jsPlugins: [{
1257
+ name: "@eslint-react",
1258
+ specifier: "@eslint-react/eslint-plugin"
1259
+ }, {
1260
+ name: "react-hooks-js",
1261
+ specifier: "eslint-plugin-react-hooks"
1262
+ }],
1263
+ rules: {
1264
+ "@eslint-react/dom-no-dangerously-set-innerhtml": "error",
1265
+ "@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
1266
+ "@eslint-react/dom-no-find-dom-node": "error",
1267
+ "@eslint-react/dom-no-flush-sync": "error",
1268
+ "@eslint-react/dom-no-hydrate": "error",
1269
+ "@eslint-react/dom-no-missing-button-type": "error",
1270
+ "@eslint-react/dom-no-missing-iframe-sandbox": "error",
1271
+ "@eslint-react/dom-no-render": "error",
1272
+ "@eslint-react/dom-no-render-return-value": "error",
1273
+ "@eslint-react/dom-no-script-url": "error",
1274
+ "@eslint-react/dom-no-string-style-prop": "error",
1275
+ "@eslint-react/dom-no-unknown-property": "error",
1276
+ "@eslint-react/dom-no-unsafe-iframe-sandbox": "error",
1277
+ "@eslint-react/dom-no-unsafe-target-blank": "error",
1278
+ "@eslint-react/dom-no-use-form-state": "error",
1279
+ "@eslint-react/dom-no-void-elements-with-children": "error",
1280
+ "@eslint-react/error-boundaries": "error",
1281
+ "@eslint-react/exhaustive-deps": "error",
1282
+ "@eslint-react/globals": "error",
1283
+ "@eslint-react/immutability": "error",
1284
+ "@eslint-react/jsx-no-children-prop": "error",
1285
+ "@eslint-react/jsx-no-children-prop-with-children": "error",
1286
+ "@eslint-react/jsx-no-comment-textnodes": "error",
1287
+ "@eslint-react/jsx-no-key-after-spread": "error",
1288
+ "@eslint-react/jsx-no-leaked-dollar": "error",
1289
+ "@eslint-react/jsx-no-leaked-semicolon": "error",
1290
+ "@eslint-react/jsx-no-namespace": "error",
1291
+ "@eslint-react/jsx-no-useless-fragment": "error",
1292
+ "@eslint-react/naming-convention-context-name": "error",
1293
+ "@eslint-react/naming-convention-id-name": "error",
1294
+ "@eslint-react/naming-convention-ref-name": "error",
1295
+ "@eslint-react/no-access-state-in-setstate": "error",
1296
+ "@eslint-react/no-array-index-key": "error",
1297
+ "@eslint-react/no-children-count": "error",
1298
+ "@eslint-react/no-children-for-each": "error",
1299
+ "@eslint-react/no-children-map": "error",
1300
+ "@eslint-react/no-children-only": "error",
1301
+ "@eslint-react/no-children-to-array": "error",
1302
+ "@eslint-react/no-class-component": "error",
1303
+ "@eslint-react/no-clone-element": "error",
1304
+ "@eslint-react/no-component-will-mount": "error",
1305
+ "@eslint-react/no-component-will-receive-props": "error",
1306
+ "@eslint-react/no-component-will-update": "error",
1307
+ "@eslint-react/no-context-provider": "error",
1308
+ "@eslint-react/no-create-ref": "error",
1309
+ "@eslint-react/no-direct-mutation-state": "error",
1310
+ "@eslint-react/no-duplicate-key": "error",
1311
+ "@eslint-react/no-forward-ref": "error",
1312
+ "@eslint-react/no-missing-component-display-name": "error",
1313
+ "@eslint-react/no-missing-context-display-name": "error",
1314
+ "@eslint-react/no-missing-key": "error",
1315
+ "@eslint-react/no-misused-capture-owner-stack": "error",
1316
+ "@eslint-react/no-nested-component-definitions": "error",
1317
+ "@eslint-react/no-nested-lazy-component-declarations": "error",
1318
+ "@eslint-react/no-set-state-in-component-did-mount": "error",
1319
+ "@eslint-react/no-set-state-in-component-did-update": "error",
1320
+ "@eslint-react/no-set-state-in-component-will-update": "error",
1321
+ "@eslint-react/no-unnecessary-use-prefix": "error",
1322
+ "@eslint-react/no-unsafe-component-will-mount": "error",
1323
+ "@eslint-react/no-unsafe-component-will-receive-props": "error",
1324
+ "@eslint-react/no-unsafe-component-will-update": "error",
1325
+ "@eslint-react/no-unstable-context-value": "error",
1326
+ "@eslint-react/no-unstable-default-props": "error",
1327
+ "@eslint-react/no-unused-class-component-members": "error",
1328
+ "@eslint-react/no-unused-state": "error",
1329
+ "@eslint-react/no-use-context": "error",
1330
+ "@eslint-react/purity": "error",
1331
+ "@eslint-react/refs": "error",
1332
+ "@eslint-react/rsc-function-definition": "error",
1333
+ "@eslint-react/rules-of-hooks": "error",
1334
+ "@eslint-react/set-state-in-effect": "error",
1335
+ "@eslint-react/set-state-in-render": "error",
1336
+ "@eslint-react/static-components": "off",
1337
+ "@eslint-react/unsupported-syntax": "error",
1338
+ "@eslint-react/use-memo": "error",
1339
+ "@eslint-react/use-state": "error",
1340
+ "@eslint-react/web-api-no-leaked-event-listener": "error",
1341
+ "@eslint-react/web-api-no-leaked-fetch": "error",
1342
+ "@eslint-react/web-api-no-leaked-intersection-observer": "error",
1343
+ "@eslint-react/web-api-no-leaked-interval": "error",
1344
+ "@eslint-react/web-api-no-leaked-resize-observer": "error",
1345
+ "@eslint-react/web-api-no-leaked-timeout": "error",
1346
+ "react-hooks-js/config": "error",
1347
+ "react-hooks-js/error-boundaries": "off",
1348
+ "react-hooks-js/exhaustive-deps": "off",
1349
+ "react-hooks-js/gating": "error",
1350
+ "react-hooks-js/globals": "off",
1351
+ "react-hooks-js/immutability": "off",
1352
+ "react-hooks-js/incompatible-library": "error",
1353
+ "react-hooks-js/preserve-manual-memoization": "error",
1354
+ "react-hooks-js/purity": "off",
1355
+ "react-hooks-js/refs": "off",
1356
+ "react-hooks-js/rules-of-hooks": "off",
1357
+ "react-hooks-js/set-state-in-effect": "off",
1358
+ "react-hooks-js/set-state-in-render": "off",
1359
+ "react-hooks-js/static-components": "off",
1360
+ "react-hooks-js/unsupported-syntax": "off",
1361
+ "react-hooks-js/use-memo": "off",
1362
+ "react-hooks-js/void-use-memo": "error"
1363
+ }
1364
+ }, options);
1365
+ };
1366
+ //#endregion
1367
+ //#region src/configs/tailwindcss.ts
1368
+ const tailwindcss = (options = {}) => {
1369
+ return mergeConfig({
1370
+ files: [GLOB_SRC],
1371
+ jsPlugins: [{
1372
+ name: "better-tailwindcss",
1373
+ specifier: "eslint-plugin-better-tailwindcss"
1374
+ }],
1375
+ rules: {
1376
+ "better-tailwindcss/enforce-canonical-classes": "error",
1377
+ "better-tailwindcss/enforce-consistent-class-order": "error",
1378
+ "better-tailwindcss/enforce-consistent-variant-order": "error",
1379
+ "better-tailwindcss/no-conflicting-classes": "error",
1380
+ "better-tailwindcss/no-deprecated-classes": "error",
1381
+ "better-tailwindcss/no-duplicate-classes": "error",
1382
+ "better-tailwindcss/no-restricted-classes": "error",
1383
+ "better-tailwindcss/no-unknown-classes": "error",
1384
+ "better-tailwindcss/no-unnecessary-whitespace": "error"
1385
+ }
1386
+ }, options);
1387
+ };
1388
+ //#endregion
1389
+ //#region src/configs/vitest.ts
1390
+ const vitest = (options = {}) => {
1391
+ return mergeConfig({
1392
+ files: [GLOB_SRC],
1393
+ plugins: ["vitest"],
1394
+ rules: {
1395
+ "vitest/consistent-test-it": ["error", { fn: "test" }],
1396
+ "vitest/expect-expect": "error",
1397
+ "vitest/no-commented-out-tests": "error",
1398
+ "vitest/no-conditional-expect": "error",
1399
+ "vitest/no-disabled-tests": "error",
1400
+ "vitest/no-focused-tests": "error",
1401
+ "vitest/no-identical-title": "error",
1402
+ "vitest/no-import-node-test": "error",
1403
+ "vitest/no-interpolation-in-snapshots": "error",
1404
+ "vitest/no-mocks-import": "error",
1405
+ "vitest/no-standalone-expect": "error",
1406
+ "vitest/no-unneeded-async-expect-function": "error",
1407
+ "vitest/prefer-called-exactly-once-with": "error",
1408
+ "vitest/prefer-mock-return-shorthand": "error",
1409
+ "vitest/require-local-test-context-for-concurrent-snapshots": "error",
1410
+ "vitest/valid-describe-callback": "error",
1411
+ "vitest/valid-expect": "error",
1412
+ "vitest/valid-expect-in-promise": "error",
1413
+ "vitest/valid-title": "error",
1414
+ "vitest/warn-todo": "error"
1706
1415
  }
1707
- }, concatArrays);
1416
+ }, options);
1708
1417
  };
1709
1418
  //#endregion
1710
- export { GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, defineConfig };
1419
+ export { GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, defineConfig, nextjs, playwright, react, tailwindcss, vitest };
1711
1420
 
1712
1421
  //# sourceMappingURL=index.mjs.map