@nelsonlaidev/oxlint-config 0.1.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 ADDED
@@ -0,0 +1,1272 @@
1
+ import { mergeWith, pick } from "es-toolkit/object";
2
+ import { getDefaultSelectors } from "eslint-plugin-better-tailwindcss/defaults";
3
+ import { MatcherType, SelectorKind } from "eslint-plugin-better-tailwindcss/types";
4
+ import { isPackageExists } from "local-pkg";
5
+
6
+ //#region src/globs.ts
7
+ const GLOB_SRC_EXT = "{js,jsx,ts,tsx,cjs,cts,mjs,mts}";
8
+ const GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
9
+ const GLOB_JS = "**/*.{js,cjs,mjs}";
10
+ const GLOB_JSX = "**/*.{jsx,cjsx,mjsx}";
11
+ const GLOB_TS = "**/*.{ts,cts,mts}";
12
+ const GLOB_TSX = "**/*.{tsx,ctsx,mtsx}";
13
+
14
+ //#endregion
15
+ //#region src/configs/de-morgan.ts
16
+ const deMorgan = () => [{
17
+ files: [GLOB_SRC],
18
+ jsPlugins: ["eslint-plugin-de-morgan"],
19
+ rules: {
20
+ "de-morgan/no-negated-conjunction": "error",
21
+ "de-morgan/no-negated-disjunction": "error"
22
+ }
23
+ }];
24
+
25
+ //#endregion
26
+ //#region src/configs/eslint.ts
27
+ const eslint = () => [{
28
+ files: [GLOB_SRC],
29
+ plugins: ["eslint"],
30
+ rules: {
31
+ "accessor-pairs": "error",
32
+ "array-callback-return": "error",
33
+ "arrow-body-style": "error",
34
+ "block-scoped-var": "error",
35
+ "class-methods-use-this": "error",
36
+ complexity: ["error", { max: 30 }],
37
+ "default-case": "error",
38
+ "default-case-last": "error",
39
+ "default-param-last": "error",
40
+ eqeqeq: "error",
41
+ "for-direction": "error",
42
+ "func-names": "error",
43
+ "grouped-accessor-pairs": "error",
44
+ "guard-for-in": "error",
45
+ "max-classes-per-file": "error",
46
+ "max-depth": "error",
47
+ "max-nested-callbacks": "error",
48
+ "new-cap": ["error", { capIsNew: false }],
49
+ "no-alert": "error",
50
+ "no-async-promise-executor": "error",
51
+ "no-await-in-loop": "error",
52
+ "no-bitwise": "error",
53
+ "no-caller": "error",
54
+ "no-case-declarations": "error",
55
+ "no-compare-neg-zero": "error",
56
+ "no-cond-assign": "error",
57
+ "no-console": ["error", { allow: ["warn", "error"] }],
58
+ "no-constant-binary-expression": "error",
59
+ "no-constant-condition": "error",
60
+ "no-constructor-return": "error",
61
+ "no-control-regex": "error",
62
+ "no-debugger": "error",
63
+ "no-delete-var": "error",
64
+ "no-div-regex": "error",
65
+ "no-dupe-else-if": "error",
66
+ "no-duplicate-case": "error",
67
+ "no-else-return": "error",
68
+ "no-empty": "error",
69
+ "no-empty-static-block": "error",
70
+ "no-eq-null": "error",
71
+ "no-eval": "error",
72
+ "no-ex-assign": "error",
73
+ "no-extend-native": "error",
74
+ "no-extra-bind": "error",
75
+ "no-extra-boolean-cast": "error",
76
+ "no-extra-label": "error",
77
+ "no-fallthrough": "error",
78
+ "no-global-assign": "error",
79
+ "no-implicit-coercion": "error",
80
+ "no-inner-declarations": "error",
81
+ "no-irregular-whitespace": "error",
82
+ "no-iterator": "error",
83
+ "no-label-var": "error",
84
+ "no-labels": "error",
85
+ "no-lone-blocks": "error",
86
+ "no-lonely-if": "error",
87
+ "no-loop-func": "error",
88
+ "no-loss-of-precision": "error",
89
+ "no-misleading-character-class": "error",
90
+ "no-multi-assign": "error",
91
+ "no-multi-str": "error",
92
+ "no-new": "error",
93
+ "no-new-func": "error",
94
+ "no-new-wrappers": "error",
95
+ "no-nonoctal-decimal-escape": "error",
96
+ "no-object-constructor": "error",
97
+ "no-param-reassign": "error",
98
+ "no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
99
+ "no-promise-executor-return": "error",
100
+ "no-proto": "error",
101
+ "no-prototype-builtins": "error",
102
+ "no-regex-spaces": "error",
103
+ "no-restricted-globals": "error",
104
+ "no-restricted-imports": "error",
105
+ "no-return-assign": "error",
106
+ "no-script-url": "error",
107
+ "no-self-assign": "error",
108
+ "no-self-compare": "error",
109
+ "no-sequences": "error",
110
+ "no-shadow": "error",
111
+ "no-shadow-restricted-names": "error",
112
+ "no-sparse-arrays": "error",
113
+ "no-template-curly-in-string": "error",
114
+ "no-unassigned-vars": "error",
115
+ "no-unmodified-loop-condition": "error",
116
+ "no-unneeded-ternary": "error",
117
+ "no-unsafe-finally": "error",
118
+ "no-unsafe-optional-chaining": "error",
119
+ "no-unused-labels": "error",
120
+ "no-unused-private-class-members": "error",
121
+ "no-useless-call": "error",
122
+ "no-useless-catch": "error",
123
+ "no-useless-computed-key": "error",
124
+ "no-useless-concat": "error",
125
+ "no-useless-constructor": "error",
126
+ "no-useless-escape": "error",
127
+ "no-useless-rename": "error",
128
+ "no-useless-return": "error",
129
+ "no-var": "error",
130
+ "no-void": ["error", { allowAsStatement: true }],
131
+ "no-warning-comments": "error",
132
+ "operator-assignment": "error",
133
+ "prefer-const": "error",
134
+ "prefer-destructuring": ["error", {
135
+ VariableDeclarator: {
136
+ array: false,
137
+ object: true
138
+ },
139
+ AssignmentExpression: {
140
+ array: false,
141
+ object: false
142
+ }
143
+ }],
144
+ "prefer-exponentiation-operator": "error",
145
+ "prefer-numeric-literals": "error",
146
+ "prefer-object-has-own": "error",
147
+ "prefer-object-spread": "error",
148
+ "prefer-rest-params": "error",
149
+ "prefer-spread": "error",
150
+ "prefer-template": "error",
151
+ "preserve-caught-error": "error",
152
+ radix: "error",
153
+ "require-yield": "error",
154
+ "sort-vars": "error",
155
+ "symbol-description": "error",
156
+ "unicode-bom": "error",
157
+ "use-isnan": "error",
158
+ "valid-typeof": "error",
159
+ "vars-on-top": "error",
160
+ yoda: "error"
161
+ }
162
+ }];
163
+
164
+ //#endregion
165
+ //#region src/configs/import-sort.ts
166
+ const importSort = () => [{
167
+ files: [GLOB_SRC],
168
+ jsPlugins: [{
169
+ name: "import-sort",
170
+ specifier: "eslint-plugin-simple-import-sort"
171
+ }],
172
+ rules: {
173
+ "import-sort/imports": ["error", { groups: [
174
+ ["^\\u0000"],
175
+ [
176
+ "^node:.*\\u0000$",
177
+ "^@?\\w.*\\u0000$",
178
+ "^(@/|~/|[^.]).*\\u0000$",
179
+ "^\\.\\..*\\u0000$",
180
+ "^\\..*\\u0000$"
181
+ ],
182
+ ["^node:"],
183
+ ["^@?\\w"],
184
+ [
185
+ "^@/",
186
+ "^~/",
187
+ "^[^.]"
188
+ ],
189
+ ["^\\.\\.", "^\\."]
190
+ ] }],
191
+ "import-sort/exports": "error"
192
+ }
193
+ }];
194
+
195
+ //#endregion
196
+ //#region src/configs/imports.ts
197
+ const imports = () => [{
198
+ files: [GLOB_SRC],
199
+ plugins: ["import"],
200
+ rules: {
201
+ "import/consistent-type-specifier-style": "error",
202
+ "import/default": "error",
203
+ "import/export": "error",
204
+ "import/first": "error",
205
+ "import/named": "error",
206
+ "import/namespace": "error",
207
+ "import/no-absolute-path": "error",
208
+ "import/no-amd": "error",
209
+ "import/no-anonymous-default-export": "error",
210
+ "import/no-commonjs": "error",
211
+ "import/no-duplicates": "error",
212
+ "import/no-dynamic-require": "error",
213
+ "import/no-empty-named-blocks": "error",
214
+ "import/no-mutable-exports": "error",
215
+ "import/no-named-as-default": "error",
216
+ "import/no-named-as-default-member": "error",
217
+ "import/no-self-import": "error",
218
+ "import/no-webpack-loader-syntax": "error"
219
+ }
220
+ }];
221
+
222
+ //#endregion
223
+ //#region src/configs/jsdoc.ts
224
+ const jsdoc = () => [{
225
+ files: [GLOB_SRC],
226
+ plugins: ["jsdoc"],
227
+ rules: {
228
+ "jsdoc/check-tag-names": "error",
229
+ "jsdoc/empty-tags": "error"
230
+ }
231
+ }];
232
+
233
+ //#endregion
234
+ //#region src/configs/jsx-a11y.ts
235
+ const jsxA11y = () => [{
236
+ files: [GLOB_SRC],
237
+ plugins: ["jsx-a11y"],
238
+ rules: {
239
+ "jsx-a11y/alt-text": "error",
240
+ "jsx-a11y/anchor-has-content": "error",
241
+ "jsx-a11y/anchor-is-valid": ["error", {
242
+ components: ["Link"],
243
+ specialLink: ["to"],
244
+ aspects: [
245
+ "noHref",
246
+ "invalidHref",
247
+ "preferButton"
248
+ ]
249
+ }],
250
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
251
+ "jsx-a11y/aria-props": "error",
252
+ "jsx-a11y/aria-proptypes": "error",
253
+ "jsx-a11y/aria-role": "error",
254
+ "jsx-a11y/aria-unsupported-elements": "error",
255
+ "jsx-a11y/autocomplete-valid": "error",
256
+ "jsx-a11y/click-events-have-key-events": "error",
257
+ "jsx-a11y/heading-has-content": "error",
258
+ "jsx-a11y/html-has-lang": "error",
259
+ "jsx-a11y/iframe-has-title": "error",
260
+ "jsx-a11y/img-redundant-alt": "error",
261
+ "jsx-a11y/label-has-associated-control": "error",
262
+ "jsx-a11y/lang": "error",
263
+ "jsx-a11y/media-has-caption": "error",
264
+ "jsx-a11y/mouse-events-have-key-events": "error",
265
+ "jsx-a11y/no-access-key": "error",
266
+ "jsx-a11y/no-aria-hidden-on-focusable": "error",
267
+ "jsx-a11y/no-autofocus": "error",
268
+ "jsx-a11y/no-distracting-elements": "error",
269
+ "jsx-a11y/no-noninteractive-tabindex": "error",
270
+ "jsx-a11y/no-redundant-roles": "error",
271
+ "jsx-a11y/no-static-element-interactions": "error",
272
+ "jsx-a11y/prefer-tag-over-role": "error",
273
+ "jsx-a11y/role-has-required-aria-props": "error",
274
+ "jsx-a11y/role-supports-aria-props": "error",
275
+ "jsx-a11y/scope": "error",
276
+ "jsx-a11y/tabindex-no-positive": "error"
277
+ }
278
+ }];
279
+
280
+ //#endregion
281
+ //#region src/configs/nelsonlaidev.ts
282
+ const nelsonlaidev = () => [{
283
+ files: [GLOB_SRC],
284
+ jsPlugins: [{
285
+ name: "nelsonlaidev",
286
+ specifier: "@nelsonlaidev/eslint-plugin"
287
+ }],
288
+ rules: {
289
+ "nelsonlaidev/lucide-icon-suffix": "error",
290
+ "nelsonlaidev/lucide-restrict-import": "error",
291
+ "nelsonlaidev/shadcn-cn-wrap-variants": "error",
292
+ "nelsonlaidev/shadcn-cva-variants-suffix": "error",
293
+ "nelsonlaidev/shadcn-prefer-spinner": "error"
294
+ }
295
+ }];
296
+
297
+ //#endregion
298
+ //#region src/configs/nextjs.ts
299
+ const nextjs = () => [{
300
+ files: [GLOB_SRC],
301
+ plugins: ["nextjs"],
302
+ rules: {
303
+ "nextjs/google-font-display": "error",
304
+ "nextjs/google-font-preconnect": "error",
305
+ "nextjs/inline-script-id": "error",
306
+ "nextjs/next-script-for-ga": "error",
307
+ "nextjs/no-assign-module-variable": "error",
308
+ "nextjs/no-async-client-component": "error",
309
+ "nextjs/no-before-interactive-script-outside-document": "error",
310
+ "nextjs/no-css-tags": "error",
311
+ "nextjs/no-document-import-in-page": "error",
312
+ "nextjs/no-duplicate-head": "error",
313
+ "nextjs/no-head-element": "error",
314
+ "nextjs/no-head-import-in-document": "error",
315
+ "nextjs/no-html-link-for-pages": "error",
316
+ "nextjs/no-img-element": "error",
317
+ "nextjs/no-page-custom-font": "error",
318
+ "nextjs/no-script-component-in-head": "error",
319
+ "nextjs/no-styled-jsx-in-document": "error",
320
+ "nextjs/no-sync-scripts": "error",
321
+ "nextjs/no-title-in-document-head": "error",
322
+ "nextjs/no-typos": "error",
323
+ "nextjs/no-unwanted-polyfillio": "error"
324
+ }
325
+ }];
326
+
327
+ //#endregion
328
+ //#region src/configs/node.ts
329
+ const node = () => [{
330
+ files: [GLOB_SRC],
331
+ plugins: ["node"],
332
+ rules: {
333
+ "node/global-require": "error",
334
+ "node/handle-callback-err": "error",
335
+ "node/no-exports-assign": "error",
336
+ "node/no-new-require": "error",
337
+ "node/no-path-concat": "error"
338
+ }
339
+ }];
340
+
341
+ //#endregion
342
+ //#region src/configs/oxc.ts
343
+ const oxc = () => [{
344
+ files: [GLOB_SRC],
345
+ plugins: ["oxc"],
346
+ rules: {
347
+ "approx-constant": "error",
348
+ "bad-array-method-on-arguments": "error",
349
+ "bad-bitwise-operator": "error",
350
+ "bad-char-at-comparison": "error",
351
+ "bad-comparison-sequence": "error",
352
+ "bad-min-max-func": "error",
353
+ "bad-object-literal-comparison": "error",
354
+ "bad-replace-all-arg": "error",
355
+ "const-comparisons": "error",
356
+ "double-comparisons": "error",
357
+ "erasing-op": "error",
358
+ "misrefactored-assign-op": "error",
359
+ "missing-throw": "error",
360
+ "no-accumulating-spread": "error",
361
+ "no-async-endpoint-handlers": "error",
362
+ "no-barrel-file": "error",
363
+ "no-const-enum": "error",
364
+ "no-this-in-exported-function": "error",
365
+ "number-arg-out-of-range": "error",
366
+ "only-used-in-recursion": "error",
367
+ "uninvoked-array-callback": "error"
368
+ }
369
+ }];
370
+
371
+ //#endregion
372
+ //#region src/configs/playwright.ts
373
+ const playwright = (config) => [{
374
+ files: config.files,
375
+ jsPlugins: ["eslint-plugin-playwright"],
376
+ rules: {
377
+ "playwright/consistent-spacing-between-blocks": "error",
378
+ "playwright/expect-expect": ["error", {
379
+ assertFunctionNames: config.assertFunctionNames ?? [],
380
+ assertFunctionPatterns: config.assertFunctionPatterns ?? []
381
+ }],
382
+ "playwright/max-nested-describe": "error",
383
+ "playwright/missing-playwright-await": "error",
384
+ "playwright/no-commented-out-tests": "error",
385
+ "playwright/no-conditional-expect": "error",
386
+ "playwright/no-conditional-in-test": "error",
387
+ "playwright/no-duplicate-hooks": "error",
388
+ "playwright/no-element-handle": "error",
389
+ "playwright/no-eval": "error",
390
+ "playwright/no-focused-test": "error",
391
+ "playwright/no-force-option": "error",
392
+ "playwright/no-get-by-title": "error",
393
+ "playwright/no-nested-step": "error",
394
+ "playwright/no-networkidle": "error",
395
+ "playwright/no-nth-methods": "error",
396
+ "playwright/no-page-pause": "error",
397
+ "playwright/no-raw-locators": "error",
398
+ "playwright/no-restricted-locators": "error",
399
+ "playwright/no-restricted-matchers": "error",
400
+ "playwright/no-skipped-test": "error",
401
+ "playwright/no-slowed-test": "error",
402
+ "playwright/no-standalone-expect": "error",
403
+ "playwright/no-unsafe-references": "error",
404
+ "playwright/no-unused-locators": "error",
405
+ "playwright/no-useless-await": "error",
406
+ "playwright/no-useless-not": "error",
407
+ "playwright/no-wait-for-navigation": "error",
408
+ "playwright/no-wait-for-selector": "error",
409
+ "playwright/no-wait-for-timeout": "error",
410
+ "playwright/prefer-comparison-matcher": "error",
411
+ "playwright/prefer-equality-matcher": "error",
412
+ "playwright/prefer-hooks-in-order": "error",
413
+ "playwright/prefer-hooks-on-top": "error",
414
+ "playwright/prefer-locator": "error",
415
+ "playwright/prefer-lowercase-title": "error",
416
+ "playwright/prefer-native-locators": "error",
417
+ "playwright/prefer-strict-equal": "error",
418
+ "playwright/prefer-to-be": "error",
419
+ "playwright/prefer-to-contain": "error",
420
+ "playwright/prefer-to-have-count": "error",
421
+ "playwright/prefer-to-have-length": "error",
422
+ "playwright/prefer-web-first-assertions": "error",
423
+ "playwright/require-hook": "error",
424
+ "playwright/require-to-throw-message": "error",
425
+ "playwright/require-top-level-describe": "error",
426
+ "playwright/valid-describe-callback": "error",
427
+ "playwright/valid-expect": "error",
428
+ "playwright/valid-expect-in-promise": "error",
429
+ "playwright/valid-test-tags": "error",
430
+ "playwright/valid-title": "error"
431
+ }
432
+ }];
433
+
434
+ //#endregion
435
+ //#region src/configs/promise.ts
436
+ const promise = () => [{
437
+ files: [GLOB_SRC],
438
+ plugins: ["promise"],
439
+ rules: {
440
+ "promise/always-return": "error",
441
+ "promise/avoid-new": "error",
442
+ "promise/catch-or-return": "error",
443
+ "promise/no-callback-in": "error",
444
+ "promise/no-multiple-resolved": "error",
445
+ "promise/no-nesting": "error",
446
+ "promise/no-new-statics": "error",
447
+ "promise/no": "error",
448
+ "promise/no-return-in-finally": "error",
449
+ "promise/no-return-wrap": "error",
450
+ "promise/param-names": "error",
451
+ "promise/prefer-await-to-callbacks": "error",
452
+ "promise/prefer-await-to-then": "error",
453
+ "promise/prefer-catch": "error",
454
+ "promise/spec-only": "error",
455
+ "promise/valid-params": "error"
456
+ }
457
+ }];
458
+
459
+ //#endregion
460
+ //#region src/configs/react.ts
461
+ const react = () => [{
462
+ files: [GLOB_SRC],
463
+ plugins: ["react"],
464
+ jsPlugins: [
465
+ "eslint-plugin-react-x",
466
+ "eslint-plugin-react-rsc",
467
+ "eslint-plugin-react-dom",
468
+ "eslint-plugin-react-web-api",
469
+ "eslint-plugin-react-naming-convention",
470
+ {
471
+ name: "react-hooks-js",
472
+ specifier: "eslint-plugin-react-hooks"
473
+ }
474
+ ],
475
+ rules: {
476
+ "react/button-has-type": "error",
477
+ "react/checked-requires-onchange-or-readonly": "error",
478
+ "react/display-name": ["error", { checkContextObjects: true }],
479
+ "react/iframe-missing-sandbox": "error",
480
+ "react/jsx-boolean-value": "error",
481
+ "react/jsx-curly-brace-presence": ["error", {
482
+ props: "never",
483
+ children: "never",
484
+ propElementValues: "always"
485
+ }],
486
+ "react/jsx-filename-extension": ["error", {
487
+ allow: "as-needed",
488
+ extensions: ["tsx"]
489
+ }],
490
+ "react/jsx-fragments": "error",
491
+ "react/jsx-handler-names": "error",
492
+ "react/jsx-no-comment-textnodes": "error",
493
+ "react/jsx-no-constructed-context-values": "error",
494
+ "react/jsx-no-duplicate-props": "error",
495
+ "react/jsx-no-script-url": "error",
496
+ "react/jsx-no-target-blank": "error",
497
+ "react/jsx-no-undef": "error",
498
+ "react/jsx-no-useless-fragment": "error",
499
+ "react/jsx-pascal-case": "error",
500
+ "react/jsx-props-no-spread-multi": "error",
501
+ "react/no-children-prop": "error",
502
+ "react/no-clone-element": "error",
503
+ "react/no-danger": "error",
504
+ "react/no-danger-with-children": "error",
505
+ "react/no-did-mount-set-state": "error",
506
+ "react/no-direct-mutation-state": "error",
507
+ "react/no-find-dom-node": "error",
508
+ "react/no-is-mounted": "error",
509
+ "react/no-namespace": "error",
510
+ "react/no-react-children": "error",
511
+ "react/no-redundant-should-component-update": "error",
512
+ "react/no-render-return-value": "error",
513
+ "react/no-set-state": "error",
514
+ "react/no-string-refs": "error",
515
+ "react/no-this-in-sfc": "error",
516
+ "react/no-unknown-property": "error",
517
+ "react/no-unsafe": "error",
518
+ "react/no-will-update-set-state": "error",
519
+ "react/require-render-return": "error",
520
+ "react/rules-of-hooks": "error",
521
+ "react/self-closing-comp": "error",
522
+ "react/state-in-constructor": "error",
523
+ "react-x/jsx-dollar": "error",
524
+ "react-x/jsx-key-before-spread": "error",
525
+ "react-x/exhaustive-deps": "error",
526
+ "react-x/no-access-state-in-setstate": "error",
527
+ "react-x/no-children-count": "error",
528
+ "react-x/no-children-for-each": "error",
529
+ "react-x/no-children-map": "error",
530
+ "react-x/no-children-only": "error",
531
+ "react-x/no-children-to-array": "error",
532
+ "react-x/no-class-component": "error",
533
+ "react-x/no-component-will-mount": "error",
534
+ "react-x/no-component-will-receive-props": "error",
535
+ "react-x/no-component-will-update": "error",
536
+ "react-x/no-context-provider": "error",
537
+ "react-x/no-create-ref": "error",
538
+ "react-x/no-duplicate-key": "error",
539
+ "react-x/no-forward-ref": "error",
540
+ "react-x/no-missing-key": "error",
541
+ "react-x/no-misused-capture-owner-stack": "error",
542
+ "react-x/no-set-state-in-component-did-update": "error",
543
+ "react-x/no-unnecessary-use-callback": "error",
544
+ "react-x/no-unnecessary-use-memo": "error",
545
+ "react-x/no-unnecessary-use-prefix": "error",
546
+ "react-x/no-unstable-default-props": "error",
547
+ "react-x/no-unused-class-component-members": "error",
548
+ "react-x/no-unused-state": "error",
549
+ "react-x/no-use-context": "error",
550
+ "react-x/prefer-destructuring-assignment": "error",
551
+ "react-x/prefer-namespace-import": "error",
552
+ "react-x/use-state": "error",
553
+ "react-rsc/function-definition": "error",
554
+ "react-dom/no-flush-sync": "error",
555
+ "react-dom/no-hydrate": "error",
556
+ "react-dom/no-render": "error",
557
+ "react-dom/no-string-style-prop": "error",
558
+ "react-dom/no-unsafe-iframe-sandbox": "error",
559
+ "react-dom/no-use-form-state": "error",
560
+ "react-dom/no-void-elements-with-children": "error",
561
+ "react-dom/prefer-namespace-import": "error",
562
+ "react-web-api/no-leaked-event-listener": "error",
563
+ "react-web-api/no-leaked-interval": "error",
564
+ "react-web-api/no-leaked-resize-observer": "error",
565
+ "react-web-api/no-leaked-timeout": "error",
566
+ "react-naming-convention/context-name": "error",
567
+ "react-naming-convention/id-name": "error",
568
+ "react-naming-convention/ref-name": "error",
569
+ "react-hooks-js/config": "error",
570
+ "react-hooks-js/gating": "error",
571
+ "react-hooks-js/globals": "error",
572
+ "react-hooks-js/incompatible-library": "error",
573
+ "react-hooks-js/preserve-manual-memoization": "error",
574
+ "react-x/error-boundaries": "error",
575
+ "react-x/component-hook-factories": "error",
576
+ "react-x/immutability": "error",
577
+ "react-x/purity": "error",
578
+ "react-x/refs": "error",
579
+ "react-x/set-state-in-effect": "error",
580
+ "react-x/set-state-in-render": "error",
581
+ "react-x/no-nested-component-definitions": "error",
582
+ "react-x/no-nested-lazy-component-declarations": "error",
583
+ "react-x/unsupported-syntax": "error",
584
+ "react-x/use-memo": "error"
585
+ }
586
+ }];
587
+
588
+ //#endregion
589
+ //#region src/configs/regexp.ts
590
+ const regexp = () => [{
591
+ files: [GLOB_SRC],
592
+ jsPlugins: ["eslint-plugin-regexp"],
593
+ rules: {
594
+ "regexp/confusing-quantifier": "error",
595
+ "regexp/control-character-escape": "error",
596
+ "regexp/match-any": "error",
597
+ "regexp/negation": "error",
598
+ "regexp/no-contradiction-with-assertion": "error",
599
+ "regexp/no-dupe-characters-character-class": "error",
600
+ "regexp/no-dupe-disjunctions": "error",
601
+ "regexp/no-empty-alternative": "error",
602
+ "regexp/no-empty-capturing-group": "error",
603
+ "regexp/no-empty-character-class": "error",
604
+ "regexp/no-empty-group": "error",
605
+ "regexp/no-empty-lookarounds-assertion": "error",
606
+ "regexp/no-empty-string-literal": "error",
607
+ "regexp/no-escape-backspace": "error",
608
+ "regexp/no-extra-lookaround-assertions": "error",
609
+ "regexp/no-invalid-regexp": "error",
610
+ "regexp/no-invisible-character": "error",
611
+ "regexp/no-lazy-ends": "error",
612
+ "regexp/no-legacy-features": "error",
613
+ "regexp/no-misleading-capturing-group": "error",
614
+ "regexp/no-misleading-unicode-character": "error",
615
+ "regexp/no-missing-g-flag": "error",
616
+ "regexp/no-non-standard-flag": "error",
617
+ "regexp/no-obscure-range": "error",
618
+ "regexp/no-optional-assertion": "error",
619
+ "regexp/no-potentially-useless-backreference": "error",
620
+ "regexp/no-super-linear-backtracking": "error",
621
+ "regexp/no-trivially-nested-assertion": "error",
622
+ "regexp/no-trivially-nested-quantifier": "error",
623
+ "regexp/no-unused-capturing-group": "error",
624
+ "regexp/no-useless-assertions": "error",
625
+ "regexp/no-useless-backreference": "error",
626
+ "regexp/no-useless-character-class": "error",
627
+ "regexp/no-useless-dollar-replacements": "error",
628
+ "regexp/no-useless-escape": "error",
629
+ "regexp/no-useless-flag": "error",
630
+ "regexp/no-useless-lazy": "error",
631
+ "regexp/no-useless-non-capturing-group": "error",
632
+ "regexp/no-useless-quantifier": "error",
633
+ "regexp/no-useless-range": "error",
634
+ "regexp/no-useless-set-operand": "error",
635
+ "regexp/no-useless-string-literal": "error",
636
+ "regexp/no-useless-two-nums-quantifier": "error",
637
+ "regexp/no-zero-quantifier": "error",
638
+ "regexp/optimal-lookaround-quantifier": "error",
639
+ "regexp/optimal-quantifier-concatenation": "error",
640
+ "regexp/prefer-character-class": "error",
641
+ "regexp/prefer-d": "error",
642
+ "regexp/prefer-plus-quantifier": "error",
643
+ "regexp/prefer-predefined-assertion": "error",
644
+ "regexp/prefer-question-quantifier": "error",
645
+ "regexp/prefer-range": "error",
646
+ "regexp/prefer-set-operation": "error",
647
+ "regexp/prefer-star-quantifier": "error",
648
+ "regexp/prefer-unicode-codepoint-escapes": "error",
649
+ "regexp/prefer-w": "error",
650
+ "regexp/simplify-set-operations": "error",
651
+ "regexp/sort-flags": "error",
652
+ "regexp/strict": "error",
653
+ "regexp/use-ignore-case": "error"
654
+ }
655
+ }];
656
+
657
+ //#endregion
658
+ //#region src/configs/sonarjs.ts
659
+ const sonarjs = () => [{
660
+ files: [GLOB_SRC],
661
+ jsPlugins: ["eslint-plugin-sonarjs"],
662
+ rules: {
663
+ "sonarjs/class-name": "error",
664
+ "sonarjs/no-fallthrough": "error",
665
+ "sonarjs/no-equals-in-for-termination": "error",
666
+ "sonarjs/no-extra-arguments": "error",
667
+ "sonarjs/no-labels": "error",
668
+ "sonarjs/no-nested-assignment": "error",
669
+ "sonarjs/no-redundant-boolean": "error",
670
+ "sonarjs/prefer-single-boolean-return": "error",
671
+ "sonarjs/unused-import": "error",
672
+ "sonarjs/fixme-tag": "error",
673
+ "sonarjs/todo-tag": "error",
674
+ "sonarjs/no-case-label-in-switch": "error",
675
+ "sonarjs/no-parameter-reassignment": "error",
676
+ "sonarjs/prefer-while": "error",
677
+ "sonarjs/no-small-switch": "error",
678
+ "sonarjs/no-hardcoded-ip": "error",
679
+ "sonarjs/label-position": "error",
680
+ "sonarjs/public-static-readonly": "error",
681
+ "sonarjs/call-argument-line": "error",
682
+ "sonarjs/max-switch-cases": "error",
683
+ "sonarjs/no-unused-vars": "error",
684
+ "sonarjs/function-inside-loop": "error",
685
+ "sonarjs/future-reserved-words": "error",
686
+ "sonarjs/bitwise-operators": "error",
687
+ "sonarjs/no-primitive-wrappers": "error",
688
+ "sonarjs/no-skipped-tests": "error",
689
+ "sonarjs/no-identical-expressions": "error",
690
+ "sonarjs/constructor-for-side-effects": "error",
691
+ "sonarjs/no-dead-store": "error",
692
+ "sonarjs/no-identical-conditions": "error",
693
+ "sonarjs/no-duplicated-branches": "error",
694
+ "sonarjs/no-inverted-boolean-check": "error",
695
+ "sonarjs/misplaced-loop-counter": "error",
696
+ "sonarjs/no-nested-functions": "error",
697
+ "sonarjs/no-hardcoded-passwords": "error",
698
+ "sonarjs/sql-queries": "error",
699
+ "sonarjs/insecure-cookie": "error",
700
+ "sonarjs/no-useless-increment": "error",
701
+ "sonarjs/no-globals-shadowing": "error",
702
+ "sonarjs/no-empty-test-file": "error",
703
+ "sonarjs/no-ignored-return": "error",
704
+ "sonarjs/for-loop-increment-sign": "error",
705
+ "sonarjs/null-dereference": "error",
706
+ "sonarjs/no-selector-parameter": "error",
707
+ "sonarjs/updated-loop-counter": "error",
708
+ "sonarjs/block-scoped-var": "error",
709
+ "sonarjs/no-ignored-exceptions": "error",
710
+ "sonarjs/no-gratuitous-expressions": "error",
711
+ "sonarjs/file-uploads": "error",
712
+ "sonarjs/file-permissions": "error",
713
+ "sonarjs/no-empty-character-class": "error",
714
+ "sonarjs/no-unenclosed-multiline-block": "error",
715
+ "sonarjs/index-of-compare-to-positive-number": "error",
716
+ "sonarjs/assertions-in-tests": "error",
717
+ "sonarjs/no-implicit-global": "error",
718
+ "sonarjs/no-useless-catch": "error",
719
+ "sonarjs/xml-parser-xxe": "error",
720
+ "sonarjs/non-existent-operator": "error",
721
+ "sonarjs/post-message": "error",
722
+ "sonarjs/no-array-delete": "error",
723
+ "sonarjs/no-alphabetical-sort": "error",
724
+ "sonarjs/no-incomplete-assertions": "error",
725
+ "sonarjs/no-global-this": "error",
726
+ "sonarjs/new-operator-misuse": "error",
727
+ "sonarjs/no-delete-var": "error",
728
+ "sonarjs/cookie-no-httponly": "error",
729
+ "sonarjs/no-nested-conditional": "error",
730
+ "sonarjs/different-types-comparison": "error",
731
+ "sonarjs/inverted-assertion-arguments": "error",
732
+ "sonarjs/updated-const-var": "error",
733
+ "sonarjs/no-invariant-returns": "error",
734
+ "sonarjs/generator-without-yield": "error",
735
+ "sonarjs/no-associative-arrays": "error",
736
+ "sonarjs/comma-or-logical-or-case": "error",
737
+ "sonarjs/no-redundant-jump": "error",
738
+ "sonarjs/inconsistent-function-call": "error",
739
+ "sonarjs/no-use-of-empty-return-value": "error",
740
+ "sonarjs/cognitive-complexity": ["error", 20],
741
+ "sonarjs/argument-type": "error",
742
+ "sonarjs/in-operator-type-error": "error",
743
+ "sonarjs/array-callback-without-return": "error",
744
+ "sonarjs/no-all-duplicated-branches": "error",
745
+ "sonarjs/no-same-line-conditional": "error",
746
+ "sonarjs/no-collection-size-mischeck": "error",
747
+ "sonarjs/no-unthrown-error": "error",
748
+ "sonarjs/no-unused-collection": "error",
749
+ "sonarjs/no-os-command-from-path": "error",
750
+ "sonarjs/no-misleading-array-reverse": "error",
751
+ "sonarjs/no-element-overwrite": "error",
752
+ "sonarjs/no-identical-functions": "error",
753
+ "sonarjs/no-empty-collection": "error",
754
+ "sonarjs/no-redundant-assignments": "error",
755
+ "sonarjs/prefer-type-guard": "error",
756
+ "sonarjs/use-type-alias": "error",
757
+ "sonarjs/no-useless-intersection": "error",
758
+ "sonarjs/weak-ssl": "error",
759
+ "sonarjs/no-weak-keys": "error",
760
+ "sonarjs/csrf": "error",
761
+ "sonarjs/production-debug": "error",
762
+ "sonarjs/prefer-default-last": "error",
763
+ "sonarjs/no-in-misuse": "error",
764
+ "sonarjs/no-duplicate-in-composite": "error",
765
+ "sonarjs/no-undefined-argument": "error",
766
+ "sonarjs/no-nested-template-literals": "error",
767
+ "sonarjs/prefer-promise-shorthand": "error",
768
+ "sonarjs/os-command": "error",
769
+ "sonarjs/no-redundant-optional": "error",
770
+ "sonarjs/hashing": "error",
771
+ "sonarjs/no-try-promise": "error",
772
+ "sonarjs/unverified-certificate": "error",
773
+ "sonarjs/no-unsafe-unzip": "error",
774
+ "sonarjs/cors": "error",
775
+ "sonarjs/link-with-target-blank": "error",
776
+ "sonarjs/disabled-auto-escaping": "error",
777
+ "sonarjs/table-header": "error",
778
+ "sonarjs/no-table-as-layout": "error",
779
+ "sonarjs/table-header-reference": "error",
780
+ "sonarjs/object-alt-content": "error",
781
+ "sonarjs/no-clear-text-protocols": "error",
782
+ "sonarjs/publicly-writable-directories": "error",
783
+ "sonarjs/unverified-hostname": "error",
784
+ "sonarjs/encryption-secure-mode": "error",
785
+ "sonarjs/no-weak-cipher": "error",
786
+ "sonarjs/no-intrusive-permissions": "error",
787
+ "sonarjs/insecure-jwt-token": "error",
788
+ "sonarjs/x-powered-by": "error",
789
+ "sonarjs/hidden-files": "error",
790
+ "sonarjs/content-length": "error",
791
+ "sonarjs/disabled-resource-integrity": "error",
792
+ "sonarjs/content-security-policy": "error",
793
+ "sonarjs/no-mixed-content": "error",
794
+ "sonarjs/frame-ancestors": "error",
795
+ "sonarjs/no-mime-sniff": "error",
796
+ "sonarjs/no-referrer-policy": "error",
797
+ "sonarjs/strict-transport-security": "error",
798
+ "sonarjs/confidential-information-logging": "error",
799
+ "sonarjs/no-ip-forward": "error",
800
+ "sonarjs/empty-string-repetition": "error",
801
+ "sonarjs/regex-complexity": "error",
802
+ "sonarjs/anchor-precedence": "error",
803
+ "sonarjs/slow-regex": "error",
804
+ "sonarjs/no-invalid-regexp": "error",
805
+ "sonarjs/unused-named-groups": "error",
806
+ "sonarjs/no-same-argument-assert": "error",
807
+ "sonarjs/no-misleading-character-class": "error",
808
+ "sonarjs/duplicates-in-character-class": "error",
809
+ "sonarjs/session-regeneration": "error",
810
+ "sonarjs/test-check-exception": "error",
811
+ "sonarjs/stable-tests": "error",
812
+ "sonarjs/no-empty-after-reluctant": "error",
813
+ "sonarjs/single-character-alternation": "error",
814
+ "sonarjs/no-code-after-done": "error",
815
+ "sonarjs/disabled-timeout": "error",
816
+ "sonarjs/chai-determinate-assertion": "error",
817
+ "sonarjs/aws-s3-bucket-insecure-http": "error",
818
+ "sonarjs/aws-s3-bucket-versioning": "error",
819
+ "sonarjs/aws-s3-bucket-granted-access": "error",
820
+ "sonarjs/no-angular-bypass-sanitization": "error",
821
+ "sonarjs/aws-iam-public-access": "error",
822
+ "sonarjs/aws-ec2-unencrypted-ebs-volume": "error",
823
+ "sonarjs/aws-s3-bucket-public-access": "error",
824
+ "sonarjs/aws-iam-all-privileges": "error",
825
+ "sonarjs/aws-rds-unencrypted-databases": "error",
826
+ "sonarjs/aws-opensearchservice-domain": "error",
827
+ "sonarjs/aws-iam-privilege-escalation": "error",
828
+ "sonarjs/aws-sagemaker-unencrypted-notebook": "error",
829
+ "sonarjs/aws-restricted-ip-admin-access": "error",
830
+ "sonarjs/no-empty-alternatives": "error",
831
+ "sonarjs/no-control-regex": "error",
832
+ "sonarjs/no-regex-spaces": "error",
833
+ "sonarjs/aws-sns-unencrypted-topics": "error",
834
+ "sonarjs/existing-groups": "error",
835
+ "sonarjs/aws-ec2-rds-dms-public": "error",
836
+ "sonarjs/aws-sqs-unencrypted-queue": "error",
837
+ "sonarjs/no-empty-group": "error",
838
+ "sonarjs/aws-efs-unencrypted": "error",
839
+ "sonarjs/aws-apigateway-public-api": "error",
840
+ "sonarjs/stateful-regex": "error",
841
+ "sonarjs/concise-regex": "error",
842
+ "sonarjs/single-char-in-character-classes": "error",
843
+ "sonarjs/no-hardcoded-secrets": "error",
844
+ "sonarjs/no-exclusive-tests": "error",
845
+ "sonarjs/hardcoded-secret-signatures": "error",
846
+ "sonarjs/jsx-no-leaked-render": "error",
847
+ "sonarjs/no-hook-setter-in-body": "error",
848
+ "sonarjs/no-useless-react-setstate": "error",
849
+ "sonarjs/no-uniq-key": "error",
850
+ "sonarjs/redundant-type-aliases": "error",
851
+ "sonarjs/prefer-regexp-exec": "error",
852
+ "sonarjs/no-internal-api-use": "error",
853
+ "sonarjs/no-literal-call": "error",
854
+ "sonarjs/reduce-initial-value": "error",
855
+ "sonarjs/no-async-constructor": "error",
856
+ "sonarjs/review-blockchain-mnemonic": "error",
857
+ "sonarjs/dynamically-constructed-templates": "error",
858
+ "sonarjs/no-session-cookies-on-static-assets": "error"
859
+ }
860
+ }];
861
+
862
+ //#endregion
863
+ //#region src/configs/stylistic.ts
864
+ const stylistic = () => [{
865
+ files: [GLOB_SRC],
866
+ jsPlugins: ["@stylistic/eslint-plugin"],
867
+ rules: { "@stylistic/multiline-comment-style": ["error", "separate-lines"] }
868
+ }];
869
+
870
+ //#endregion
871
+ //#region src/configs/tailwindcss.ts
872
+ const tailwindcss = (options) => {
873
+ const disableShorthand = options.canonical?.logical ?? true;
874
+ return [{
875
+ files: [GLOB_SRC],
876
+ jsPlugins: ["eslint-plugin-better-tailwindcss"],
877
+ rules: {
878
+ "better-tailwindcss/enforce-canonical-classes": ["error", {
879
+ collapse: options.canonical?.collapse ?? true,
880
+ logical: options.canonical?.logical ?? true
881
+ }],
882
+ "better-tailwindcss/enforce-consistent-important-position": "off",
883
+ "better-tailwindcss/enforce-consistent-variable-syntax": "off",
884
+ "better-tailwindcss/enforce-shorthand-classes": disableShorthand ? "off" : "error",
885
+ "better-tailwindcss/enforce-consistent-class-order": ["error", {
886
+ order: options.classOrder?.order ?? "official",
887
+ componentClassOrder: options.classOrder?.componentOrder ?? "preserve",
888
+ componentClassPosition: options.classOrder?.componentPosition ?? "start",
889
+ unknownClassOrder: options.classOrder?.unknownOrder ?? "preserve",
890
+ unknownClassPosition: options.classOrder?.unknownPosition ?? "start"
891
+ }],
892
+ "better-tailwindcss/no-conflicting-classes": "error",
893
+ "better-tailwindcss/no-deprecated-classes": "error",
894
+ "better-tailwindcss/no-duplicate-classes": "error",
895
+ "better-tailwindcss/no-restricted-classes": ["error", { restrict: options.restrict ?? [] }],
896
+ "better-tailwindcss/no-unknown-classes": ["error", { ignore: options.ignore ?? [] }],
897
+ "better-tailwindcss/no-unnecessary-whitespace": ["error", { allowMultiline: options.whitespace?.allowMultiline ?? true }]
898
+ }
899
+ }];
900
+ };
901
+
902
+ //#endregion
903
+ //#region src/configs/typescript.ts
904
+ const typescript = () => [{
905
+ files: [GLOB_SRC],
906
+ plugins: ["typescript"],
907
+ rules: {
908
+ "typescript/adjacent-overload-signatures": "error",
909
+ "typescript/array-type": ["error", {
910
+ default: "array-simple",
911
+ readonly: "array-simple"
912
+ }],
913
+ "typescript/await-thenable": "error",
914
+ "typescript/ban-ts-comment": "error",
915
+ "typescript/ban-tslint-comment": "error",
916
+ "typescript/ban-types": "error",
917
+ "typescript/class-literal-property-style": "error",
918
+ "typescript/consistent-generic-constructors": "error",
919
+ "typescript/consistent-indexed-object-style": "error",
920
+ "typescript/consistent-type-assertions": "error",
921
+ "typescript/consistent-type-definitions": ["error", "type"],
922
+ "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
923
+ "typescript/consistent-type-imports": ["error", {
924
+ prefer: "type-imports",
925
+ fixStyle: "separate-type-imports"
926
+ }],
927
+ "typescript/dot-notation": "error",
928
+ "typescript/no-array-delete": "error",
929
+ "typescript/no-base-to-string": "error",
930
+ "typescript/no-confusing-non-null-assertion": "error",
931
+ "typescript/no-confusing-void-expression": "error",
932
+ "typescript/no-deprecated": "error",
933
+ "typescript/no-duplicate-enum-values": "error",
934
+ "typescript/no-duplicate-type-constituents": "error",
935
+ "typescript/no-dynamic-delete": "error",
936
+ "typescript/no-empty-interface": "error",
937
+ "typescript/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends" }],
938
+ "typescript/no-explicit-any": "error",
939
+ "typescript/no-extra-non-null-assertion": "error",
940
+ "typescript/no-extraneous-class": "error",
941
+ "typescript/no-floating-promises": "error",
942
+ "typescript/no-for-in-array": "error",
943
+ "typescript/no-implied-eval": "error",
944
+ "typescript/no-import-type-side-effects": "error",
945
+ "typescript/no-inferrable-types": "error",
946
+ "typescript/no-invalid-void-type": "error",
947
+ "typescript/no-meaningless-void-operator": "error",
948
+ "typescript/no-misused-new": "error",
949
+ "typescript/no-misused-promises": ["error", { checksVoidReturn: false }],
950
+ "typescript/no-misused-spread": "error",
951
+ "typescript/no-mixed-enums": "error",
952
+ "typescript/no-namespace": "error",
953
+ "typescript/no-non-null-asserted-nullish-coalescing": "error",
954
+ "typescript/no-non-null-asserted-optional-chain": "error",
955
+ "typescript/no-non-null-assertion": "error",
956
+ "typescript/no-redundant-type-constituents": "error",
957
+ "typescript/no-require-imports": "error",
958
+ "typescript/no-restricted-types": "error",
959
+ "typescript/no-this-alias": "error",
960
+ "typescript/no-unnecessary-boolean-literal-compare": "error",
961
+ "typescript/no-unnecessary-condition": "error",
962
+ "typescript/no-unnecessary-parameter-property-assignment": "error",
963
+ "typescript/no-unnecessary-qualifier": "error",
964
+ "typescript/no-unnecessary-template-expression": "error",
965
+ "typescript/no-unnecessary-type-arguments": "error",
966
+ "typescript/no-unnecessary-type-assertion": "error",
967
+ "typescript/no-unnecessary-type-constraint": "error",
968
+ "typescript/no-unnecessary-type-conversion": "error",
969
+ "typescript/no-unnecessary-type-parameters": "error",
970
+ "typescript/no-unsafe-argument": "error",
971
+ "typescript/no-unsafe-assignment": "error",
972
+ "typescript/no-unsafe-call": "error",
973
+ "typescript/no-unsafe-declaration-merging": "error",
974
+ "typescript/no-unsafe-enum-comparison": "error",
975
+ "typescript/no-unsafe-function-type": "error",
976
+ "typescript/no-unsafe-member-access": "error",
977
+ "typescript/no-unsafe-return": "error",
978
+ "typescript/no-unsafe-unary-minus": "error",
979
+ "typescript/no-useless-default-assignment": "error",
980
+ "typescript/no-useless-empty-export": "error",
981
+ "typescript/no-var-requires": "error",
982
+ "typescript/no-wrapper-object-types": "error",
983
+ "typescript/non-nullable-type-assertion-style": "error",
984
+ "typescript/only-throw-error": ["error", { allow: [{
985
+ from: "package",
986
+ package: "@tanstack/router-core",
987
+ name: "Redirect"
988
+ }] }],
989
+ "typescript/parameter-properties": "error",
990
+ "typescript/prefer-as-const": "error",
991
+ "typescript/prefer-enum-initializers": "error",
992
+ "typescript/prefer-find": "error",
993
+ "typescript/prefer-for-of": "error",
994
+ "typescript/prefer-function-type": "error",
995
+ "typescript/prefer-includes": "error",
996
+ "typescript/prefer-literal-enum-member": "error",
997
+ "typescript/prefer-namespace-keyword": "error",
998
+ "typescript/prefer-nullish-coalescing": "error",
999
+ "typescript/prefer-optional-chain": "error",
1000
+ "typescript/prefer-promise-reject-errors": "error",
1001
+ "typescript/prefer-readonly": "error",
1002
+ "typescript/prefer-reduce-type-parameter": "error",
1003
+ "typescript/prefer-regexp-exec": "error",
1004
+ "typescript/prefer-return-this-type": "error",
1005
+ "typescript/prefer-string-starts-ends-with": "error",
1006
+ "typescript/prefer-ts-expect-error": "error",
1007
+ "typescript/promise-function-async": "error",
1008
+ "typescript/related-getter-setter-pairs": "error",
1009
+ "typescript/require-array-sort-compare": "error",
1010
+ "typescript/require-await": "error",
1011
+ "typescript/restrict-plus-operands": "error",
1012
+ "typescript/restrict-template-expressions": ["error", { allowNumber: true }],
1013
+ "typescript/return-await": "error",
1014
+ "typescript/switch-exhaustiveness-check": "error",
1015
+ "typescript/triple-slash-reference": "error",
1016
+ "typescript/unbound-method": "error",
1017
+ "typescript/unified-signatures": "error",
1018
+ "typescript/use-unknown-in-catch-callback-variable": "error"
1019
+ }
1020
+ }, {
1021
+ files: ["**/*.d.ts"],
1022
+ plugins: ["typescript"],
1023
+ rules: {
1024
+ "typescript/consistent-type-definitions": "off",
1025
+ "typescript/consistent-indexed-object-style": "off"
1026
+ }
1027
+ }];
1028
+
1029
+ //#endregion
1030
+ //#region src/configs/unicorn.ts
1031
+ const unicorn = () => [{
1032
+ files: [GLOB_SRC],
1033
+ plugins: ["unicorn"],
1034
+ rules: {
1035
+ "unicorn/catch-error-name": "error",
1036
+ "unicorn/consistent-assert": "error",
1037
+ "unicorn/consistent-date-clone": "error",
1038
+ "unicorn/consistent-empty-array-spread": "error",
1039
+ "unicorn/consistent-existence-index-check": "error",
1040
+ "unicorn/consistent-function-scoping": "error",
1041
+ "unicorn/empty-brace-spaces": "error",
1042
+ "unicorn/error-message": "error",
1043
+ "unicorn/escape-case": "error",
1044
+ "unicorn/explicit-length-check": "error",
1045
+ "unicorn/filename-case": "error",
1046
+ "unicorn/new-for-builtins": "error",
1047
+ "unicorn/no-abusive-eslint-disable": "error",
1048
+ "unicorn/no-accessor-recursion": "error",
1049
+ "unicorn/no-anonymous-default-export": "error",
1050
+ "unicorn/no-array-callback-reference": "error",
1051
+ "unicorn/no-array-for-each": "error",
1052
+ "unicorn/no-array-method-this-argument": "error",
1053
+ "unicorn/no-array-reduce": "error",
1054
+ "unicorn/no-array-reverse": "error",
1055
+ "unicorn/no-array-sort": "error",
1056
+ "unicorn/no-await-expression-member": "error",
1057
+ "unicorn/no-await-in-promise-methods": "error",
1058
+ "unicorn/no-console-spaces": "error",
1059
+ "unicorn/no-empty-file": "error",
1060
+ "unicorn/no-hex-escape": "error",
1061
+ "unicorn/no-immediate-mutation": "error",
1062
+ "unicorn/no-instanceof-array": "error",
1063
+ "unicorn/no-instanceof-builtins": "error",
1064
+ "unicorn/no-invalid-fetch-options": "error",
1065
+ "unicorn/no-invalid-remove-event-listener": "error",
1066
+ "unicorn/no-length-as-slice-end": "error",
1067
+ "unicorn/no-lonely-if": "error",
1068
+ "unicorn/no-magic-array-flat-depth": "error",
1069
+ "unicorn/no-negation-in-equality-check": "error",
1070
+ "unicorn/no-nested-ternary": "error",
1071
+ "unicorn/no-new-array": "error",
1072
+ "unicorn/no-new-buffer": "error",
1073
+ "unicorn/no-object-as-default-parameter": "error",
1074
+ "unicorn/no-single-promise-in-promise-methods": "error",
1075
+ "unicorn/no-static-only-class": "error",
1076
+ "unicorn/no-thenable": "error",
1077
+ "unicorn/no-this-assignment": "error",
1078
+ "unicorn/no-typeof-undefined": "error",
1079
+ "unicorn/no-unnecessary-array-flat-depth": "error",
1080
+ "unicorn/no-unnecessary-array-splice-count": "error",
1081
+ "unicorn/no-unnecessary-await": "error",
1082
+ "unicorn/no-unnecessary-slice-end": "error",
1083
+ "unicorn/no-unreadable-array-destructuring": "error",
1084
+ "unicorn/no-unreadable-iife": "error",
1085
+ "unicorn/no-useless-collection-argument": "error",
1086
+ "unicorn/no-useless-error-capture-stack-trace": "error",
1087
+ "unicorn/no-useless-fallback-in-spread": "error",
1088
+ "unicorn/no-useless-length-check": "error",
1089
+ "unicorn/no-useless-promise-resolve-reject": "error",
1090
+ "unicorn/no-useless-spread": "error",
1091
+ "unicorn/no-useless-switch-case": "error",
1092
+ "unicorn/no-useless-undefined": "error",
1093
+ "unicorn/no-zero-fractions": "error",
1094
+ "unicorn/number-literal-case": "error",
1095
+ "unicorn/numeric-separators-style": "error",
1096
+ "unicorn/prefer-add-event-listener": "error",
1097
+ "unicorn/prefer-array-find": "error",
1098
+ "unicorn/prefer-array-flat": "error",
1099
+ "unicorn/prefer-array-flat-map": "error",
1100
+ "unicorn/prefer-array-index-of": "error",
1101
+ "unicorn/prefer-array-some": "error",
1102
+ "unicorn/prefer-at": "error",
1103
+ "unicorn/prefer-bigint-literals": "error",
1104
+ "unicorn/prefer-blob-reading-methods": "error",
1105
+ "unicorn/prefer-class-fields": "error",
1106
+ "unicorn/prefer-classlist-toggle": "error",
1107
+ "unicorn/prefer-code-point": "error",
1108
+ "unicorn/prefer-date-now": "error",
1109
+ "unicorn/prefer-default-parameters": "error",
1110
+ "unicorn/prefer-dom-node-append": "error",
1111
+ "unicorn/prefer-dom-node-dataset": "error",
1112
+ "unicorn/prefer-dom-node-remove": "error",
1113
+ "unicorn/prefer-dom-node-text-content": "error",
1114
+ "unicorn/prefer-event-target": "error",
1115
+ "unicorn/prefer-global-this": "error",
1116
+ "unicorn/prefer-includes": "error",
1117
+ "unicorn/prefer-keyboard-event-key": "error",
1118
+ "unicorn/prefer-logical-operator-over-ternary": "error",
1119
+ "unicorn/prefer-math-min-max": "error",
1120
+ "unicorn/prefer-math-trunc": "error",
1121
+ "unicorn/prefer-modern-dom-apis": "error",
1122
+ "unicorn/prefer-modern-math-apis": "error",
1123
+ "unicorn/prefer-module": "error",
1124
+ "unicorn/prefer-native-coercion-functions": "error",
1125
+ "unicorn/prefer-negative-index": "error",
1126
+ "unicorn/prefer-node-protocol": "error",
1127
+ "unicorn/prefer-number-properties": "error",
1128
+ "unicorn/prefer-object-from-entries": "error",
1129
+ "unicorn/prefer-optional-catch-binding": "error",
1130
+ "unicorn/prefer-prototype-methods": "error",
1131
+ "unicorn/prefer-query-selector": "error",
1132
+ "unicorn/prefer-reflect-apply": "error",
1133
+ "unicorn/prefer-regexp-test": "error",
1134
+ "unicorn/prefer-response-static-json": "error",
1135
+ "unicorn/prefer-set-has": "error",
1136
+ "unicorn/prefer-set-size": "error",
1137
+ "unicorn/prefer-spread": "error",
1138
+ "unicorn/prefer-string-replace-all": "error",
1139
+ "unicorn/prefer-string-slice": "error",
1140
+ "unicorn/prefer-string-starts-ends-with": "error",
1141
+ "unicorn/prefer-string-trim-start-end": "error",
1142
+ "unicorn/prefer-structured-clone": "error",
1143
+ "unicorn/prefer-ternary": "error",
1144
+ "unicorn/prefer-top-level-await": "error",
1145
+ "unicorn/prefer-type-error": "error",
1146
+ "unicorn/relative-url-style": "error",
1147
+ "unicorn/require-array-join-separator": "error",
1148
+ "unicorn/require-module-attributes": "error",
1149
+ "unicorn/require-module-specifiers": "error",
1150
+ "unicorn/require-number-to-fixed-digits-argument": "error",
1151
+ "unicorn/require-post-message-target-origin": "error",
1152
+ "unicorn/switch-case-braces": "error",
1153
+ "unicorn/text-encoding-identifier-case": ["error", { withDash: true }],
1154
+ "unicorn/throw-new-error": "error"
1155
+ }
1156
+ }];
1157
+
1158
+ //#endregion
1159
+ //#region src/configs/vitest.ts
1160
+ const vitest = (config) => [{
1161
+ files: config.files,
1162
+ plugins: ["vitest"],
1163
+ rules: {
1164
+ "vitest/consistent-each-for": "error",
1165
+ "vitest/consistent-test-filename": "error",
1166
+ "vitest/consistent-vitest-vi": "error",
1167
+ "vitest/hoisted-apis-on-top": "error",
1168
+ "vitest/no-conditional-tests": "error",
1169
+ "vitest/no-import-node-test": "error",
1170
+ "vitest/prefer-called-times": "error",
1171
+ "vitest/prefer-describe-function-title": "error",
1172
+ "vitest/prefer-expect-type-of": "error",
1173
+ "vitest/prefer-to-be-object": "error",
1174
+ "vitest/require-local-test-context-for-concurrent-snapshots": "error",
1175
+ "vitest/warn-todo": "error"
1176
+ }
1177
+ }];
1178
+
1179
+ //#endregion
1180
+ //#region src/configs/zod.ts
1181
+ const zod = () => [{
1182
+ files: [GLOB_SRC],
1183
+ jsPlugins: ["eslint-plugin-import-zod"],
1184
+ rules: { "import-zod/prefer-zod-namespace": "error" }
1185
+ }];
1186
+
1187
+ //#endregion
1188
+ //#region src/base.ts
1189
+ const createSelectors = (names, kind) => names.map((name) => ({
1190
+ name,
1191
+ kind,
1192
+ match: [{ type: MatcherType.String }, { type: MatcherType.ObjectValue }]
1193
+ }));
1194
+ const concatArrays = (target, source) => {
1195
+ if (Array.isArray(target) && Array.isArray(source)) return [...target, ...source];
1196
+ };
1197
+ const defineConfig = (config = {}, userConfig = {}) => {
1198
+ const overrides = [
1199
+ ...oxc(),
1200
+ ...eslint(),
1201
+ ...typescript(),
1202
+ ...unicorn(),
1203
+ ...promise(),
1204
+ ...node(),
1205
+ ...jsxA11y(),
1206
+ ...imports(),
1207
+ ...jsdoc(),
1208
+ ...nelsonlaidev(),
1209
+ ...stylistic(),
1210
+ ...deMorgan(),
1211
+ ...zod(),
1212
+ ...regexp(),
1213
+ ...sonarjs(),
1214
+ ...importSort()
1215
+ ];
1216
+ if (userConfig.react ?? isPackageExists("react")) overrides.push(...react());
1217
+ if (userConfig.nextjs ?? isPackageExists("next")) overrides.push(...nextjs());
1218
+ if (userConfig.vitest) overrides.push(...vitest(userConfig.vitest));
1219
+ if (userConfig.playwright) overrides.push(...playwright(userConfig.playwright));
1220
+ if (userConfig.tailwindcss) overrides.push(...tailwindcss(userConfig.tailwindcss));
1221
+ return mergeWith({
1222
+ options: {
1223
+ typeAware: true,
1224
+ maxWarnings: 0,
1225
+ denyWarnings: true,
1226
+ reportUnusedDisableDirectives: "error"
1227
+ },
1228
+ env: {
1229
+ node: true,
1230
+ browser: true,
1231
+ es2022: true
1232
+ },
1233
+ ignorePatterns: ["**/routeTree.gen.ts"],
1234
+ overrides,
1235
+ settings: {
1236
+ "jsx-a11y": { components: {
1237
+ Button: "button",
1238
+ Image: "img",
1239
+ Input: "input",
1240
+ Textarea: "textarea",
1241
+ Link: "a"
1242
+ } },
1243
+ ...userConfig.tailwindcss && { "better-tailwindcss": {
1244
+ detectComponentClasses: false,
1245
+ rootFontSize: 16,
1246
+ selectors: [
1247
+ ...getDefaultSelectors(),
1248
+ ...createSelectors(["classNames", ".+ClassNames"], SelectorKind.Attribute),
1249
+ ...createSelectors([".+ClassName", ".+ClassNames"], SelectorKind.Variable)
1250
+ ]
1251
+ } }
1252
+ }
1253
+ }, {
1254
+ ...config,
1255
+ settings: {
1256
+ ...config.settings,
1257
+ ...userConfig.tailwindcss && { "better-tailwindcss": pick(userConfig.tailwindcss, [
1258
+ "entryPoint",
1259
+ "tailwindConfig",
1260
+ "tsconfig",
1261
+ "detectComponentClasses",
1262
+ "rootFontSize",
1263
+ "messageStyle",
1264
+ "selectors"
1265
+ ]) }
1266
+ }
1267
+ }, concatArrays);
1268
+ };
1269
+
1270
+ //#endregion
1271
+ export { GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, defineConfig };
1272
+ //# sourceMappingURL=index.mjs.map