@kasoa/vite-plus-config 0.1.3 → 0.3.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.
Files changed (37) hide show
  1. package/README.md +211 -89
  2. package/dist/compose-Cichpffs.d.mts +14 -0
  3. package/dist/compose-Cichpffs.d.mts.map +1 -0
  4. package/dist/constants-D2PDomKY.mjs +33 -0
  5. package/dist/constants-D2PDomKY.mjs.map +1 -0
  6. package/dist/src/cloudflare-workers/index.d.mts +6 -10
  7. package/dist/src/cloudflare-workers/index.d.mts.map +1 -1
  8. package/dist/src/cloudflare-workers/index.mjs +10 -8
  9. package/dist/src/cloudflare-workers/index.mjs.map +1 -1
  10. package/dist/src/index.d.mts +47 -0
  11. package/dist/src/index.d.mts.map +1 -0
  12. package/dist/src/index.mjs +745 -0
  13. package/dist/src/index.mjs.map +1 -0
  14. package/package.json +20 -35
  15. package/dist/base-5dFXSLDA.mjs +0 -288
  16. package/dist/base-5dFXSLDA.mjs.map +0 -1
  17. package/dist/config-Cxe-N0iS.d.mts +0 -16
  18. package/dist/config-Cxe-N0iS.d.mts.map +0 -1
  19. package/dist/src/base/index.d.mts +0 -7
  20. package/dist/src/base/index.d.mts.map +0 -1
  21. package/dist/src/base/index.mjs +0 -2
  22. package/dist/src/library/index.d.mts +0 -7
  23. package/dist/src/library/index.d.mts.map +0 -1
  24. package/dist/src/library/index.mjs +0 -15
  25. package/dist/src/library/index.mjs.map +0 -1
  26. package/dist/src/monorepo/index.d.mts +0 -7
  27. package/dist/src/monorepo/index.d.mts.map +0 -1
  28. package/dist/src/monorepo/index.mjs +0 -16
  29. package/dist/src/monorepo/index.mjs.map +0 -1
  30. package/dist/src/node/index.d.mts +0 -7
  31. package/dist/src/node/index.d.mts.map +0 -1
  32. package/dist/src/node/index.mjs +0 -10
  33. package/dist/src/node/index.mjs.map +0 -1
  34. package/dist/src/react/index.d.mts +0 -7
  35. package/dist/src/react/index.d.mts.map +0 -1
  36. package/dist/src/react/index.mjs +0 -13
  37. package/dist/src/react/index.mjs.map +0 -1
@@ -0,0 +1,745 @@
1
+ import { a as DEFAULT_IGNORE_PATTERNS, d as TEST_FILES, i as CONFIG_FILES, l as REACT_NATIVE_IGNORE_PATTERNS, n as CODE_FILES, o as DEFAULT_STAGED_CHECK_COMMAND, r as COMMONJS_FILES, s as DEFAULT_STAGED_CHECK_GLOB, t as CLOUDFLARE_WORKER_IGNORE_PATTERNS, u as RUNTIME_OVERRIDE_EXCLUDE_FILES } from "../constants-D2PDomKY.mjs";
2
+ import { defineConfig, mergeConfig } from "vite-plus";
3
+ //#region src/compose.ts
4
+ function toUserConfig(config) {
5
+ return config;
6
+ }
7
+ function composeConfig(...fragments) {
8
+ let config = {};
9
+ for (const fragment of fragments) config = mergeConfig(config, toUserConfig(fragment));
10
+ return defineConfig(config);
11
+ }
12
+ //#endregion
13
+ //#region src/format.ts
14
+ const baseFormatConfig = {
15
+ ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],
16
+ sortImports: {
17
+ internalPattern: ["#", "@/"],
18
+ newlinesBetween: false,
19
+ groups: [
20
+ "type-import",
21
+ ["value-builtin", "value-external"],
22
+ "type-internal",
23
+ "value-internal",
24
+ [
25
+ "type-parent",
26
+ "type-sibling",
27
+ "type-index"
28
+ ],
29
+ [
30
+ "value-parent",
31
+ "value-sibling",
32
+ "value-index"
33
+ ],
34
+ "unknown"
35
+ ]
36
+ }
37
+ };
38
+ const reactFormatConfig = { sortTailwindcss: {
39
+ attributes: ["/.*ClassName/"],
40
+ functions: ["tv"]
41
+ } };
42
+ const reactNativeFormatConfig = { ignorePatterns: [...REACT_NATIVE_IGNORE_PATTERNS] };
43
+ const cloudflareWorkerFormatConfig = { ignorePatterns: [...CLOUDFLARE_WORKER_IGNORE_PATTERNS] };
44
+ //#endregion
45
+ //#region src/lint/rules/browser.ts
46
+ const browserRules = {
47
+ "no-alert": "error",
48
+ "unicorn/prefer-classlist-toggle": "error",
49
+ "unicorn/prefer-dom-node-append": "error",
50
+ "unicorn/prefer-dom-node-dataset": "error",
51
+ "unicorn/prefer-dom-node-remove": "error",
52
+ "unicorn/prefer-dom-node-text-content": "error",
53
+ "unicorn/prefer-keyboard-event-key": "error",
54
+ "unicorn/prefer-modern-dom-apis": "error"
55
+ };
56
+ //#endregion
57
+ //#region src/lint/rules/node.ts
58
+ const nodeRules = {
59
+ "node/exports-style": "error",
60
+ "node/global-require": "error",
61
+ "node/no-exports-assign": "error",
62
+ "node/no-mixed-requires": "error"
63
+ };
64
+ //#endregion
65
+ //#region src/lint/rules/react-core.ts
66
+ const reactCoreRules = {
67
+ "react/display-name": "error",
68
+ "react/function-component-definition": ["error", {
69
+ namedComponents: "function-declaration",
70
+ unnamedComponents: ["arrow-function", "function-expression"]
71
+ }],
72
+ "react/hook-use-state": "error",
73
+ "react/jsx-boolean-value": "error",
74
+ "react/jsx-curly-brace-presence": "error",
75
+ "react/jsx-fragments": "error",
76
+ "react/jsx-max-depth": ["error", { max: 6 }],
77
+ "react/jsx-no-constructed-context-values": "error",
78
+ "react/jsx-no-useless-fragment": "error",
79
+ "react/jsx-pascal-case": "error",
80
+ "react/no-array-index-key": "error",
81
+ "react/no-object-type-as-default-prop": "error",
82
+ "react/no-redundant-should-component-update": "error",
83
+ "react/no-set-state": "error",
84
+ "react/prefer-es6-class": "error",
85
+ "react/rules-of-hooks": "error",
86
+ "react/self-closing-comp": "error",
87
+ "react/state-in-constructor": "error",
88
+ "react/exhaustive-deps": "error",
89
+ "react/react-compiler": "error",
90
+ "react/react-in-jsx-scope": "off",
91
+ "react/jsx-key": "error",
92
+ "react/jsx-no-duplicate-props": "error",
93
+ "react/jsx-no-undef": "error",
94
+ "react/no-children-prop": "error",
95
+ "react/no-clone-element": "error",
96
+ "react/no-direct-mutation-state": "error",
97
+ "react/no-react-children": "error",
98
+ "react/no-string-refs": "error",
99
+ "react/no-unsafe": "error",
100
+ "react/style-prop-object": "off"
101
+ };
102
+ //#endregion
103
+ //#region src/lint/rules/react-dom.ts
104
+ const reactDomRules = {
105
+ "react/checked-requires-onchange-or-readonly": "error",
106
+ "react/jsx-no-target-blank": "error",
107
+ "react/no-unescaped-entities": "error",
108
+ "react/no-danger": "error",
109
+ "react/no-danger-with-children": "error",
110
+ "react/no-find-dom-node": "error",
111
+ "react/no-unknown-property": "error",
112
+ "react/void-dom-elements-no-children": "error"
113
+ };
114
+ //#endregion
115
+ //#region src/lint/rules/react-native.ts
116
+ const reactNativeRules = {
117
+ "react/iframe-missing-sandbox": "off",
118
+ "react/jsx-no-script-url": "off",
119
+ "react/no-unknown-property": "off",
120
+ "react/no-unescaped-entities": "off",
121
+ "react/no-unstable-nested-components": ["error", { allowAsProps: true }],
122
+ "react/void-dom-elements-no-children": "off"
123
+ };
124
+ //#endregion
125
+ //#region src/lint/rules/vitest.ts
126
+ const vitestRules = {
127
+ "vitest/consistent-each-for": "error",
128
+ "vitest/consistent-test-it": ["error", {
129
+ fn: "test",
130
+ withinDescribe: "it"
131
+ }],
132
+ "vitest/consistent-vitest-vi": "error",
133
+ "vitest/max-nested-describe": ["error", { max: 3 }],
134
+ "vitest/no-alias-methods": "error",
135
+ "vitest/no-duplicate-hooks": "error",
136
+ "vitest/no-identical-title": "error",
137
+ "vitest/no-import-node-test": "error",
138
+ "vitest/no-interpolation-in-snapshots": "error",
139
+ "vitest/no-large-snapshots": "error",
140
+ "vitest/no-mocks-import": "error",
141
+ "vitest/no-test-prefixes": "error",
142
+ "vitest/no-test-return-statement": "error",
143
+ "vitest/no-unneeded-async-expect-function": "error",
144
+ "vitest/padding-around-after-all-blocks": "error",
145
+ "vitest/padding-around-test-blocks": "error",
146
+ "vitest/prefer-called-exactly-once-with": "error",
147
+ "vitest/prefer-called-once": "error",
148
+ "vitest/prefer-called-with": "error",
149
+ "vitest/prefer-comparison-matcher": "error",
150
+ "vitest/prefer-each": "error",
151
+ "vitest/prefer-equality-matcher": "error",
152
+ "vitest/prefer-expect-resolves": "error",
153
+ "vitest/prefer-expect-type-of": "error",
154
+ "vitest/prefer-hooks-in-order": "error",
155
+ "vitest/prefer-hooks-on-top": "error",
156
+ "vitest/prefer-import-in-mock": "error",
157
+ "vitest/prefer-importing-vitest-globals": "error",
158
+ "vitest/prefer-mock-promise-shorthand": "error",
159
+ "vitest/prefer-mock-return-shorthand": "error",
160
+ "vitest/prefer-spy-on": "error",
161
+ "vitest/prefer-strict-boolean-matchers": "error",
162
+ "vitest/prefer-strict-equal": "error",
163
+ "vitest/prefer-to-be": "error",
164
+ "vitest/prefer-to-be-object": "error",
165
+ "vitest/prefer-to-contain": "error",
166
+ "vitest/prefer-to-have-been-called-times": "error",
167
+ "vitest/prefer-to-have-length": "error",
168
+ "vitest/prefer-todo": "error"
169
+ };
170
+ //#endregion
171
+ //#region src/lint/profiles.ts
172
+ const BASE_LINT_PLUGINS = [
173
+ "typescript",
174
+ "unicorn",
175
+ "oxc",
176
+ "import",
177
+ "promise"
178
+ ];
179
+ const neutralEnvironment = {
180
+ browser: false,
181
+ node: false,
182
+ serviceworker: false,
183
+ worker: false
184
+ };
185
+ const nodeEnvironment = {
186
+ ...neutralEnvironment,
187
+ node: true
188
+ };
189
+ const browserEnvironment = {
190
+ ...neutralEnvironment,
191
+ browser: true
192
+ };
193
+ const reactNativeEnvironment = { ...neutralEnvironment };
194
+ const cloudflareWorkerEnvironment = {
195
+ ...neutralEnvironment,
196
+ serviceworker: true,
197
+ worker: true
198
+ };
199
+ const platformGlobalsOff = {
200
+ __DEV__: "off",
201
+ Cloudflare: "off",
202
+ DigestStream: "off",
203
+ FixedLengthStream: "off",
204
+ HTMLRewriter: "off",
205
+ IdentityTransformStream: "off",
206
+ process: "off",
207
+ WebSocketPair: "off",
208
+ WebSocketRequestResponsePair: "off"
209
+ };
210
+ const nodeGlobals = {
211
+ ...platformGlobalsOff,
212
+ console: "readonly",
213
+ process: "readonly"
214
+ };
215
+ const cloudflareWorkerGlobals = {
216
+ ...platformGlobalsOff,
217
+ Cloudflare: "readonly",
218
+ DigestStream: "readonly",
219
+ FixedLengthStream: "readonly",
220
+ HTMLRewriter: "readonly",
221
+ IdentityTransformStream: "readonly",
222
+ WebSocketPair: "readonly",
223
+ WebSocketRequestResponsePair: "readonly"
224
+ };
225
+ const neutralLint = {
226
+ env: neutralEnvironment,
227
+ globals: platformGlobalsOff,
228
+ plugins: [...BASE_LINT_PLUGINS]
229
+ };
230
+ const nodeLint = {
231
+ env: nodeEnvironment,
232
+ globals: nodeGlobals,
233
+ plugins: [...BASE_LINT_PLUGINS, "node"],
234
+ rules: nodeRules
235
+ };
236
+ const browserLint = {
237
+ env: browserEnvironment,
238
+ globals: platformGlobalsOff,
239
+ plugins: [...BASE_LINT_PLUGINS],
240
+ rules: browserRules
241
+ };
242
+ const reactCoreLint = {
243
+ plugins: [...BASE_LINT_PLUGINS, "react"],
244
+ rules: reactCoreRules
245
+ };
246
+ const reactDomLint = {
247
+ plugins: [
248
+ ...BASE_LINT_PLUGINS,
249
+ "react",
250
+ "jsx-a11y"
251
+ ],
252
+ rules: reactDomRules
253
+ };
254
+ const reactNativeGlobals = {
255
+ ...platformGlobalsOff,
256
+ __BUNDLE_START_TIME__: "readonly",
257
+ __DEV__: "readonly",
258
+ AbortController: "readonly",
259
+ AbortSignal: "readonly",
260
+ alert: "readonly",
261
+ Blob: "readonly",
262
+ cancelAnimationFrame: "readonly",
263
+ clearImmediate: "readonly",
264
+ clearInterval: "readonly",
265
+ clearTimeout: "readonly",
266
+ console: "readonly",
267
+ crypto: "readonly",
268
+ DOMRect: "readonly",
269
+ ErrorUtils: "readonly",
270
+ Event: "readonly",
271
+ EventTarget: "readonly",
272
+ fetch: "readonly",
273
+ fetchBundle: "readonly",
274
+ File: "readonly",
275
+ FileReader: "readonly",
276
+ FormData: "readonly",
277
+ Headers: "readonly",
278
+ HermesInternal: "readonly",
279
+ navigator: "readonly",
280
+ originalXMLHttpRequest: "readonly",
281
+ performance: "readonly",
282
+ process: "readonly",
283
+ queueMicrotask: "readonly",
284
+ requestAnimationFrame: "readonly",
285
+ Request: "readonly",
286
+ require: "readonly",
287
+ Response: "readonly",
288
+ setImmediate: "readonly",
289
+ setInterval: "readonly",
290
+ setTimeout: "readonly",
291
+ URL: "readonly",
292
+ URLSearchParams: "readonly",
293
+ WebSocket: "readonly",
294
+ XMLHttpRequest: "readonly",
295
+ XMLHttpRequestUpload: "readonly"
296
+ };
297
+ const reactNativeRuntimeLint = {
298
+ env: reactNativeEnvironment,
299
+ globals: reactNativeGlobals,
300
+ plugins: [...BASE_LINT_PLUGINS, "react"],
301
+ rules: reactNativeRules
302
+ };
303
+ const reactWebLint = {
304
+ env: browserEnvironment,
305
+ globals: platformGlobalsOff,
306
+ plugins: [
307
+ ...BASE_LINT_PLUGINS,
308
+ "react",
309
+ "jsx-a11y"
310
+ ],
311
+ rules: {
312
+ ...browserRules,
313
+ ...reactCoreRules,
314
+ ...reactDomRules
315
+ }
316
+ };
317
+ const reactNativeLint = {
318
+ env: reactNativeEnvironment,
319
+ globals: reactNativeGlobals,
320
+ plugins: [...BASE_LINT_PLUGINS, "react"],
321
+ rules: {
322
+ ...reactCoreRules,
323
+ ...reactNativeRules
324
+ }
325
+ };
326
+ const cloudflareWorkerLint = {
327
+ env: cloudflareWorkerEnvironment,
328
+ globals: cloudflareWorkerGlobals,
329
+ plugins: [...BASE_LINT_PLUGINS]
330
+ };
331
+ const nodeTestLint = {
332
+ ...nodeLint,
333
+ plugins: [
334
+ ...BASE_LINT_PLUGINS,
335
+ "node",
336
+ "vitest"
337
+ ],
338
+ rules: {
339
+ ...nodeRules,
340
+ ...vitestRules
341
+ }
342
+ };
343
+ const browserTestLint = {
344
+ ...browserLint,
345
+ plugins: [...BASE_LINT_PLUGINS, "vitest"],
346
+ rules: {
347
+ ...browserRules,
348
+ ...vitestRules
349
+ }
350
+ };
351
+ const cloudflareWorkerTestLint = {
352
+ ...cloudflareWorkerLint,
353
+ plugins: [...BASE_LINT_PLUGINS, "vitest"],
354
+ rules: vitestRules
355
+ };
356
+ //#endregion
357
+ //#region src/lint/rules/universal.ts
358
+ const universalRules = {
359
+ "accessor-pairs": "error",
360
+ "array-callback-return": "error",
361
+ "arrow-body-style": "error",
362
+ curly: [
363
+ "error",
364
+ "multi-line",
365
+ "consistent"
366
+ ],
367
+ "default-case-last": "error",
368
+ "default-param-last": "error",
369
+ eqeqeq: "error",
370
+ "func-name-matching": "error",
371
+ "func-names": "error",
372
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
373
+ "guard-for-in": "error",
374
+ "import/consistent-type-specifier-style": "error",
375
+ "import/first": "error",
376
+ "import/newline-after-import": "error",
377
+ "import/no-duplicates": "error",
378
+ "import/no-mutable-exports": "error",
379
+ "import/no-named-default": "error",
380
+ "logical-assignment-operators": "error",
381
+ "max-depth": ["error", { max: 3 }],
382
+ "max-nested-callbacks": ["error", { max: 3 }],
383
+ "max-params": ["error", { max: 3 }],
384
+ "no-array-constructor": "error",
385
+ "no-await-in-loop": "error",
386
+ "no-case-declarations": "error",
387
+ "no-constructor-return": "error",
388
+ "no-else-return": "error",
389
+ "no-extra-label": "error",
390
+ "no-fallthrough": "error",
391
+ "no-implicit-coercion": "error",
392
+ "no-inline-comments": "error",
393
+ "no-inner-declarations": "error",
394
+ "no-label-var": "error",
395
+ "no-labels": "error",
396
+ "no-lone-blocks": "error",
397
+ "no-lonely-if": "error",
398
+ "no-loop-func": "error",
399
+ "no-multi-assign": "error",
400
+ "no-multi-str": "error",
401
+ "no-nested-ternary": "error",
402
+ "no-new-func": "error",
403
+ "no-new-wrappers": "error",
404
+ "no-object-constructor": "error",
405
+ "no-promise-executor-return": "error",
406
+ "no-prototype-builtins": "error",
407
+ "no-redeclare": "error",
408
+ "no-return-assign": "error",
409
+ "no-script-url": "error",
410
+ "no-self-compare": "error",
411
+ "no-template-curly-in-string": "error",
412
+ "no-throw-literal": "error",
413
+ "no-useless-call": "error",
414
+ "no-useless-computed-key": "error",
415
+ "no-useless-return": "error",
416
+ "no-warning-comments": "error",
417
+ "object-shorthand": "error",
418
+ "operator-assignment": "error",
419
+ "oxc/branches-sharing-code": "error",
420
+ "oxc/no-accumulating-spread": "error",
421
+ "oxc/no-map-spread": "error",
422
+ "prefer-arrow-callback": "error",
423
+ "prefer-const": "error",
424
+ "prefer-destructuring": "error",
425
+ "prefer-exponentiation-operator": "error",
426
+ "prefer-named-capture-group": "error",
427
+ "prefer-numeric-literals": "error",
428
+ "prefer-object-has-own": "error",
429
+ "prefer-object-spread": "error",
430
+ "prefer-promise-reject-errors": "error",
431
+ "prefer-regex-literals": "error",
432
+ "prefer-rest-params": "error",
433
+ "prefer-spread": "error",
434
+ "prefer-template": "error",
435
+ "promise/no-nesting": "error",
436
+ "promise/no-return-wrap": "error",
437
+ "promise/param-names": "error",
438
+ "promise/prefer-await-to-then": "error",
439
+ "promise/prefer-catch": "error",
440
+ radix: "error",
441
+ "symbol-description": "error",
442
+ "typescript/adjacent-overload-signatures": "error",
443
+ "typescript/array-type": "error",
444
+ "typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
445
+ "typescript/ban-tslint-comment": "error",
446
+ "typescript/ban-types": "error",
447
+ "typescript/class-literal-property-style": "error",
448
+ "typescript/consistent-generic-constructors": "error",
449
+ "typescript/consistent-indexed-object-style": "error",
450
+ "typescript/consistent-type-assertions": "error",
451
+ "typescript/consistent-type-exports": "error",
452
+ "typescript/consistent-type-imports": ["error", {
453
+ prefer: "type-imports",
454
+ fixStyle: "separate-type-imports"
455
+ }],
456
+ "typescript/dot-notation": "error",
457
+ "typescript/method-signature-style": "error",
458
+ "typescript/no-confusing-void-expression": "error",
459
+ "typescript/no-deprecated": "error",
460
+ "typescript/no-empty-interface": "error",
461
+ "typescript/no-inferrable-types": "error",
462
+ "typescript/no-misused-promises": "error",
463
+ "typescript/no-mixed-enums": "error",
464
+ "typescript/no-unnecessary-qualifier": "error",
465
+ "typescript/no-unsafe-argument": "error",
466
+ "typescript/no-unsafe-assignment": "error",
467
+ "typescript/no-unsafe-call": "error",
468
+ "typescript/no-unsafe-function-type": "error",
469
+ "typescript/no-unsafe-member-access": "error",
470
+ "typescript/no-unsafe-return": "error",
471
+ "typescript/only-throw-error": "error",
472
+ "typescript/parameter-properties": "error",
473
+ "typescript/prefer-enum-initializers": "error",
474
+ "typescript/prefer-find": "error",
475
+ "typescript/prefer-for-of": "error",
476
+ "typescript/prefer-function-type": "error",
477
+ "typescript/prefer-includes": "error",
478
+ "typescript/prefer-nullish-coalescing": "error",
479
+ "typescript/prefer-promise-reject-errors": "error",
480
+ "typescript/prefer-readonly": "error",
481
+ "typescript/prefer-reduce-type-parameter": "error",
482
+ "typescript/prefer-regexp-exec": "error",
483
+ "typescript/prefer-return-this-type": "error",
484
+ "typescript/prefer-string-starts-ends-with": "error",
485
+ "typescript/prefer-ts-expect-error": "error",
486
+ "typescript/related-getter-setter-pairs": "error",
487
+ "typescript/restrict-plus-operands": "error",
488
+ "typescript/return-await": "error",
489
+ "typescript/strict-boolean-expressions": "error",
490
+ "typescript/strict-void-return": "error",
491
+ "typescript/switch-exhaustiveness-check": "error",
492
+ "typescript/unified-signatures": "error",
493
+ "unicorn/catch-error-name": "error",
494
+ "unicorn/consistent-assert": "error",
495
+ "unicorn/consistent-date-clone": "error",
496
+ "unicorn/consistent-empty-array-spread": "error",
497
+ "unicorn/consistent-existence-index-check": "error",
498
+ "unicorn/consistent-template-literal-escape": "error",
499
+ "unicorn/custom-error-definition": "error",
500
+ "unicorn/error-message": "error",
501
+ "unicorn/escape-case": "error",
502
+ "unicorn/explicit-length-check": "error",
503
+ "unicorn/explicit-timer-delay": "error",
504
+ "unicorn/filename-case": ["error", { case: "kebabCase" }],
505
+ "unicorn/max-nested-calls": ["error", { max: 5 }],
506
+ "unicorn/new-for-builtins": "error",
507
+ "unicorn/no-array-callback-reference": "error",
508
+ "unicorn/no-array-method-this-argument": "error",
509
+ "unicorn/no-await-expression-member": "error",
510
+ "unicorn/no-console-spaces": "error",
511
+ "unicorn/no-hex-escape": "error",
512
+ "unicorn/no-immediate-mutation": "error",
513
+ "unicorn/no-instanceof-array": "error",
514
+ "unicorn/no-negation-in-equality-check": "error",
515
+ "unicorn/no-new-buffer": "error",
516
+ "unicorn/no-static-only-class": "error",
517
+ "unicorn/no-this-assignment": "error",
518
+ "unicorn/no-typeof-undefined": "error",
519
+ "unicorn/no-unnecessary-array-flat-depth": "error",
520
+ "unicorn/no-unnecessary-array-splice-count": "error",
521
+ "unicorn/no-unnecessary-slice-end": "error",
522
+ "unicorn/no-unreadable-array-destructuring": "error",
523
+ "unicorn/no-unreadable-iife": "error",
524
+ "unicorn/no-useless-collection-argument": "error",
525
+ "unicorn/no-useless-promise-resolve-reject": "error",
526
+ "unicorn/no-useless-switch-case": "error",
527
+ "unicorn/no-useless-undefined": "error",
528
+ "unicorn/no-zero-fractions": "error",
529
+ "unicorn/number-literal-case": "error",
530
+ "unicorn/numeric-separators-style": "error",
531
+ "unicorn/prefer-array-find": "error",
532
+ "unicorn/prefer-array-flat": "error",
533
+ "unicorn/prefer-array-flat-map": "error",
534
+ "unicorn/prefer-array-index-of": "error",
535
+ "unicorn/prefer-array-some": "error",
536
+ "unicorn/prefer-at": "error",
537
+ "unicorn/prefer-bigint-literals": "error",
538
+ "unicorn/prefer-blob-reading-methods": "error",
539
+ "unicorn/prefer-class-fields": "error",
540
+ "unicorn/prefer-code-point": "error",
541
+ "unicorn/prefer-date-now": "error",
542
+ "unicorn/prefer-default-parameters": "error",
543
+ "unicorn/prefer-export-from": "error",
544
+ "unicorn/prefer-global-this": "error",
545
+ "unicorn/prefer-import-meta-properties": "error",
546
+ "unicorn/prefer-includes": "error",
547
+ "unicorn/prefer-logical-operator-over-ternary": "error",
548
+ "unicorn/prefer-math-min-max": "error",
549
+ "unicorn/prefer-math-trunc": "error",
550
+ "unicorn/prefer-native-coercion-functions": "error",
551
+ "unicorn/prefer-negative-index": "error",
552
+ "unicorn/prefer-number-coercion": "error",
553
+ "unicorn/prefer-object-from-entries": "error",
554
+ "unicorn/prefer-optional-catch-binding": "error",
555
+ "unicorn/prefer-prototype-methods": "error",
556
+ "unicorn/prefer-reflect-apply": "error",
557
+ "unicorn/prefer-regexp-test": "error",
558
+ "unicorn/prefer-response-static-json": "error",
559
+ "unicorn/prefer-set-has": "error",
560
+ "unicorn/prefer-single-call": "error",
561
+ "unicorn/prefer-spread": "error",
562
+ "unicorn/prefer-string-raw": "error",
563
+ "unicorn/prefer-string-replace-all": "error",
564
+ "unicorn/prefer-string-slice": "error",
565
+ "unicorn/prefer-string-trim-start-end": "error",
566
+ "unicorn/prefer-structured-clone": "error",
567
+ "unicorn/prefer-ternary": ["error", "only-single-line"],
568
+ "unicorn/prefer-type-error": "error",
569
+ "unicorn/relative-url-style": "error",
570
+ "unicorn/require-array-join-separator": "error",
571
+ "unicorn/require-module-attributes": "error",
572
+ "unicorn/require-number-to-fixed-digits-argument": "error",
573
+ "unicorn/switch-case-braces": "error",
574
+ "unicorn/switch-case-break-position": "error",
575
+ "unicorn/text-encoding-identifier-case": "error",
576
+ "unicorn/throw-new-error": "error",
577
+ yoda: "error",
578
+ complexity: ["error", { max: 20 }],
579
+ "getter-return": "error",
580
+ "no-bitwise": "error",
581
+ "no-console": ["error", { allow: [
582
+ "info",
583
+ "warn",
584
+ "error"
585
+ ] }],
586
+ "no-param-reassign": ["error", { props: true }],
587
+ "no-plusplus": "error",
588
+ "no-undef": "error",
589
+ "no-unneeded-ternary": "error",
590
+ "no-unreachable": "error",
591
+ "import/no-cycle": "error",
592
+ "import/no-unassigned-import": "off",
593
+ "oxc/bad-match-all-arg": "error",
594
+ "typescript/consistent-return": "error",
595
+ "typescript/explicit-module-boundary-types": "error",
596
+ "typescript/no-dynamic-delete": "error",
597
+ "typescript/no-explicit-any": "error",
598
+ "typescript/no-floating-promises": "error",
599
+ "typescript/no-misused-spread": "error",
600
+ "typescript/no-non-null-assertion": "error",
601
+ "typescript/no-require-imports": "error",
602
+ "typescript/no-unnecessary-condition": "error",
603
+ "typescript/no-unnecessary-type-arguments": "error",
604
+ "typescript/no-unnecessary-type-assertion": "error",
605
+ "typescript/no-unnecessary-type-parameters": "error",
606
+ "typescript/no-useless-default-assignment": "error",
607
+ "typescript/non-nullable-type-assertion-style": "error",
608
+ "typescript/prefer-optional-chain": "error",
609
+ "typescript/require-array-sort-compare": "error",
610
+ "typescript/restrict-template-expressions": "error",
611
+ "typescript/unbound-method": "error",
612
+ "typescript/use-unknown-in-catch-callback-variable": "error",
613
+ "unicorn/no-abusive-eslint-disable": "error"
614
+ };
615
+ //#endregion
616
+ //#region src/lint/configs.ts
617
+ const baseLintConfig = {
618
+ plugins: [...BASE_LINT_PLUGINS],
619
+ ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],
620
+ env: neutralEnvironment,
621
+ globals: neutralLint.globals,
622
+ options: {
623
+ reportUnusedDisableDirectives: "error",
624
+ typeAware: true,
625
+ typeCheck: true
626
+ },
627
+ categories: {
628
+ correctness: "error",
629
+ suspicious: "error"
630
+ },
631
+ extends: [{ rules: universalRules }],
632
+ overrides: [
633
+ {
634
+ files: [...COMMONJS_FILES],
635
+ ...nodeLint,
636
+ rules: {
637
+ ...nodeRules,
638
+ "typescript/no-require-imports": "off"
639
+ }
640
+ },
641
+ {
642
+ files: [...CONFIG_FILES],
643
+ ...nodeLint,
644
+ rules: {
645
+ ...nodeRules,
646
+ "func-names": "off"
647
+ }
648
+ },
649
+ {
650
+ files: ["**/*.d.ts"],
651
+ rules: { "typescript/no-empty-interface": "off" }
652
+ }
653
+ ]
654
+ };
655
+ const nodeRuntimeLintConfig = {
656
+ env: nodeEnvironment,
657
+ globals: nodeLint.globals,
658
+ plugins: ["node"],
659
+ extends: [{ rules: nodeRules }]
660
+ };
661
+ const browserRuntimeLintConfig = {
662
+ env: browserEnvironment,
663
+ globals: neutralLint.globals,
664
+ overrides: [{
665
+ files: [...CODE_FILES],
666
+ excludeFiles: [...RUNTIME_OVERRIDE_EXCLUDE_FILES],
667
+ rules: browserRules
668
+ }]
669
+ };
670
+ const reactCoreLintConfig = {
671
+ plugins: ["react"],
672
+ extends: [{ rules: reactCoreRules }]
673
+ };
674
+ const reactDomLintConfig = {
675
+ plugins: ["jsx-a11y"],
676
+ extends: [{ rules: reactDomRules }]
677
+ };
678
+ const reactNativeRuntimeLintConfig = {
679
+ env: reactNativeRuntimeLint.env,
680
+ globals: reactNativeRuntimeLint.globals,
681
+ extends: [{ rules: reactNativeRules }]
682
+ };
683
+ const cloudflareWorkerRuntimeLintConfig = {
684
+ env: cloudflareWorkerEnvironment,
685
+ globals: cloudflareWorkerLint.globals
686
+ };
687
+ const reactNativeGeneratedLintConfig = { ignorePatterns: [...REACT_NATIVE_IGNORE_PATTERNS] };
688
+ const cloudflareWorkerGeneratedLintConfig = { ignorePatterns: [...CLOUDFLARE_WORKER_IGNORE_PATTERNS] };
689
+ const nodeTestLintConfig$1 = { overrides: [{
690
+ files: [...TEST_FILES],
691
+ ...nodeTestLint
692
+ }] };
693
+ const browserTestLintConfig$1 = { overrides: [{
694
+ files: [...TEST_FILES],
695
+ ...browserTestLint
696
+ }] };
697
+ const cloudflareWorkerTestLintConfig$1 = { overrides: [{
698
+ files: [...TEST_FILES],
699
+ ...cloudflareWorkerTestLint
700
+ }] };
701
+ //#endregion
702
+ //#region src/fragments.ts
703
+ const baseToolingConfig = {
704
+ fmt: baseFormatConfig,
705
+ lint: baseLintConfig,
706
+ staged: { [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND }
707
+ };
708
+ const nodeRuntimeConfig = { lint: nodeRuntimeLintConfig };
709
+ const browserRuntimeConfig = { lint: browserRuntimeLintConfig };
710
+ const reactCoreConfig = {
711
+ fmt: reactFormatConfig,
712
+ lint: reactCoreLintConfig
713
+ };
714
+ const reactDomConfig = { lint: reactDomLintConfig };
715
+ const reactNativeRuntimeConfig = { lint: reactNativeRuntimeLintConfig };
716
+ const reactNativeGeneratedConfig = {
717
+ fmt: reactNativeFormatConfig,
718
+ lint: reactNativeGeneratedLintConfig
719
+ };
720
+ const cloudflareWorkerRuntimeConfig = { lint: cloudflareWorkerRuntimeLintConfig };
721
+ const cloudflareWorkerGeneratedConfig = {
722
+ fmt: cloudflareWorkerFormatConfig,
723
+ lint: cloudflareWorkerGeneratedLintConfig
724
+ };
725
+ const nodeTestLintConfig = { lint: nodeTestLintConfig$1 };
726
+ const browserTestLintConfig = { lint: browserTestLintConfig$1 };
727
+ const cloudflareWorkerTestLintConfig = { lint: cloudflareWorkerTestLintConfig$1 };
728
+ const libraryPackDefaults = {
729
+ clean: true,
730
+ dts: true,
731
+ format: ["esm"],
732
+ sourcemap: true
733
+ };
734
+ const libraryPackConfig = { pack: libraryPackDefaults };
735
+ const workspaceRunConfig = { run: {
736
+ cache: {
737
+ scripts: true,
738
+ tasks: true
739
+ },
740
+ enablePrePostScripts: true
741
+ } };
742
+ //#endregion
743
+ export { CODE_FILES, COMMONJS_FILES, CONFIG_FILES, RUNTIME_OVERRIDE_EXCLUDE_FILES, TEST_FILES, baseToolingConfig, browserLint, browserRuntimeConfig, browserTestLint, browserTestLintConfig, cloudflareWorkerGeneratedConfig, cloudflareWorkerLint, cloudflareWorkerRuntimeConfig, cloudflareWorkerTestLint, cloudflareWorkerTestLintConfig, composeConfig, libraryPackConfig, libraryPackDefaults, nodeLint, nodeRuntimeConfig, nodeTestLint, nodeTestLintConfig, reactCoreConfig, reactCoreLint, reactDomConfig, reactDomLint, reactNativeGeneratedConfig, reactNativeLint, reactNativeRuntimeConfig, reactNativeRuntimeLint, reactWebLint, workspaceRunConfig };
744
+
745
+ //# sourceMappingURL=index.mjs.map