@moso/eslint-config 0.3.5 → 1.0.1

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.js ADDED
@@ -0,0 +1,1873 @@
1
+ // src/configurator.ts
2
+ import { FlatConfigComposer } from "eslint-flat-config-utils";
3
+ import { isPackageExists as isPackageExists2 } from "local-pkg";
4
+
5
+ // src/utils.ts
6
+ import process from "node:process";
7
+ var parserPlain = {
8
+ meta: {
9
+ name: "parser-plain"
10
+ },
11
+ parseForESLint: (code) => ({
12
+ ast: {
13
+ body: [],
14
+ comments: [],
15
+ loc: { end: code.length, start: 0 },
16
+ range: [0, code.length],
17
+ tokens: []
18
+ },
19
+ scopeManager: null,
20
+ services: { isPlain: true },
21
+ visitorKeys: {
22
+ Program: []
23
+ }
24
+ })
25
+ };
26
+ var combine = async (...configs) => {
27
+ const resolved = await Promise.all(configs);
28
+ return resolved.flat();
29
+ };
30
+ var toArray = (value) => {
31
+ return Array.isArray(value) ? value : [value];
32
+ };
33
+ var interopDefault = async (r) => {
34
+ const resolved = await r;
35
+ return resolved.default || resolved;
36
+ };
37
+ var resolveSubOptions = (options, key) => {
38
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
39
+ };
40
+ var getOverrides = (options, key) => {
41
+ const sub = resolveSubOptions(options, key);
42
+ return {
43
+ ...options.overrides?.[key],
44
+ ..."overrides" in sub ? sub.overrides : {}
45
+ };
46
+ };
47
+ var isInGitHooksOrLintStaged = () => {
48
+ return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
49
+ };
50
+ var isInEditorEnv = () => {
51
+ if (process.env.CI) return false;
52
+ if (isInGitHooksOrLintStaged()) return false;
53
+ return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
54
+ };
55
+
56
+ // src/configs/comments.ts
57
+ var comments = async () => {
58
+ const eslintComments = await interopDefault(import("@eslint-community/eslint-plugin-eslint-comments"));
59
+ return [
60
+ {
61
+ name: "moso/eslint-comments/rules",
62
+ plugins: {
63
+ "@eslint-community/eslint-comments": eslintComments
64
+ },
65
+ rules: {
66
+ "@eslint-community/eslint-comments/no-aggregating-enable": "error",
67
+ "@eslint-community/eslint-comments/no-duplicate-disable": "error",
68
+ "@eslint-community/eslint-comments/no-unlimited-disable": "error",
69
+ "@eslint-community/eslint-comments/no-unused-enable": "error"
70
+ }
71
+ }
72
+ ];
73
+ };
74
+
75
+ // src/globs.ts
76
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
77
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
78
+ var GLOB_JS = "**/*.?([cm])js";
79
+ var GLOB_JSX = "**/*.?([cm])jsx";
80
+ var GLOB_TS = "**/*.?([cm])ts";
81
+ var GLOB_TSX = "**/*.?([cm])tsx";
82
+ var GLOB_JSON = "**/*.json";
83
+ var GLOB_JSON5 = "**/*.json5";
84
+ var GLOB_JSONC = "**/*.jsonc";
85
+ var GLOB_HTML = "**/*.htm?(l)";
86
+ var GLOB_MARKDOWN = "**/*.md";
87
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
88
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
89
+ var GLOB_VUE = "**/*.vue";
90
+ var GLOB_YAML = "**/*.y?(a)ml";
91
+ var GLOB_TESTS = [
92
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
93
+ `**/*.spec.${GLOB_SRC_EXT}`,
94
+ `**/*.test.${GLOB_SRC_EXT}`,
95
+ `**/*.bench.${GLOB_SRC_EXT}`,
96
+ `**/*.benchmark.${GLOB_SRC_EXT}`
97
+ ];
98
+ var GLOB_ALL_SRC = [
99
+ GLOB_JSON,
100
+ GLOB_JSON5,
101
+ GLOB_HTML,
102
+ GLOB_MARKDOWN,
103
+ GLOB_SRC,
104
+ GLOB_VUE,
105
+ GLOB_YAML
106
+ ];
107
+ var GLOB_EXCLUDE = [
108
+ "**/node_modules",
109
+ "**/dist",
110
+ "**/package-lock.json",
111
+ "**/yarn.lock",
112
+ "**/pnpm-lock.yaml",
113
+ "**/bun.lockb",
114
+ "**/bun.lock",
115
+ "**/output",
116
+ "**/coverage",
117
+ "**/temp",
118
+ "**/.temp",
119
+ "**/tmp",
120
+ "**/.tmp",
121
+ "**/.history",
122
+ "**/.vitepress/cache",
123
+ "**/.nuxt",
124
+ "**/.next",
125
+ "**/.vercel",
126
+ "**/.changeset",
127
+ "**/.idea",
128
+ "**/.cache",
129
+ "**/.output",
130
+ "**/.vite-inspect",
131
+ "**/.yarn",
132
+ "**/vite.config.*.timestamp-*",
133
+ "**/CHANGELOG*.md",
134
+ "**/*.min.*",
135
+ "**/LICENSE*",
136
+ "**/__snapshots__",
137
+ "**/auto-import?(s).d.ts",
138
+ "**/components.d.ts"
139
+ ];
140
+
141
+ // src/configs/disables.ts
142
+ var disables = () => {
143
+ return [
144
+ {
145
+ files: [`**/scripts/${GLOB_SRC}`],
146
+ name: "moso/disables/scripts",
147
+ rules: {
148
+ "no-console": "off",
149
+ "@typescript-eslint/explicit-function-return-type": "off"
150
+ }
151
+ },
152
+ {
153
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
154
+ name: "moso/disables/cli",
155
+ rules: {
156
+ "no-console": "off"
157
+ }
158
+ },
159
+ {
160
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
161
+ name: "moso/disables/bin",
162
+ rules: {
163
+ "antfu/no-import-dist": "off",
164
+ "antfu/no-import-node-modules-by-path": "off"
165
+ }
166
+ },
167
+ {
168
+ files: ["**/*.d.?([cm])ts"],
169
+ name: "moso/disables/dts",
170
+ rules: {
171
+ "eslint-comments/no-unlimited-disable": "off",
172
+ "import/no-duplicates": "off",
173
+ "no-restricted-syntax": "off",
174
+ "unused-imports/no-unused-vars": "off"
175
+ }
176
+ },
177
+ {
178
+ files: ["**/*.js", "**/*.cjs"],
179
+ name: "moso/disables/cjs",
180
+ rules: {
181
+ "@typescript-eslint/no-require-imports": "off"
182
+ }
183
+ },
184
+ {
185
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
186
+ name: "moso/disables/config-files",
187
+ rules: {
188
+ "no-console": "off",
189
+ "@typescript-eslint/explicit-function-return-type": "off"
190
+ }
191
+ }
192
+ ];
193
+ };
194
+
195
+ // src/configs/ignores.ts
196
+ var ignores = (userIgnores = []) => {
197
+ return [
198
+ {
199
+ name: "moso/ignores",
200
+ ignores: [
201
+ ...GLOB_EXCLUDE,
202
+ ...userIgnores
203
+ ]
204
+ }
205
+ ];
206
+ };
207
+
208
+ // src/configs/imports.ts
209
+ var imports = async (options = {}) => {
210
+ const {
211
+ stylistic: stylistic2 = true
212
+ } = options;
213
+ const [
214
+ antfuPlugin,
215
+ importXPlugin
216
+ ] = await Promise.all([
217
+ interopDefault(import("eslint-plugin-antfu")),
218
+ interopDefault(import("eslint-plugin-import-x"))
219
+ ]);
220
+ return [
221
+ {
222
+ name: "moso/imports/rules",
223
+ plugins: {
224
+ "antfu": antfuPlugin,
225
+ "import-x": importXPlugin
226
+ },
227
+ rules: {
228
+ "antfu/import-dedupe": "error",
229
+ "antfu/no-import-dist": "error",
230
+ "antfu/no-import-node-modules-by-path": "error",
231
+ "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
232
+ "import-x/first": "error",
233
+ "import-x/no-duplicates": "error",
234
+ "import-x/no-mutable-exports": "error",
235
+ "import-x/no-named-default": "off",
236
+ "import-x/no-self-import": "error",
237
+ "import-x/no-unresolved": "off",
238
+ "import-x/no-webpack-loader-syntax": "error",
239
+ ...stylistic2 ? {
240
+ "import-x/newline-after-import": ["error", { count: 1 }]
241
+ } : {}
242
+ }
243
+ }
244
+ ];
245
+ };
246
+
247
+ // src/configs/javascript.ts
248
+ import globals from "globals";
249
+ var javascript = async (options = {}) => {
250
+ const {
251
+ isInEditor = false,
252
+ overrides = {}
253
+ } = options;
254
+ const unusedImportsPlugin = await interopDefault(import("eslint-plugin-unused-imports"));
255
+ return [
256
+ {
257
+ languageOptions: {
258
+ ecmaVersion: 2022,
259
+ globals: {
260
+ ...globals.browser,
261
+ ...globals.es2021,
262
+ ...globals.node,
263
+ document: "readonly",
264
+ navigator: "readonly",
265
+ window: "readonly"
266
+ },
267
+ parserOptions: {
268
+ ecmaFeatures: {
269
+ jsx: true
270
+ },
271
+ ecmaVersion: 2022,
272
+ sourceType: "module"
273
+ },
274
+ sourceType: "module"
275
+ },
276
+ linterOptions: {
277
+ reportUnusedDisableDirectives: true
278
+ },
279
+ name: "moso/javascript/setup"
280
+ },
281
+ {
282
+ name: "moso/javascript/rules",
283
+ plugins: {
284
+ "unused-imports": unusedImportsPlugin
285
+ },
286
+ rules: {
287
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
288
+ "array-callback-return": "error",
289
+ "block-scoped-var": "error",
290
+ "camelcase": "off",
291
+ "consistent-return": "error",
292
+ "constructor-super": "error",
293
+ "curly": ["error", "multi-or-nest", "consistent"],
294
+ "default-case-last": "error",
295
+ "dot-notation": "warn",
296
+ "eqeqeq": ["error", "smart"],
297
+ "for-direction": "error",
298
+ "getter-return": "error",
299
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
300
+ "no-alert": "warn",
301
+ "no-async-promise-executor": "error",
302
+ "no-caller": "error",
303
+ "no-case-declarations": "error",
304
+ "no-class-assign": "error",
305
+ "no-compare-neg-zero": "error",
306
+ "no-cond-assign": ["error", "always"],
307
+ "no-console": ["warn", { allow: ["warn", "error"] }],
308
+ "no-const-assign": "error",
309
+ "no-control-regex": "error",
310
+ "no-debugger": "warn",
311
+ "no-delete-var": "error",
312
+ "no-dupe-args": "error",
313
+ "no-dupe-class-members": "error",
314
+ "no-dupe-else-if": "error",
315
+ "no-dupe-keys": "error",
316
+ "no-duplicate-case": "error",
317
+ "no-duplicate-imports": "error",
318
+ "no-empty": ["error", { allowEmptyCatch: true }],
319
+ "no-empty-character-class": "error",
320
+ "no-empty-pattern": "error",
321
+ "no-eval": "error",
322
+ "no-ex-assign": "error",
323
+ "no-extra-bind": "error",
324
+ "no-extra-boolean-cast": "error",
325
+ "no-fallthrough": ["warn", { commentPattern: "break[\\s\\w]*omitted" }],
326
+ "no-func-assign": "error",
327
+ "no-global-assign": "error",
328
+ "no-implied-eval": "error",
329
+ "no-import-assign": "error",
330
+ "no-inner-declarations": "error",
331
+ "no-invalid-regexp": "error",
332
+ "no-irregular-whitespace": "error",
333
+ "no-iterator": "error",
334
+ "no-lonely-if": "error",
335
+ "no-loss-of-precision": "error",
336
+ "no-misleading-character-class": "error",
337
+ "no-multi-str": "error",
338
+ "no-new-native-nonconstructor": "error",
339
+ "no-nonoctal-decimal-escape": "error",
340
+ "no-obj-calls": "error",
341
+ "no-octal": "error",
342
+ "no-prototype-builtins": "error",
343
+ "no-redeclare": ["error", { builtinGlobals: true }],
344
+ "no-regex-spaces": "error",
345
+ "no-restricted-globals": [
346
+ "error",
347
+ { message: "Use `globalThis` instead", name: "global" },
348
+ { message: "Use `globalThis` instead", name: "self" }
349
+ ],
350
+ "no-restricted-properties": [
351
+ "error",
352
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
353
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
354
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
355
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
356
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
357
+ ],
358
+ "no-restricted-syntax": [
359
+ "error",
360
+ "DebuggerStatement",
361
+ "ForInStatement",
362
+ "LabeledStatement",
363
+ "TSEnumDeclaration[const=true]",
364
+ "TSExportAssignment",
365
+ "WithStatement"
366
+ ],
367
+ "no-return-assign": "off",
368
+ "no-self-assign": "error",
369
+ "no-self-compare": "error",
370
+ "no-sequences": "error",
371
+ "no-setter-return": "error",
372
+ "no-shadow-restricted-names": "error",
373
+ "no-sparse-arrays": "error",
374
+ "no-template-curly-in-string": "error",
375
+ "no-this-before-super": "error",
376
+ "no-throw-literal": "error",
377
+ "no-undef": "error",
378
+ "no-undef-init": "error",
379
+ "no-unexpected-multiline": "error",
380
+ "no-unmodified-loop-condition": "error",
381
+ "no-unneeded-ternary": "error",
382
+ "no-unreachable": "error",
383
+ "no-unsafe-finally": "error",
384
+ "no-unsafe-negation": "error",
385
+ "no-unsafe-optional-chaining": "error",
386
+ "no-unused-expressions": [
387
+ "error",
388
+ {
389
+ allowShortCircuit: true,
390
+ allowTaggedTemplates: true,
391
+ allowTernary: true
392
+ }
393
+ ],
394
+ "no-unused-labels": "error",
395
+ "no-unused-vars": [
396
+ "error",
397
+ {
398
+ args: "none",
399
+ caughtErrors: "none",
400
+ ignoreRestSiblings: true,
401
+ vars: "all"
402
+ }
403
+ ],
404
+ "no-use-before-define": "error",
405
+ "no-useless-backreference": "error",
406
+ "no-useless-call": "error",
407
+ "no-useless-catch": "error",
408
+ "no-useless-computed-key": "error",
409
+ "no-useless-constructor": "error",
410
+ "no-useless-escape": "error",
411
+ "no-useless-rename": "error",
412
+ "no-var": "error",
413
+ "no-with": "error",
414
+ "object-shorthand": [
415
+ "error",
416
+ "always",
417
+ {
418
+ avoidQuotes: true,
419
+ ignoreConstructors: false
420
+ }
421
+ ],
422
+ "one-var": ["error", { initialized: "never" }],
423
+ "prefer-arrow-callback": [
424
+ "error",
425
+ {
426
+ allowNamedFunctions: false,
427
+ allowUnboundThis: true
428
+ }
429
+ ],
430
+ "prefer-const": [
431
+ isInEditor ? "warn" : "error",
432
+ {
433
+ destructuring: "any",
434
+ ignoreReadBeforeAssign: true
435
+ }
436
+ ],
437
+ "prefer-exponentiation-operator": "error",
438
+ "prefer-promise-reject-errors": "error",
439
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
440
+ "prefer-rest-params": "error",
441
+ "prefer-spread": "error",
442
+ "prefer-template": "error",
443
+ "symbol-description": "error",
444
+ "unicode-bom": ["error", "never"],
445
+ "unused-imports/no-unused-imports": isInEditor ? "warn" : "error",
446
+ "unused-imports/no-unused-vars": [
447
+ "error",
448
+ {
449
+ args: "after-used",
450
+ argsIgnorePattern: "^_",
451
+ ignoreRestSiblings: true,
452
+ vars: "all",
453
+ varsIgnorePattern: "^_"
454
+ }
455
+ ],
456
+ "use-isnan": [
457
+ "error",
458
+ {
459
+ enforceForIndexOf: true,
460
+ enforceForSwitchCase: true
461
+ }
462
+ ],
463
+ "valid-typeof": ["error", { requireStringLiterals: true }],
464
+ "vars-on-top": "error",
465
+ "yoda": ["error", "never"],
466
+ ...overrides
467
+ }
468
+ }
469
+ ];
470
+ };
471
+
472
+ // src/configs/jsdoc.ts
473
+ var jsdoc = async (options = {}) => {
474
+ const { stylistic: stylistic2 = true } = options;
475
+ const jsdocPlugin = await interopDefault(import("eslint-plugin-jsdoc"));
476
+ return [
477
+ {
478
+ name: "moso/jsdoc/rules",
479
+ plugins: {
480
+ jsdoc: jsdocPlugin
481
+ },
482
+ rules: {
483
+ "jsdoc/check-access": "warn",
484
+ "jsdoc/check-param-names": "warn",
485
+ "jsdoc/check-property-names": "warn",
486
+ "jsdoc/check-types": "warn",
487
+ "jsdoc/empty-tags": "warn",
488
+ "jsdoc/implements-on-classes": "warn",
489
+ "jsdoc/no-defaults": "warn",
490
+ "jsdoc/no-multi-asterisks": "warn",
491
+ "jsdoc/require-param-name": "warn",
492
+ "jsdoc/require-property": "warn",
493
+ "jsdoc/require-property-description": "warn",
494
+ "jsdoc/require-property-name": "warn",
495
+ "jsdoc/require-returns-check": "warn",
496
+ "jsdoc/require-returns-description": "warn",
497
+ "jsdoc/require-yields-check": "warn",
498
+ ...stylistic2 ? {
499
+ "jsdoc/check-alignment": "warn",
500
+ "jsdoc/multiline-blocks": "warn"
501
+ } : {}
502
+ }
503
+ }
504
+ ];
505
+ };
506
+
507
+ // src/configs/jsonc.ts
508
+ var jsonc = async (options = {}) => {
509
+ const {
510
+ files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
511
+ overrides = {},
512
+ stylistic: stylistic2 = true
513
+ } = options;
514
+ const { indent = 4 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
515
+ const [
516
+ jsoncPlugin,
517
+ jsoncParser
518
+ ] = await Promise.all([
519
+ interopDefault(import("eslint-plugin-jsonc")),
520
+ interopDefault(import("jsonc-eslint-parser"))
521
+ ]);
522
+ return [
523
+ {
524
+ name: "moso/jsonc/setup",
525
+ plugins: {
526
+ jsonc: jsoncPlugin
527
+ }
528
+ },
529
+ {
530
+ files,
531
+ languageOptions: {
532
+ parser: jsoncParser
533
+ },
534
+ name: "moso/jsonc/rules",
535
+ rules: {
536
+ "jsonc/no-bigint-literals": "error",
537
+ "jsonc/no-binary-expression": "error",
538
+ "jsonc/no-binary-numeric-literals": "error",
539
+ "jsonc/no-dupe-keys": "error",
540
+ "jsonc/no-escape-sequence-in-identifier": "error",
541
+ "jsonc/no-floating-decimal": "error",
542
+ "jsonc/no-hexadecimal-numeric-literals": "error",
543
+ "jsonc/no-infinity": "error",
544
+ "jsonc/no-multi-str": "error",
545
+ "jsonc/no-nan": "error",
546
+ "jsonc/no-number-props": "error",
547
+ "jsonc/no-numeric-separators": "error",
548
+ "jsonc/no-octal": "error",
549
+ "jsonc/no-octal-escape": "error",
550
+ "jsonc/no-octal-numeric-literals": "error",
551
+ "jsonc/no-parenthesized": "error",
552
+ "jsonc/no-plus-sign": "error",
553
+ "jsonc/no-regexp-literals": "error",
554
+ "jsonc/no-sparse-arrays": "error",
555
+ "jsonc/no-template-literals": "error",
556
+ "jsonc/no-undefined-value": "error",
557
+ "jsonc/no-unicode-codepoint-escapes": "error",
558
+ "jsonc/no-useless-escape": "error",
559
+ "jsonc/space-unary-ops": "error",
560
+ "jsonc/valid-json-number": "error",
561
+ "jsonc/vue-custom-block/no-parsing-error": "error",
562
+ ...stylistic2 ? {
563
+ "jsonc/array-bracket-spacing": ["error", "never"],
564
+ "jsonc/comma-dangle": ["error", "never"],
565
+ "jsonc/comma-style": ["error", "last"],
566
+ "jsonc/indent": ["error", indent],
567
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
568
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
569
+ "jsonc/object-curly-spacing": ["error", "always"],
570
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
571
+ "jsonc/quote-props": "error",
572
+ "jsonc/quotes": "error"
573
+ } : {},
574
+ ...overrides
575
+ }
576
+ }
577
+ ];
578
+ };
579
+
580
+ // src/configs/jsx.ts
581
+ var jsx = () => {
582
+ return [
583
+ {
584
+ name: "moso/jsx/setup",
585
+ files: [GLOB_JSX, GLOB_TSX],
586
+ languageOptions: {
587
+ parserOptions: {
588
+ ecmaFeatures: {
589
+ jsx: true
590
+ }
591
+ }
592
+ }
593
+ }
594
+ ];
595
+ };
596
+
597
+ // src/configs/node.ts
598
+ var node = async () => {
599
+ const nodePlugin = await interopDefault(import("eslint-plugin-n"));
600
+ return [
601
+ {
602
+ name: "moso/node/rules",
603
+ plugins: {
604
+ node: nodePlugin
605
+ },
606
+ rules: {
607
+ "node/handle-callback-err": ["error", "^(err|error)$"],
608
+ "node/no-deprecated-api": "error",
609
+ "node/no-exports-assign": "error",
610
+ "node/no-new-require": "error",
611
+ "node/no-path-concat": "error",
612
+ "node/prefer-global/buffer": ["error", "never"],
613
+ "node/prefer-global/process": ["error", "never"],
614
+ "node/process-exit-as-throw": "error"
615
+ }
616
+ }
617
+ ];
618
+ };
619
+
620
+ // src/configs/perfectionist.ts
621
+ var perfectionist = async (options = {}) => {
622
+ const {
623
+ lessOpinionated = false,
624
+ overrides = {}
625
+ } = {
626
+ ...options
627
+ };
628
+ const perfectionistPlugin = await interopDefault(import("eslint-plugin-perfectionist"));
629
+ return [
630
+ {
631
+ name: "moso/perfectionist/setup",
632
+ plugins: {
633
+ perfectionist: perfectionistPlugin
634
+ },
635
+ rules: {
636
+ ...lessOpinionated ? {} : {
637
+ "perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
638
+ "perfectionist/sort-imports": ["error", {
639
+ groups: [
640
+ "builtin",
641
+ "external",
642
+ "internal",
643
+ ["parent", "sibling", "index"],
644
+ "side-effect",
645
+ "object",
646
+ "unknown",
647
+ "builtin-type",
648
+ "external-type",
649
+ "type",
650
+ ["parent-type", "sibling-type", "index-type", "internal-type"]
651
+ ],
652
+ newlinesBetween: "ignore",
653
+ order: "asc",
654
+ type: "natural"
655
+ }],
656
+ "perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
657
+ "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
658
+ },
659
+ ...overrides
660
+ }
661
+ }
662
+ ];
663
+ };
664
+
665
+ // src/configs/react.ts
666
+ import { isPackageExists } from "local-pkg";
667
+ var ReactRefreshAllowConstantExportPackages = [
668
+ "vite"
669
+ ];
670
+ var RemixPackages = [
671
+ "@remix-run/node",
672
+ "@remix-run/react",
673
+ "@remix-run/serve",
674
+ "@remix-run/dev"
675
+ ];
676
+ var ReactRouterPackages = [
677
+ "@react-router/node",
678
+ "@react-router/react",
679
+ "@react-router/serve",
680
+ "@react-router/dev"
681
+ ];
682
+ var NextJsPackages = [
683
+ "next"
684
+ ];
685
+ var react = async (options = {}) => {
686
+ const {
687
+ files = [GLOB_SRC],
688
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
689
+ ignoresTypeAware = [`${GLOB_MARKDOWN}/**`],
690
+ overrides = {},
691
+ tsconfigPath
692
+ } = options;
693
+ const isTypeAware = !!tsconfigPath;
694
+ const typeAwareRules = {
695
+ "@eslint-react/dom/no-unknown-property": "off",
696
+ "@eslint-react/no-duplicate-jsx-props": "off",
697
+ "@eslint-react/use-jsx-vars": "off",
698
+ "@eslint-react/no-leaked-conditional-rendering": "warn"
699
+ };
700
+ const [
701
+ reactPlugin,
702
+ reactHooksPlugin,
703
+ reactRefreshPlugin
704
+ ] = await Promise.all([
705
+ interopDefault(import("@eslint-react/eslint-plugin")),
706
+ interopDefault(import("eslint-plugin-react-hooks")),
707
+ interopDefault(import("eslint-plugin-react-refresh"))
708
+ ]);
709
+ const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((x) => isPackageExists(x));
710
+ const isUsingRemix = RemixPackages.some((x) => isPackageExists(x));
711
+ const isUsingReactRouter = ReactRouterPackages.some((x) => isPackageExists(x));
712
+ const isUsingNext = NextJsPackages.some((x) => isPackageExists(x));
713
+ const plugins = reactPlugin.configs.all.plugins;
714
+ return [
715
+ {
716
+ name: "moso/react/setup",
717
+ plugins: {
718
+ "@eslint-react": plugins["@eslint-react"],
719
+ "@eslint-react/dom": plugins["@eslint-react/dom"],
720
+ "@eslint-react/hooks-extra": plugins["@eslint-react/hooks-extra"],
721
+ "@eslint-react/naming-convention": plugins["@eslint-react/naming-convention"],
722
+ "@eslint-react/web-api": plugins["@eslint-react/web-api"],
723
+ "react-hooks": reactHooksPlugin,
724
+ "react-refresh": reactRefreshPlugin
725
+ }
726
+ },
727
+ {
728
+ files,
729
+ languageOptions: {
730
+ parserOptions: {
731
+ ecmaFeatures: {
732
+ jsx: true
733
+ }
734
+ },
735
+ sourceType: "module"
736
+ },
737
+ name: "moso/react/rules",
738
+ rules: {
739
+ // Recommended rules from @eslint-react/dom
740
+ "@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
741
+ "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
742
+ "@eslint-react/dom/no-find-dom-node": "error",
743
+ "@eslint-react/dom/no-missing-button-type": "warn",
744
+ "@eslint-react/dom/no-missing-iframe-sandbox": "warn",
745
+ "@eslint-react/dom/no-namespace": "error",
746
+ "@eslint-react/dom/no-render-return-value": "error",
747
+ "@eslint-react/dom/no-script-url": "warn",
748
+ "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
749
+ "@eslint-react/dom/no-unsafe-target-blank": "warn",
750
+ "@eslint-react/dom/no-void-elements-with-children": "warn",
751
+ // Recommended rules for eslint-plugin-react-hooks
752
+ "react-hooks/exhaustive-deps": "warn",
753
+ "react-hooks/rules-of-hooks": "error",
754
+ // react-refresh
755
+ "react-refresh/only-export-components": [
756
+ "warn",
757
+ {
758
+ allowConstantExport: isAllowConstantExport,
759
+ allowExportNames: [
760
+ ...isUsingNext ? [
761
+ "dynamic",
762
+ "dynamicParams",
763
+ "revalidate",
764
+ "fetchCache",
765
+ "runtime",
766
+ "preferredRegion",
767
+ "maxDuration",
768
+ "config",
769
+ "generateStaticParams",
770
+ "metadata",
771
+ "generateMetadata",
772
+ "viewport",
773
+ "generateViewport"
774
+ ] : [],
775
+ ...isUsingRemix || isUsingReactRouter ? [
776
+ "meta",
777
+ "links",
778
+ "headers",
779
+ "loader",
780
+ "action"
781
+ ] : []
782
+ ]
783
+ }
784
+ ],
785
+ // Recommended rules from @eslint-react/web-api
786
+ // @see https://github.com/Rel1cx/eslint-react/blob/main/packages/plugins/eslint-plugin/src/configs/web-api.ts
787
+ "@eslint-react/web-api/no-leaked-event-listener": "warn",
788
+ "@eslint-react/web-api/no-leaked-interval": "warn",
789
+ "@eslint-react/web-api/no-leaked-resize-observer": "warn",
790
+ "@eslint-react/web-api/no-leaked-timeout": "warn",
791
+ // Recommended rules from @eslint-react
792
+ // @see https://github.com/Rel1cx/eslint-react/blob/main/packages/plugins/eslint-plugin/src/configs/core.ts
793
+ "@eslint-react/ensure-forward-ref-using-ref": "warn",
794
+ "@eslint-react/no-access-state-in-setstate": "error",
795
+ "@eslint-react/no-array-index-key": "warn",
796
+ "@eslint-react/no-children-count": "warn",
797
+ "@eslint-react/no-children-for-each": "warn",
798
+ "@eslint-react/no-children-map": "warn",
799
+ "@eslint-react/no-children-only": "warn",
800
+ "@eslint-react/no-children-to-array": "warn",
801
+ "@eslint-react/no-clone-element": "warn",
802
+ "@eslint-react/no-comment-textnodes": "warn",
803
+ "@eslint-react/no-component-will-mount": "error",
804
+ "@eslint-react/no-component-will-receive-props": "error",
805
+ "@eslint-react/no-component-will-update": "error",
806
+ "@eslint-react/no-context-provider": "warn",
807
+ "@eslint-react/no-create-ref": "error",
808
+ "@eslint-react/no-default-props": "error",
809
+ "@eslint-react/no-direct-mutation-state": "error",
810
+ "@eslint-react/no-duplicate-key": "error",
811
+ "@eslint-react/no-forward-ref": "warn",
812
+ "@eslint-react/no-implicit-key": "warn",
813
+ "@eslint-react/no-missing-key": "error",
814
+ "@eslint-react/no-nested-components": "error",
815
+ "@eslint-react/no-prop-types": "error",
816
+ "@eslint-react/no-redundant-should-component-update": "error",
817
+ "@eslint-react/no-set-state-in-component-did-mount": "warn",
818
+ "@eslint-react/no-set-state-in-component-did-update": "warn",
819
+ "@eslint-react/no-set-state-in-component-will-update": "warn",
820
+ "@eslint-react/no-string-refs": "error",
821
+ "@eslint-react/no-unsafe-component-will-mount": "warn",
822
+ "@eslint-react/no-unsafe-component-will-receive-props": "warn",
823
+ "@eslint-react/no-unsafe-component-will-update": "warn",
824
+ "@eslint-react/no-unstable-context-value": "warn",
825
+ "@eslint-react/no-unstable-default-props": "warn",
826
+ "@eslint-react/no-unused-class-component-members": "warn",
827
+ "@eslint-react/no-unused-state": "warn",
828
+ "@eslint-react/use-jsx-vars": "warn",
829
+ "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
830
+ "@eslint-react/hooks-extra/no-useless-custom-hooks": "warn",
831
+ "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
832
+ "@eslint-react/naming-convention/context-name": "warn",
833
+ "@eslint-react/naming-convention/use-state": "warn",
834
+ "@eslint-react/prefer-destructuring-assignment": "warn",
835
+ "@eslint-react/prefer-shorthand-boolean": "warn",
836
+ "@eslint-react/prefer-shorthand-fragment": "warn",
837
+ ...overrides
838
+ }
839
+ },
840
+ ...isTypeAware ? [
841
+ {
842
+ files: filesTypeAware,
843
+ ignores: ignoresTypeAware,
844
+ name: "moso/react/type-aware-rules",
845
+ rules: {
846
+ ...typeAwareRules
847
+ }
848
+ }
849
+ ] : []
850
+ ];
851
+ };
852
+
853
+ // src/configs/sort.ts
854
+ var sortPackageJson = () => {
855
+ return [
856
+ {
857
+ files: ["**/package.json"],
858
+ name: "moso/sort/package-json",
859
+ rules: {
860
+ "jsonc/sort-array-values": [
861
+ "error",
862
+ {
863
+ order: { type: "asc" },
864
+ pathPattern: "^files$"
865
+ }
866
+ ],
867
+ "jsonc/sort-keys": [
868
+ "error",
869
+ {
870
+ order: [
871
+ "publisher",
872
+ "name",
873
+ "displayName",
874
+ "type",
875
+ "version",
876
+ "private",
877
+ "packageManager",
878
+ "description",
879
+ "author",
880
+ "license",
881
+ "funding",
882
+ "homepage",
883
+ "repository",
884
+ "bugs",
885
+ "keywords",
886
+ "categories",
887
+ "sideEffects",
888
+ "exports",
889
+ "main",
890
+ "module",
891
+ "unpkg",
892
+ "jsdelivr",
893
+ "types",
894
+ "typesVersions",
895
+ "bin",
896
+ "icon",
897
+ "files",
898
+ "engines",
899
+ "activationEvents",
900
+ "contributes",
901
+ "scripts",
902
+ "peerDependencies",
903
+ "peerDependenciesMeta",
904
+ "dependencies",
905
+ "optionalDependencies",
906
+ "devDependencies",
907
+ "pnpm",
908
+ "overrides",
909
+ "resolutions",
910
+ "husky",
911
+ "simple-git-hooks",
912
+ "lint-staged",
913
+ "eslintConfig"
914
+ ],
915
+ pathPattern: "^$"
916
+ },
917
+ {
918
+ order: { type: "asc" },
919
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
920
+ },
921
+ {
922
+ order: { type: "asc" },
923
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
924
+ },
925
+ {
926
+ order: [
927
+ "types",
928
+ "import",
929
+ "require",
930
+ "default"
931
+ ],
932
+ pathPattern: "^exports.*$"
933
+ },
934
+ {
935
+ order: [
936
+ "pre-commit",
937
+ "prepare-commit-msg",
938
+ "commit-msg",
939
+ "post-commit",
940
+ "pre-rebase",
941
+ "post-rewrite",
942
+ "post-checkout",
943
+ "post-merge",
944
+ "pre-push",
945
+ "pre-auto-gc"
946
+ ],
947
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
948
+ }
949
+ ]
950
+ }
951
+ }
952
+ ];
953
+ };
954
+ var sortTsconfig = () => {
955
+ return [
956
+ {
957
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
958
+ name: "moso/sort/tsconfig-json",
959
+ rules: {
960
+ "jsonc/sort-keys": [
961
+ "error",
962
+ {
963
+ order: [
964
+ "extends",
965
+ "compilerOptions",
966
+ "references",
967
+ "files",
968
+ "include",
969
+ "exclude"
970
+ ],
971
+ pathPattern: "^$"
972
+ },
973
+ {
974
+ order: [
975
+ "incremental",
976
+ "composite",
977
+ "tsBuildInfoFile",
978
+ "disableSourceOfProjectReferenceRedirect",
979
+ "disableSolutionSearching",
980
+ "disableReferencedProjectLoad",
981
+ "target",
982
+ "jsx",
983
+ "jsxFactory",
984
+ "jsxFragmentFactory",
985
+ "jsxImportSource",
986
+ "lib",
987
+ "moduleDetection",
988
+ "noLib",
989
+ "reactNamespace",
990
+ "useDefineForClassFields",
991
+ "emitDecoratorMetadata",
992
+ "experimentalDecorators",
993
+ "baseUrl",
994
+ "rootDir",
995
+ "rootDirs",
996
+ "customConditions",
997
+ "module",
998
+ "moduleResolution",
999
+ "moduleSuffixes",
1000
+ "noResolve",
1001
+ "paths",
1002
+ "resolveJsonModule",
1003
+ "resolvePackageJsonExports",
1004
+ "resolvePackageJsonImports",
1005
+ "typeRoots",
1006
+ "types",
1007
+ "allowArbitraryExtensions",
1008
+ "allowImportingTsExtensions",
1009
+ "allowUmdGlobalAccess",
1010
+ "allowJs",
1011
+ "checkJs",
1012
+ "maxNodeModuleJsDepth",
1013
+ "strict",
1014
+ "strictBindCallApply",
1015
+ "strictFunctionTypes",
1016
+ "strictNullChecks",
1017
+ "strictPropertyInitialization",
1018
+ "allowUnreachableCode",
1019
+ "allowUnusedLabels",
1020
+ "alwaysStrict",
1021
+ "exactOptionalPropertyTypes",
1022
+ "noFallthroughCasesInSwitch",
1023
+ "noImplicitAny",
1024
+ "noImplicitOverride",
1025
+ "noImplicitReturns",
1026
+ "noImplicitThis",
1027
+ "noPropertyAccessFromIndexSignature",
1028
+ "noUncheckedIndexedAccess",
1029
+ "noUnusedLocals",
1030
+ "noUnusedParameters",
1031
+ "useUnknownInCatchVariables",
1032
+ "declaration",
1033
+ "declarationDir",
1034
+ "declarationMap",
1035
+ "downlevelIteration",
1036
+ "emitBOM",
1037
+ "emitDeclarationOnly",
1038
+ "importHelpers",
1039
+ "importsNotUsedAsValues",
1040
+ "inlineSourceMap",
1041
+ "inlineSources",
1042
+ "mapRoot",
1043
+ "newLine",
1044
+ "noEmit",
1045
+ "noEmitHelpers",
1046
+ "noEmitOnError",
1047
+ "outDir",
1048
+ "outFile",
1049
+ "preserveConstEnums",
1050
+ "preserveValueImports",
1051
+ "removeComments",
1052
+ "sourceMap",
1053
+ "sourceRoot",
1054
+ "stripInternal",
1055
+ "allowSyntheticDefaultImports",
1056
+ "esModuleInterop",
1057
+ "forceConsistentCasingInFileNames",
1058
+ "isolatedModules",
1059
+ "preserveSymlinks",
1060
+ "verbatimModuleSyntax",
1061
+ "skipDefaultLibCheck",
1062
+ "skipLibCheck"
1063
+ ],
1064
+ pathPattern: "^compilerOptions$"
1065
+ }
1066
+ ]
1067
+ }
1068
+ }
1069
+ ];
1070
+ };
1071
+
1072
+ // src/configs/stylistic.ts
1073
+ var StylisticConfigDefaults = {
1074
+ indent: 4,
1075
+ jsx: true,
1076
+ quotes: "single",
1077
+ semi: true
1078
+ };
1079
+ var stylistic = async (options = {}) => {
1080
+ const {
1081
+ indent,
1082
+ jsx: jsx2,
1083
+ lessOpinionated = false,
1084
+ overrides = {},
1085
+ quotes,
1086
+ semi
1087
+ } = {
1088
+ ...StylisticConfigDefaults,
1089
+ ...options
1090
+ };
1091
+ const [
1092
+ antfuPlugin,
1093
+ stylisticPlugin
1094
+ ] = await Promise.all([
1095
+ interopDefault(import("eslint-plugin-antfu")),
1096
+ interopDefault(import("@stylistic/eslint-plugin"))
1097
+ ]);
1098
+ const config = stylisticPlugin.configs.customize({
1099
+ indent,
1100
+ jsx: jsx2,
1101
+ quotes,
1102
+ semi
1103
+ });
1104
+ return [
1105
+ {
1106
+ name: "moso/stylistic/rules",
1107
+ plugins: {
1108
+ "@stylistic": stylisticPlugin,
1109
+ "antfu": antfuPlugin
1110
+ },
1111
+ rules: {
1112
+ ...config.rules,
1113
+ "antfu/consistent-list-newline": "error",
1114
+ "@stylistic/object-curly-newline": "off",
1115
+ ...lessOpinionated ? {
1116
+ curly: ["error", "all"]
1117
+ } : {
1118
+ "@stylistic/array-bracket-spacing": ["error", "never"],
1119
+ "@stylistic/arrow-parens": ["error", "always"],
1120
+ "@stylistic/block-spacing": ["error", "always"],
1121
+ "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
1122
+ "@stylistic/comma-dangle": ["error", "always-multiline"],
1123
+ "@stylistic/comma-spacing": ["error", { before: false, after: true }],
1124
+ "@stylistic/comma-style": ["error", "last"],
1125
+ "@stylistic/func-call-spacing": ["error", "never"],
1126
+ "@stylistic/generator-star-spacing": "off",
1127
+ "@stylistic/indent": [
1128
+ "error",
1129
+ 4,
1130
+ {
1131
+ SwitchCase: 1,
1132
+ VariableDeclarator: 1,
1133
+ outerIIFEBody: 1
1134
+ }
1135
+ ],
1136
+ "@stylistic/key-spacing": [
1137
+ "error",
1138
+ {
1139
+ beforeColon: false,
1140
+ afterColon: true
1141
+ }
1142
+ ],
1143
+ "@stylistic/member-delimiter-style": [
1144
+ "error",
1145
+ {
1146
+ multiline: {
1147
+ delimiter: "semi",
1148
+ requireLast: true
1149
+ }
1150
+ }
1151
+ ],
1152
+ "@stylistic/no-confusing-arrow": ["error", { onlyOneSimpleParam: true }],
1153
+ "@stylistic/no-mixed-operators": [
1154
+ "error",
1155
+ {
1156
+ groups: [
1157
+ ["&", "|", "^", "~", "<<", ">>", ">>>"],
1158
+ ["&&", "||"]
1159
+ ]
1160
+ }
1161
+ ],
1162
+ "@stylistic/no-mixed-spaces-and-tabs": "error",
1163
+ "@stylistic/no-multi-spaces": "error",
1164
+ "@stylistic/no-tabs": "error",
1165
+ "@stylistic/no-trailing-spaces": [
1166
+ "error",
1167
+ {
1168
+ skipBlankLines: true,
1169
+ ignoreComments: true
1170
+ }
1171
+ ],
1172
+ "@stylistic/operator-linebreak": ["error", "before"],
1173
+ "@stylistic/quote-props": ["error", "consistent"],
1174
+ "@stylistic/quotes": ["error", "single", { allowTemplateLiterals: true }],
1175
+ "@stylistic/rest-spread-spacing": ["error", "never"],
1176
+ "@stylistic/semi": ["error", "always"],
1177
+ "@stylistic/semi-spacing": "error",
1178
+ "@stylistic/semi-style": ["error", "last"],
1179
+ "@stylistic/space-before-blocks": "error",
1180
+ "@stylistic/space-before-function-paren": [
1181
+ "error",
1182
+ {
1183
+ anonymous: "never",
1184
+ named: "never",
1185
+ asyncArrow: "always"
1186
+ }
1187
+ ],
1188
+ "@stylistic/space-infix-ops": "error",
1189
+ "@stylistic/space-unary-ops": "error",
1190
+ "@stylistic/spaced-comment": ["error", "always"],
1191
+ "@stylistic/switch-colon-spacing": "error",
1192
+ "@stylistic/template-curly-spacing": "error",
1193
+ "@stylistic/template-tag-spacing": ["error", "always"],
1194
+ "@stylistic/wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
1195
+ "@stylistic/wrap-regex": "error",
1196
+ "@stylistic/yield-star-spacing": ["error", "before"]
1197
+ },
1198
+ ...overrides
1199
+ }
1200
+ }
1201
+ ];
1202
+ };
1203
+
1204
+ // src/configs/test.ts
1205
+ var test = async (options = {}) => {
1206
+ const {
1207
+ files = GLOB_TESTS,
1208
+ isInEditor = false,
1209
+ overrides = {}
1210
+ } = options;
1211
+ const [
1212
+ vitestPlugin,
1213
+ noOnlyTestsPlugin
1214
+ ] = await Promise.all([
1215
+ interopDefault(import("@vitest/eslint-plugin")),
1216
+ interopDefault(import("eslint-plugin-no-only-tests"))
1217
+ ]);
1218
+ return [
1219
+ {
1220
+ name: "moso/test/setup",
1221
+ plugins: {
1222
+ "vitest": vitestPlugin,
1223
+ "no-only-tests": noOnlyTestsPlugin
1224
+ }
1225
+ },
1226
+ {
1227
+ files,
1228
+ name: "moso/test/rules",
1229
+ rules: {
1230
+ "vitest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1231
+ "vitest/no-identical-title": "error",
1232
+ "vitest/no-import-node-test": "error",
1233
+ "vitest/prefer-hooks-in-order": "error",
1234
+ "vitest/prefer-lowercase-title": "error",
1235
+ "no-only-tests/no-only-tests": isInEditor ? "warn" : "error",
1236
+ // Disables for tests
1237
+ ...{
1238
+ "no-unused-expressions": "off",
1239
+ "node/prefer-global/process": "off",
1240
+ "typescript/explicit-function-return-type": "off"
1241
+ },
1242
+ ...overrides
1243
+ }
1244
+ }
1245
+ ];
1246
+ };
1247
+
1248
+ // src/configs/typescript.ts
1249
+ import process2 from "node:process";
1250
+ var typescript = async (options = {}) => {
1251
+ const {
1252
+ componentExts = [],
1253
+ overrides = {},
1254
+ overridesTypeAware = {},
1255
+ parserOptions = {}
1256
+ } = options;
1257
+ const files = options.files ?? [
1258
+ GLOB_TS,
1259
+ GLOB_TSX,
1260
+ ...componentExts.map((ext) => `**/*.${ext}`)
1261
+ ];
1262
+ const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1263
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`];
1264
+ const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
1265
+ const isTypeAware = !!tsconfigPath;
1266
+ const typeAwareRules = {
1267
+ // JS off
1268
+ "dot-notation": "off",
1269
+ "no-implied-eval": "off",
1270
+ "no-throw-literal": "off",
1271
+ // TypeScript
1272
+ "@typescript-eslint/await-thenable": "error",
1273
+ "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
1274
+ "@typescript-eslint/explicit-function-return-type": "off",
1275
+ "@typescript-eslint/explicit-member-accessibility": "off",
1276
+ "@typescript-eslint/no-empty-function": "off",
1277
+ "@typescript-eslint/no-empty-interface": "off",
1278
+ "@typescript-eslint/no-explicit-any": "off",
1279
+ "@typescript-eslint/no-floating-promises": "error",
1280
+ "@typescript-eslint/no-for-in-array": "error",
1281
+ "@typescript-eslint/no-implied-eval": "error",
1282
+ "@typescript-eslint/no-misused-promises": "error",
1283
+ "@typescript-eslint/no-non-null-assertion": "off",
1284
+ "@typescript-eslint/no-parameter-properties": "off",
1285
+ "@typescript-eslint/no-var-requires": "off",
1286
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
1287
+ "@typescript-eslint/no-unsafe-argument": "error",
1288
+ "@typescript-eslint/no-unsafe-assignment": "error",
1289
+ "@typescript-eslint/no-unsafe-call": "error",
1290
+ "@typescript-eslint/no-unsafe-member-access": "error",
1291
+ "@typescript-eslint/no-unsafe-return": "error",
1292
+ "@typescript-eslint/only-throw-literal": "error",
1293
+ "@typescript-eslint/restrict-plus-operands": "error",
1294
+ "@typescript-eslint/restrict-template-expressions": "error",
1295
+ "@typescript-eslint/unbound-method": "error"
1296
+ };
1297
+ const [
1298
+ antfuPlugin,
1299
+ typeScriptParser,
1300
+ typeScriptPlugin
1301
+ ] = await Promise.all([
1302
+ interopDefault(import("eslint-plugin-antfu")),
1303
+ interopDefault(import("@typescript-eslint/parser")),
1304
+ interopDefault(import("@typescript-eslint/eslint-plugin"))
1305
+ ]);
1306
+ const makeParser = (typeAware, files2, ignores2) => {
1307
+ return {
1308
+ files: files2,
1309
+ ...ignores2 ? { ignores: ignores2 } : {},
1310
+ languageOptions: {
1311
+ parser: typeScriptParser,
1312
+ parserOptions: {
1313
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1314
+ sourceType: "module",
1315
+ ...typeAware ? {
1316
+ projectService: {
1317
+ allowDefaultProject: ["./*.js"],
1318
+ defaultProject: tsconfigPath
1319
+ },
1320
+ tsconfigRootDir: process2.cwd()
1321
+ } : {},
1322
+ ...parserOptions
1323
+ }
1324
+ },
1325
+ name: `moso/typescript/${typeAware ? "type-aware-parser" : "parser"}`
1326
+ };
1327
+ };
1328
+ return [
1329
+ {
1330
+ name: "moso/typescript/setup",
1331
+ plugins: {
1332
+ "antfu": antfuPlugin,
1333
+ "@typescript-eslint": typeScriptPlugin
1334
+ }
1335
+ },
1336
+ ...isTypeAware ? [
1337
+ makeParser(false, files),
1338
+ makeParser(true, filesTypeAware, ignoresTypeAware)
1339
+ ] : [
1340
+ makeParser(false, files)
1341
+ ],
1342
+ {
1343
+ files,
1344
+ name: "moso/typescript/rules",
1345
+ rules: {
1346
+ ...typeScriptPlugin.configs["eslint-recommended"].overrides[0].rules,
1347
+ ...typeScriptPlugin.configs.strict.rules,
1348
+ // JS off
1349
+ "no-loss-of-precision": "off",
1350
+ "no-unused-vars": "off",
1351
+ "no-use-before-define": "off",
1352
+ // Stylistic
1353
+ "@stylistic/type-annotation-spacing": "error",
1354
+ // Typescript
1355
+ "@typescript-eslint/ban-ts-comment": [
1356
+ "error",
1357
+ {
1358
+ "ts-ignore": "allow-with-description"
1359
+ }
1360
+ ],
1361
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
1362
+ "@typescript-eslint/consistent-type-imports": [
1363
+ "error",
1364
+ {
1365
+ disallowTypeAnnotations: false,
1366
+ prefer: "type-imports"
1367
+ }
1368
+ ],
1369
+ "@typescript-eslint/method-signature-style": ["error", "property"],
1370
+ "@typescript-eslint/no-dynamic-delete": "off",
1371
+ "@typescript-eslint/no-explicit-any": "off",
1372
+ "@typescript-eslint/no-extraneous-class": "off",
1373
+ "@typescript-eslint/no-import-type-side-effects": "error",
1374
+ "@typescript-eslint/no-invalid-void-type": "off",
1375
+ "@typescript-eslint/no-non-null-assertion": "off",
1376
+ "@typescript-eslint/no-require-imports": "error",
1377
+ "@typescript-eslint/no-unused-vars": [
1378
+ "error",
1379
+ {
1380
+ argsIgnorePattern: "^_",
1381
+ args: "none",
1382
+ ignoreRestSiblings: true
1383
+ }
1384
+ ],
1385
+ "@typescript-eslint/no-use-before-define": [
1386
+ "error",
1387
+ {
1388
+ classes: false,
1389
+ functions: false,
1390
+ variables: true
1391
+ }
1392
+ ],
1393
+ "@typescript-eslint/no-useless-constructor": "off",
1394
+ "@typescript-eslint/triple-slash-reference": "off",
1395
+ "@typescript-eslint/unified-signatures": "off",
1396
+ ...overrides
1397
+ }
1398
+ },
1399
+ ...isTypeAware ? [{
1400
+ files: filesTypeAware,
1401
+ ignores: ignoresTypeAware,
1402
+ name: "moso/typescript/rules-type-aware",
1403
+ rules: {
1404
+ ...typeAwareRules,
1405
+ ...overridesTypeAware
1406
+ }
1407
+ }] : [],
1408
+ {
1409
+ files: ["**/*.d.ts"],
1410
+ name: "moso/typescript/disables/dts",
1411
+ rules: {
1412
+ "@eslint-community/eslint-comments/no-unlimited-disable": "off",
1413
+ "import-x/no-duplicates": "off",
1414
+ "no-restricted-syntax": "off",
1415
+ "unused-imports/no-unused-vars": "off"
1416
+ }
1417
+ },
1418
+ {
1419
+ files: ["**/*.{test,spec}.ts?(x)"],
1420
+ name: "moso/typescript/disables/test",
1421
+ rules: {
1422
+ "no-unused-expressions": "off"
1423
+ }
1424
+ },
1425
+ {
1426
+ files: ["**/*.js", "**/*.cjs"],
1427
+ name: "moso/typescript/disables/cjs",
1428
+ rules: {
1429
+ "@stylistic/no-require-imports": "off",
1430
+ "@stylistic/no-var-requires": "off"
1431
+ }
1432
+ }
1433
+ ];
1434
+ };
1435
+
1436
+ // src/configs/unicorn.ts
1437
+ var unicorn = async (options = {}) => {
1438
+ const unicornPlugin = await interopDefault(import("eslint-plugin-unicorn"));
1439
+ return [
1440
+ {
1441
+ name: "moso/unicorn/rules",
1442
+ plugins: {
1443
+ unicorn: unicornPlugin
1444
+ },
1445
+ rules: {
1446
+ ...options.allRecommended ? unicornPlugin.configs.recommended.rules : {
1447
+ "unicorn/consistent-empty-array-spread": "error",
1448
+ "unicorn/error-message": "error",
1449
+ "unicorn/escape-case": "error",
1450
+ "unicorn/no-new-array": "error",
1451
+ "unicorn/no-new-buffer": "error",
1452
+ "unicorn/number-literal-case": "error",
1453
+ "unicorn/prefer-dom-node-text-content": "error",
1454
+ "unicorn/prefer-includes": "error",
1455
+ "unicorn/prefer-node-protocol": "error",
1456
+ "unicorn/prefer-number-properties": "error",
1457
+ "unicorn/prefer-string-starts-ends-with": "error",
1458
+ "unicorn/prefer-type-error": "error",
1459
+ "unicorn/throw-new-error": "error"
1460
+ }
1461
+ }
1462
+ }
1463
+ ];
1464
+ };
1465
+
1466
+ // src/configs/vue.ts
1467
+ import { mergeProcessors } from "eslint-merge-processors";
1468
+ var vue = async (options = {}) => {
1469
+ const {
1470
+ files = [GLOB_VUE],
1471
+ overrides = {},
1472
+ stylistic: stylistic2 = true
1473
+ } = options;
1474
+ const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
1475
+ const { indent = 4 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1476
+ const [
1477
+ vuePlugin,
1478
+ vueParser,
1479
+ processorVueBlocks
1480
+ ] = await Promise.all([
1481
+ interopDefault(import("eslint-plugin-vue")),
1482
+ interopDefault(import("vue-eslint-parser")),
1483
+ interopDefault(import("eslint-processor-vue-blocks"))
1484
+ ]);
1485
+ return [
1486
+ {
1487
+ languageOptions: {
1488
+ globals: {
1489
+ computed: "readonly",
1490
+ defineEmits: "readonly",
1491
+ defineExpose: "readonly",
1492
+ defineProps: "readonly",
1493
+ onMounted: "readonly",
1494
+ onUnmounted: "readonly",
1495
+ reactive: "readonly",
1496
+ ref: "readonly",
1497
+ shallowReactive: "readonly",
1498
+ shallowRef: "readonly",
1499
+ toRef: "readonly",
1500
+ toRefs: "readonly",
1501
+ watch: "readonly",
1502
+ watchEffect: "readonly"
1503
+ }
1504
+ },
1505
+ name: "moso/vue/setup",
1506
+ plugins: {
1507
+ vue: vuePlugin
1508
+ }
1509
+ },
1510
+ {
1511
+ files,
1512
+ languageOptions: {
1513
+ parser: vueParser,
1514
+ parserOptions: {
1515
+ ecmaFeatures: {
1516
+ jsx: true
1517
+ },
1518
+ extraFileExtensions: [".vue"],
1519
+ parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
1520
+ sourceType: "module"
1521
+ }
1522
+ },
1523
+ name: "moso/vue/rules",
1524
+ processor: sfcBlocks === false ? vuePlugin.processors[".vue"] : mergeProcessors([
1525
+ vuePlugin.processors[".vue"],
1526
+ processorVueBlocks({
1527
+ ...sfcBlocks,
1528
+ blocks: {
1529
+ styles: true,
1530
+ ...sfcBlocks.blocks
1531
+ }
1532
+ })
1533
+ ]),
1534
+ rules: {
1535
+ ...vuePlugin.configs.base.rules,
1536
+ ...vuePlugin.configs["flat/essential"].map((x) => x.rules).reduce((acc, x) => ({ ...acc, ...x }), {}),
1537
+ ...vuePlugin.configs["flat/strongly-recommended"].map((x) => x.rules).reduce((acc, x) => ({ ...acc, ...x }), {}),
1538
+ ...vuePlugin.configs["flat/recommended"].map((x) => x.rules).reduce((acc, x) => ({ ...acc, ...x }), {}),
1539
+ "node/prefer-global/process": "off",
1540
+ "@typescript-eslint/explicit-function-return-type": "off",
1541
+ "vue/block-order": ["error", {
1542
+ order: ["script", "template", "style"]
1543
+ }],
1544
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
1545
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1546
+ "vue/component-tags-order": "off",
1547
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1548
+ "vue/define-macros-order": ["error", {
1549
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1550
+ }],
1551
+ "vue/dot-location": ["error", "property"],
1552
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1553
+ "vue/eqeqeq": ["error", "smart"],
1554
+ "vue/html-indent": ["error", indent],
1555
+ "vue/html-quotes": ["error", "double"],
1556
+ "vue/html-self-closing": "off",
1557
+ "vue/max-attributes-per-line": ["warn", { singleline: 5 }],
1558
+ "vue/multi-word-component-names": "off",
1559
+ "vue/no-dupe-keys": "off",
1560
+ "vue/no-empty-pattern": "error",
1561
+ "vue/no-irregular-whitespace": "error",
1562
+ "vue/no-loss-of-precision": "error",
1563
+ "vue/no-restricted-syntax": [
1564
+ "error",
1565
+ "DebuggerStatement",
1566
+ "LabeledStatement",
1567
+ "WithStatement"
1568
+ ],
1569
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1570
+ "vue/no-setup-props-reactivity-loss": "off",
1571
+ "vue/no-sparse-arrays": "error",
1572
+ "vue/no-unused-refs": "error",
1573
+ "vue/no-useless-v-bind": "error",
1574
+ "vue/no-v-html": "off",
1575
+ "vue/no-v-text-v-html-on-component": "off",
1576
+ "vue/object-shorthand": [
1577
+ "error",
1578
+ "always",
1579
+ {
1580
+ avoidQuotes: true,
1581
+ ignoreConstructors: false
1582
+ }
1583
+ ],
1584
+ "vue/prefer-import-from-vue": "off",
1585
+ "vue/prefer-separate-static-class": "error",
1586
+ "vue/prefer-template": "error",
1587
+ "vue/prop-name-casing": ["error", "camelCase"],
1588
+ "vue/require-default-prop": "off",
1589
+ "vue/require-prop-types": "off",
1590
+ "vue/space-infix-ops": "error",
1591
+ "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1592
+ ...stylistic2 ? {
1593
+ "vue/array-bracket-spacing": ["error", "never"],
1594
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
1595
+ "vue/block-spacing": ["error", "always"],
1596
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1597
+ "vue/comma-dangle": ["error", "always-multiline"],
1598
+ "vue/comma-spacing": ["error", { after: true, before: false }],
1599
+ "vue/comma-style": ["error", "last"],
1600
+ "vue/html-comment-content-spacing": ["error", "always", {
1601
+ exceptions: ["-"]
1602
+ }],
1603
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1604
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
1605
+ "vue/object-curly-newline": "off",
1606
+ "vue/object-curly-spacing": ["error", "always"],
1607
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1608
+ "vue/operator-linebreak": ["error", "before"],
1609
+ "vue/padding-line-between-blocks": ["error", "always"],
1610
+ "vue/quote-props": ["error", "consistent-as-needed"],
1611
+ "vue/singleline-html-element-content-newline": "off",
1612
+ "vue/space-in-parens": ["error", "never"],
1613
+ "vue/template-curly-spacing": "error"
1614
+ } : {},
1615
+ ...overrides
1616
+ }
1617
+ }
1618
+ ];
1619
+ };
1620
+
1621
+ // src/configs/yaml.ts
1622
+ var yaml = async (options = {}) => {
1623
+ const {
1624
+ files = [GLOB_YAML],
1625
+ overrides = {},
1626
+ stylistic: stylistic2 = true
1627
+ } = options;
1628
+ const {
1629
+ indent = 2,
1630
+ quotes = "single"
1631
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1632
+ const [
1633
+ yamlPlugin,
1634
+ yamlParser
1635
+ ] = await Promise.all([
1636
+ interopDefault(import("eslint-plugin-yml")),
1637
+ interopDefault(import("yaml-eslint-parser"))
1638
+ ]);
1639
+ return [
1640
+ {
1641
+ name: "moso/yaml/setup",
1642
+ plugins: {
1643
+ yml: yamlPlugin
1644
+ }
1645
+ },
1646
+ {
1647
+ files,
1648
+ languageOptions: {
1649
+ parser: yamlParser
1650
+ },
1651
+ name: "moso/yaml/rules",
1652
+ rules: {
1653
+ "@stylistic/spaced-comment": "off",
1654
+ "yml/block-mapping": "error",
1655
+ "yml/block-sequence": "error",
1656
+ "yml/no-empty-key": "error",
1657
+ "yml/no-empty-sequence-entry": "error",
1658
+ "yml/no-irregular-whitespace": "error",
1659
+ "yml/plain-scalar": "error",
1660
+ "yml/vue-custom-block/no-parsing-error": "error",
1661
+ ...stylistic2 ? {
1662
+ "yml/block-mapping-question-indicator-newline": "error",
1663
+ "yml/block-sequence-hyphen-indicator-newline": "error",
1664
+ "yml/flow-mapping-curly-newline": "error",
1665
+ "yml/flow-mapping-curly-spacing": "error",
1666
+ "yml/flow-sequence-bracket-newline": "error",
1667
+ "yml/flow-sequence-bracket-spacing": "error",
1668
+ "yml/indent": ["error", indent === "tab" ? 2 : indent],
1669
+ "yml/key-spacing": "error",
1670
+ "yml/no-tab-indent": "error",
1671
+ "yml/quotes": ["error", { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
1672
+ "yml/spaced-comment": "error"
1673
+ } : {},
1674
+ ...overrides
1675
+ }
1676
+ }
1677
+ ];
1678
+ };
1679
+
1680
+ // src/configurator.ts
1681
+ var flatConfigProps = [
1682
+ "languageOptions",
1683
+ "linterOptions",
1684
+ "name",
1685
+ "processor",
1686
+ "plugins",
1687
+ "rules",
1688
+ "settings"
1689
+ ];
1690
+ var VuePackages = [
1691
+ "nuxt",
1692
+ "vitepress",
1693
+ "vue"
1694
+ ];
1695
+ var ReactPackages = [
1696
+ "gatsby",
1697
+ "next",
1698
+ "nextra",
1699
+ "react",
1700
+ "remix"
1701
+ ];
1702
+ var moso = (options = {}, ...userConfigs) => {
1703
+ const {
1704
+ componentExts = [],
1705
+ gitignore: enableGitignore = true,
1706
+ jsx: enableJsx = true,
1707
+ react: enableReact = ReactPackages.some((x) => isPackageExists2(x)),
1708
+ typescript: enableTypeScript = isPackageExists2("typescript"),
1709
+ unicorn: enableUnicorn = true,
1710
+ vue: enableVue = VuePackages.some((x) => isPackageExists2(x))
1711
+ } = options;
1712
+ let isInEditor = options.isInEditor;
1713
+ if (isInEditor == null) {
1714
+ isInEditor = isInEditorEnv();
1715
+ if (isInEditor) {
1716
+ console.log("[@moso/eslint-config] Detected running in editor, some rules are disabled.");
1717
+ }
1718
+ }
1719
+ const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
1720
+ if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = enableJsx;
1721
+ const configs = [];
1722
+ if (enableGitignore) {
1723
+ if (typeof enableGitignore !== "boolean") {
1724
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((x) => [x({
1725
+ name: "moso/gitignore",
1726
+ ...enableGitignore
1727
+ })]));
1728
+ } else {
1729
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((x) => [x({
1730
+ name: "moso/gitignore",
1731
+ strict: false
1732
+ })]));
1733
+ }
1734
+ }
1735
+ const typescriptOptions = resolveSubOptions(options, "typescript");
1736
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
1737
+ configs.push(
1738
+ ignores(options.ignores),
1739
+ javascript({ overrides: getOverrides(options, "javascript") }),
1740
+ comments(),
1741
+ node(),
1742
+ jsdoc({ stylistic: stylisticOptions }),
1743
+ imports({ stylistic: stylisticOptions }),
1744
+ perfectionist()
1745
+ );
1746
+ if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
1747
+ if (enableVue) componentExts.push("vue");
1748
+ if (enableJsx) configs.push(jsx());
1749
+ if (enableTypeScript) {
1750
+ configs.push(typescript({
1751
+ ...typescriptOptions,
1752
+ componentExts,
1753
+ overrides: getOverrides(options, "typescript")
1754
+ }));
1755
+ }
1756
+ if (stylisticOptions) {
1757
+ configs.push(stylistic({
1758
+ ...stylisticOptions,
1759
+ lessOpinionated: options.lessOpinionated,
1760
+ overrides: getOverrides(options, "stylistic")
1761
+ }));
1762
+ }
1763
+ if (options.test ?? true) configs.push(test({ overrides: getOverrides(options, "test") }));
1764
+ if (enableVue) {
1765
+ configs.push(vue({
1766
+ ...resolveSubOptions(options, "vue"),
1767
+ overrides: getOverrides(options, "vue"),
1768
+ stylistic: stylisticOptions,
1769
+ typescript: !!enableTypeScript
1770
+ }));
1771
+ }
1772
+ if (enableReact) {
1773
+ configs.push(react({
1774
+ ...typescriptOptions,
1775
+ overrides: getOverrides(options, "react"),
1776
+ tsconfigPath
1777
+ }));
1778
+ }
1779
+ if (options.jsonc ?? true) {
1780
+ configs.push(
1781
+ jsonc({
1782
+ overrides: getOverrides(options, "jsonc"),
1783
+ stylistic: stylisticOptions
1784
+ }),
1785
+ sortPackageJson(),
1786
+ sortTsconfig()
1787
+ );
1788
+ }
1789
+ if (options.yaml ?? true) {
1790
+ configs.push(yaml({
1791
+ overrides: getOverrides(options, "yaml"),
1792
+ stylistic: stylisticOptions
1793
+ }));
1794
+ }
1795
+ configs.push(
1796
+ disables()
1797
+ );
1798
+ if ("files" in options)
1799
+ throw new Error('[@moso/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
1800
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
1801
+ if (key in options) acc[key] = options[key];
1802
+ return acc;
1803
+ }, {});
1804
+ if (Object.keys(fusedConfig).length) configs.push([fusedConfig]);
1805
+ let composer = new FlatConfigComposer();
1806
+ composer = composer.append(
1807
+ ...configs,
1808
+ ...userConfigs
1809
+ );
1810
+ if (isInEditor) {
1811
+ composer = composer.disableRulesFix([
1812
+ "unused-imports/no-unused-imports",
1813
+ "vitest/no-only-tests",
1814
+ "prefer-const"
1815
+ ], {
1816
+ builtinRules: () => import(["eslint", "use-at-your-own-risk"].join("/")).then((x) => x.builtinRules)
1817
+ });
1818
+ }
1819
+ return composer;
1820
+ };
1821
+
1822
+ // src/index.ts
1823
+ var index_default = moso;
1824
+ export {
1825
+ GLOB_ALL_SRC,
1826
+ GLOB_EXCLUDE,
1827
+ GLOB_HTML,
1828
+ GLOB_JS,
1829
+ GLOB_JSON,
1830
+ GLOB_JSON5,
1831
+ GLOB_JSONC,
1832
+ GLOB_JSX,
1833
+ GLOB_MARKDOWN,
1834
+ GLOB_MARKDOWN_CODE,
1835
+ GLOB_MARKDOWN_IN_MARKDOWN,
1836
+ GLOB_SRC,
1837
+ GLOB_SRC_EXT,
1838
+ GLOB_TESTS,
1839
+ GLOB_TS,
1840
+ GLOB_TSX,
1841
+ GLOB_VUE,
1842
+ GLOB_YAML,
1843
+ StylisticConfigDefaults,
1844
+ combine,
1845
+ comments,
1846
+ index_default as default,
1847
+ disables,
1848
+ getOverrides,
1849
+ ignores,
1850
+ imports,
1851
+ interopDefault,
1852
+ isInEditorEnv,
1853
+ isInGitHooksOrLintStaged,
1854
+ javascript,
1855
+ jsdoc,
1856
+ jsonc,
1857
+ jsx,
1858
+ moso,
1859
+ node,
1860
+ parserPlain,
1861
+ perfectionist,
1862
+ react,
1863
+ resolveSubOptions,
1864
+ sortPackageJson,
1865
+ sortTsconfig,
1866
+ stylistic,
1867
+ test,
1868
+ toArray,
1869
+ typescript,
1870
+ unicorn,
1871
+ vue,
1872
+ yaml
1873
+ };