@cuiqg/eslint-config 2.1.24

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.cjs ADDED
@@ -0,0 +1,1117 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/index.js
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ GLOB_CSS: () => GLOB_CSS,
33
+ GLOB_EXCLUDE: () => GLOB_EXCLUDE,
34
+ GLOB_HTML: () => GLOB_HTML,
35
+ GLOB_JS: () => GLOB_JS,
36
+ GLOB_JSON: () => GLOB_JSON,
37
+ GLOB_JSON5: () => GLOB_JSON5,
38
+ GLOB_JSONC: () => GLOB_JSONC,
39
+ GLOB_JSX: () => GLOB_JSX,
40
+ GLOB_LESS: () => GLOB_LESS,
41
+ GLOB_POSTCSS: () => GLOB_POSTCSS,
42
+ GLOB_SCSS: () => GLOB_SCSS,
43
+ GLOB_SRC: () => GLOB_SRC,
44
+ GLOB_SRC_EXT: () => GLOB_SRC_EXT,
45
+ GLOB_STYLE: () => GLOB_STYLE,
46
+ GLOB_VUE: () => GLOB_VUE,
47
+ GLOB_XML: () => GLOB_XML,
48
+ GLOB_YAML: () => GLOB_YAML,
49
+ autoImport: () => autoImport,
50
+ comments: () => comments,
51
+ cuiqg: () => cuiqg,
52
+ default: () => src_default,
53
+ defaultPluginRenaming: () => defaultPluginRenaming,
54
+ hasUnocss: () => hasUnocss,
55
+ hasVue: () => hasVue,
56
+ ignores: () => ignores,
57
+ imports: () => imports,
58
+ interopDefault: () => interopDefault,
59
+ isInEditor: () => isInEditor,
60
+ javascript: () => javascript,
61
+ jsdoc: () => jsdoc,
62
+ jsonc: () => jsonc,
63
+ node: () => node,
64
+ perfectionist: () => perfectionist,
65
+ prettier: () => prettier,
66
+ sortJsconfig: () => sortJsconfig,
67
+ sortPackageJson: () => sortPackageJson,
68
+ stylistic: () => stylistic,
69
+ unicorn: () => unicorn,
70
+ unocss: () => unocss,
71
+ vue: () => vue,
72
+ yaml: () => yaml
73
+ });
74
+ module.exports = __toCommonJS(src_exports);
75
+
76
+ // src/presets.js
77
+ var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
78
+
79
+ // src/utils.js
80
+ async function interopDefault(m) {
81
+ const resolved = await m;
82
+ return resolved.default || m;
83
+ }
84
+
85
+ // src/configs/comments.js
86
+ async function comments() {
87
+ const pluginComments = await interopDefault(
88
+ import("eslint-plugin-eslint-comments")
89
+ );
90
+ return [
91
+ {
92
+ name: "cuiqg/eslint-comments",
93
+ plugins: {
94
+ "eslint-comments": pluginComments
95
+ },
96
+ rules: {
97
+ ...pluginComments.configs.recommended.rules
98
+ }
99
+ }
100
+ ];
101
+ }
102
+
103
+ // src/globs.js
104
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
105
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
106
+ var GLOB_JS = "**/*.?([cm])js";
107
+ var GLOB_JSX = "**/*.?([cm])jsx";
108
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
109
+ var GLOB_CSS = "**/*.css";
110
+ var GLOB_POSTCSS = "**/*.{p,post}css";
111
+ var GLOB_LESS = "**/*.less";
112
+ var GLOB_SCSS = "**/*.scss";
113
+ var GLOB_JSON = "**/*.json";
114
+ var GLOB_JSON5 = "**/*.json5";
115
+ var GLOB_JSONC = "**/*.jsonc";
116
+ var GLOB_VUE = "**/*.vue";
117
+ var GLOB_YAML = "**/*.y?(a)ml";
118
+ var GLOB_XML = "**/*.xml";
119
+ var GLOB_HTML = "**/*.htm?(l)";
120
+ var GLOB_EXCLUDE = [
121
+ "**/node_modules",
122
+ "**/dist",
123
+ "**/package-lock.json",
124
+ "**/yarn.lock",
125
+ "**/pnpm-lock.yaml",
126
+ "**/bun.lockb",
127
+ "**/output",
128
+ "**/coverage",
129
+ "**/tmp",
130
+ "**/.tmp",
131
+ "**/temp",
132
+ "**/.temp",
133
+ "**/.history",
134
+ "**/.vitepress/cache",
135
+ "**/.nuxt",
136
+ "**/.next",
137
+ "**/.vercel",
138
+ "**/.changeset",
139
+ "**/.idea",
140
+ "**/.cache",
141
+ "**/.output",
142
+ "**/.vite-inspect",
143
+ "**/.yarn",
144
+ "**/vite.config.*.timestamp-*",
145
+ "**/.eslint-config-inspector",
146
+ "**/CHANGELOG*.md",
147
+ "**/*.min.*",
148
+ "**/LICENSE*",
149
+ "**/__snapshots__",
150
+ "**/auto-import?(s).d.ts",
151
+ "**/components.d.ts"
152
+ ];
153
+
154
+ // src/configs/ignores.js
155
+ async function ignores() {
156
+ return [
157
+ {
158
+ name: "cuiqg/ignores",
159
+ ignores: GLOB_EXCLUDE
160
+ }
161
+ ];
162
+ }
163
+
164
+ // src/configs/imports.js
165
+ async function imports() {
166
+ const pluginImport = await interopDefault(import("eslint-plugin-import-x"));
167
+ return [
168
+ {
169
+ name: "cuiqg/imports",
170
+ plugins: {
171
+ import: pluginImport
172
+ },
173
+ rules: {
174
+ "import/first": "error",
175
+ "import/no-duplicates": "error",
176
+ "import/no-mutable-exports": "error",
177
+ "import/no-named-default": "error",
178
+ "import/no-self-import": "error",
179
+ "import/no-webpack-loader-syntax": "error",
180
+ "import/newline-after-import": "error",
181
+ "import/order": "error"
182
+ }
183
+ }
184
+ ];
185
+ }
186
+
187
+ // src/configs/javascript.js
188
+ var import_globals = __toESM(require("globals"), 1);
189
+
190
+ // src/env.js
191
+ var import_node_process = __toESM(require("process"), 1);
192
+ var import_local_pkg = require("local-pkg");
193
+ var isInEditor = !!((import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM) && !import_node_process.default.env.CI);
194
+ var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli");
195
+ var hasUnocss = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
196
+
197
+ // src/configs/javascript.js
198
+ async function javascript() {
199
+ return [
200
+ {
201
+ languageOptions: {
202
+ ecmaVersion: 2022,
203
+ globals: {
204
+ ...import_globals.default.browser,
205
+ ...import_globals.default.es2021,
206
+ ...import_globals.default.node,
207
+ document: "readonly",
208
+ navigator: "readonly",
209
+ window: "readonly"
210
+ },
211
+ parserOptions: {
212
+ ecmaFeatures: {
213
+ jsx: true
214
+ },
215
+ ecmaVersion: 2022,
216
+ sourceType: "module"
217
+ },
218
+ sourceType: "module"
219
+ },
220
+ linterOptions: {
221
+ reportUnusedDisableDirectives: true
222
+ },
223
+ name: "cuiqg/javascript",
224
+ rules: {
225
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
226
+ "array-callback-return": "error",
227
+ "block-scoped-var": "error",
228
+ "constructor-super": "error",
229
+ "default-case-last": "error",
230
+ "dot-notation": ["error", { allowKeywords: true }],
231
+ "eqeqeq": ["error", "smart"],
232
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
233
+ "no-alert": "error",
234
+ "no-array-constructor": "error",
235
+ "no-async-promise-executor": "error",
236
+ "no-caller": "error",
237
+ "no-case-declarations": "error",
238
+ "no-class-assign": "error",
239
+ "no-compare-neg-zero": "error",
240
+ "no-cond-assign": ["error", "always"],
241
+ "no-console": ["error", { allow: ["warn", "error"] }],
242
+ "no-const-assign": "error",
243
+ "no-control-regex": "error",
244
+ "no-debugger": "error",
245
+ "no-delete-var": "error",
246
+ "no-dupe-args": "error",
247
+ "no-dupe-class-members": "error",
248
+ "no-dupe-keys": "error",
249
+ "no-duplicate-case": "error",
250
+ "no-empty": ["error", { allowEmptyCatch: true }],
251
+ "no-empty-character-class": "error",
252
+ "no-empty-pattern": "error",
253
+ "no-eval": "error",
254
+ "no-ex-assign": "error",
255
+ "no-extend-native": "error",
256
+ "no-extra-bind": "error",
257
+ "no-extra-boolean-cast": "error",
258
+ "no-fallthrough": "error",
259
+ "no-func-assign": "error",
260
+ "no-global-assign": "error",
261
+ "no-implied-eval": "error",
262
+ "no-import-assign": "error",
263
+ "no-invalid-regexp": "error",
264
+ "no-irregular-whitespace": "error",
265
+ "no-iterator": "error",
266
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
267
+ "no-lone-blocks": "error",
268
+ "no-loss-of-precision": "error",
269
+ "no-misleading-character-class": "error",
270
+ "no-multi-str": "error",
271
+ "no-new": "error",
272
+ "no-new-func": "error",
273
+ "no-new-native-nonconstructor": "error",
274
+ "no-new-wrappers": "error",
275
+ "no-obj-calls": "error",
276
+ "no-octal": "error",
277
+ "no-octal-escape": "error",
278
+ "no-proto": "error",
279
+ "no-prototype-builtins": "error",
280
+ "no-redeclare": ["error", { builtinGlobals: false }],
281
+ "no-regex-spaces": "error",
282
+ "no-restricted-globals": [
283
+ "error",
284
+ { message: "Use `globalThis` instead.", name: "global" },
285
+ { message: "Use `globalThis` instead.", name: "self" }
286
+ ],
287
+ "no-restricted-properties": [
288
+ "error",
289
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
290
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
291
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
292
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
293
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
294
+ ],
295
+ "no-restricted-syntax": [
296
+ "error",
297
+ "TSEnumDeclaration[const=true]",
298
+ "TSExportAssignment"
299
+ ],
300
+ "no-self-assign": ["error", { props: true }],
301
+ "no-self-compare": "error",
302
+ "no-sequences": "error",
303
+ "no-shadow-restricted-names": "error",
304
+ "no-sparse-arrays": "error",
305
+ "no-template-curly-in-string": "error",
306
+ "no-this-before-super": "error",
307
+ "no-throw-literal": "error",
308
+ "no-undef": "error",
309
+ "no-undef-init": "error",
310
+ "no-unexpected-multiline": "error",
311
+ "no-unmodified-loop-condition": "error",
312
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
313
+ "no-unreachable": "error",
314
+ "no-unreachable-loop": "error",
315
+ "no-unsafe-finally": "error",
316
+ "no-unsafe-negation": "error",
317
+ "no-unused-expressions": ["error", {
318
+ allowShortCircuit: true,
319
+ allowTaggedTemplates: true,
320
+ allowTernary: true
321
+ }],
322
+ "no-unused-vars": ["error", {
323
+ args: "none",
324
+ caughtErrors: "none",
325
+ ignoreRestSiblings: true,
326
+ vars: "all"
327
+ }],
328
+ "no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
329
+ "no-useless-backreference": "error",
330
+ "no-useless-call": "error",
331
+ "no-useless-catch": "error",
332
+ "no-useless-computed-key": "error",
333
+ "no-useless-constructor": "error",
334
+ "no-useless-rename": "error",
335
+ "no-useless-return": "error",
336
+ "no-var": "error",
337
+ "no-with": "error",
338
+ "object-shorthand": [
339
+ "error",
340
+ "always",
341
+ {
342
+ avoidQuotes: true,
343
+ ignoreConstructors: false
344
+ }
345
+ ],
346
+ "one-var": ["error", { initialized: "never" }],
347
+ "prefer-arrow-callback": [
348
+ "error",
349
+ {
350
+ allowNamedFunctions: false,
351
+ allowUnboundThis: true
352
+ }
353
+ ],
354
+ "prefer-const": [
355
+ isInEditor ? "warn" : "error",
356
+ {
357
+ destructuring: "all",
358
+ ignoreReadBeforeAssign: true
359
+ }
360
+ ],
361
+ "prefer-exponentiation-operator": "error",
362
+ "prefer-promise-reject-errors": "error",
363
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
364
+ "prefer-rest-params": "error",
365
+ "prefer-spread": "error",
366
+ "prefer-template": "error",
367
+ "symbol-description": "error",
368
+ "unicode-bom": ["error", "never"],
369
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
370
+ "valid-typeof": ["error", { requireStringLiterals: true }],
371
+ "vars-on-top": "error",
372
+ "yoda": ["error", "never"]
373
+ }
374
+ },
375
+ {
376
+ files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
377
+ name: "cuiqg/javascript/disables",
378
+ rules: {
379
+ "no-console": "off"
380
+ }
381
+ }
382
+ ];
383
+ }
384
+
385
+ // src/configs/jsdoc.js
386
+ async function jsdoc() {
387
+ const pluginJsdoc = await interopDefault(import("eslint-plugin-jsdoc"));
388
+ return [
389
+ {
390
+ name: "cuiqg/jsdoc",
391
+ plugins: {
392
+ jsdoc: pluginJsdoc
393
+ },
394
+ rules: {
395
+ ...pluginJsdoc.configs.recommended.rules
396
+ }
397
+ }
398
+ ];
399
+ }
400
+
401
+ // src/configs/jsonc.js
402
+ async function jsonc() {
403
+ const files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC];
404
+ const [pluginJsonc, parserJsonc] = await Promise.all([
405
+ interopDefault(import("eslint-plugin-jsonc")),
406
+ interopDefault(import("jsonc-eslint-parser"))
407
+ ]);
408
+ return [
409
+ {
410
+ name: "cuiqg/jsonc",
411
+ files,
412
+ plugins: {
413
+ jsonc: pluginJsonc
414
+ },
415
+ languageOptions: {
416
+ parser: parserJsonc
417
+ },
418
+ rules: {
419
+ ...pluginJsonc.configs["recommended-with-jsonc"].rules,
420
+ "jsonc/array-bracket-spacing": ["error", "never"],
421
+ "jsonc/comma-dangle": ["error", "never"],
422
+ "jsonc/comma-style": ["error", "last"],
423
+ "jsonc/indent": ["error", 2],
424
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
425
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
426
+ "jsonc/object-curly-spacing": ["error", "always"],
427
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
428
+ "jsonc/quote-props": "error",
429
+ "jsonc/quotes": "error"
430
+ }
431
+ }
432
+ ];
433
+ }
434
+
435
+ // src/configs/node.js
436
+ async function node() {
437
+ const pluginNode = await interopDefault(import("eslint-plugin-n"));
438
+ return [
439
+ {
440
+ name: "cuiqg/node",
441
+ plugins: {
442
+ node: pluginNode
443
+ },
444
+ rules: {
445
+ "node/handle-callback-err": ["error", "^(err|error)$"],
446
+ "node/no-deprecated-api": "error",
447
+ "node/no-exports-assign": "error",
448
+ "node/no-new-require": "error",
449
+ "node/no-path-concat": "error",
450
+ "node/prefer-global/buffer": ["error", "never"],
451
+ "node/prefer-global/process": ["error", "never"],
452
+ "node/process-exit-as-throw": "error"
453
+ }
454
+ }
455
+ ];
456
+ }
457
+
458
+ // src/configs/perfectionist.js
459
+ async function perfectionist() {
460
+ const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
461
+ return [
462
+ {
463
+ name: "cuiqg/perfectionist",
464
+ plugins: {
465
+ perfectionist: pluginPerfectionist
466
+ },
467
+ rules: {
468
+ "perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
469
+ "perfectionist/sort-imports": ["error", {
470
+ groups: [
471
+ "type",
472
+ ["parent-type", "sibling-type", "index-type", "internal-type"],
473
+ "builtin",
474
+ "external",
475
+ "internal",
476
+ ["parent", "sibling", "index"],
477
+ "side-effect",
478
+ "object",
479
+ "unknown"
480
+ ],
481
+ newlinesBetween: "ignore",
482
+ order: "asc",
483
+ type: "natural"
484
+ }],
485
+ "perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
486
+ "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
487
+ }
488
+ }
489
+ ];
490
+ }
491
+
492
+ // src/configs/prettier.js
493
+ async function prettier() {
494
+ const [pluginJsonc, pluginPrettier, configPrettier] = await Promise.all([
495
+ interopDefault(import("eslint-plugin-jsonc")),
496
+ interopDefault(import("eslint-plugin-prettier")),
497
+ interopDefault(import("eslint-config-prettier"))
498
+ ]);
499
+ return [
500
+ {
501
+ name: "cuiqg/prettier",
502
+ plugins: {
503
+ prettier: pluginPrettier
504
+ },
505
+ rules: {
506
+ ...configPrettier.rules,
507
+ ...pluginPrettier.configs.recommended.rules,
508
+ ...pluginJsonc.configs.prettier.rules,
509
+ "prettier/prettier": "warn"
510
+ }
511
+ }
512
+ ];
513
+ }
514
+
515
+ // src/configs/sorts.js
516
+ async function sortPackageJson() {
517
+ return [
518
+ {
519
+ name: "cuiqg/sort/package-json",
520
+ files: ["**/package.json"],
521
+ rules: {
522
+ "jsonc/sort-array-values": [
523
+ "error",
524
+ {
525
+ order: { type: "asc" },
526
+ pathPattern: "^files$"
527
+ }
528
+ ],
529
+ "jsonc/sort-keys": [
530
+ "error",
531
+ {
532
+ order: [
533
+ "name",
534
+ "version",
535
+ "private",
536
+ "packageManager",
537
+ "description",
538
+ "type",
539
+ "keywords",
540
+ "license",
541
+ "homepage",
542
+ "bugs",
543
+ "repository",
544
+ "author",
545
+ "contributors",
546
+ "funding",
547
+ "files",
548
+ "main",
549
+ "module",
550
+ "types",
551
+ "exports",
552
+ "typesVersions",
553
+ "sideEffects",
554
+ "unpkg",
555
+ "jsdelivr",
556
+ "browser",
557
+ "bin",
558
+ "man",
559
+ "directories",
560
+ "publishConfig",
561
+ "scripts",
562
+ "peerDependencies",
563
+ "peerDependenciesMeta",
564
+ "optionalDependencies",
565
+ "dependencies",
566
+ "devDependencies",
567
+ "engines",
568
+ "config",
569
+ "overrides",
570
+ "pnpm",
571
+ "husky",
572
+ "lint-staged",
573
+ "eslintConfig",
574
+ "prettier"
575
+ ],
576
+ pathPattern: "^$"
577
+ },
578
+ {
579
+ order: { type: "asc" },
580
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
581
+ },
582
+ {
583
+ order: ["types", "require", "import", "default"],
584
+ pathPattern: "^exports.*$"
585
+ },
586
+ {
587
+ order: { type: "asc" },
588
+ pathPattern: "^resolutions$"
589
+ },
590
+ {
591
+ order: { type: "asc" },
592
+ pathPattern: "^pnpm.overrides$"
593
+ }
594
+ ]
595
+ }
596
+ }
597
+ ];
598
+ }
599
+ async function sortJsconfig() {
600
+ return [
601
+ {
602
+ name: "cuiqg/sort/jsconfig-json",
603
+ files: ["**/jsconfig.json", "**/jsconfig.*.json"],
604
+ rules: {
605
+ "jsonc/sort-keys": [
606
+ "error",
607
+ {
608
+ order: [
609
+ "extends",
610
+ "compilerOptions",
611
+ "references",
612
+ "files",
613
+ "include",
614
+ "exclude"
615
+ ],
616
+ pathPattern: "^$"
617
+ },
618
+ {
619
+ order: [
620
+ /* Projects */
621
+ "incremental",
622
+ "composite",
623
+ "tsBuildInfoFile",
624
+ "disableSourceOfProjectReferenceRedirect",
625
+ "disableSolutionSearching",
626
+ "disableReferencedProjectLoad",
627
+ /* Language and Environment */
628
+ "target",
629
+ "jsx",
630
+ "jsxFactory",
631
+ "jsxFragmentFactory",
632
+ "jsxImportSource",
633
+ "lib",
634
+ "moduleDetection",
635
+ "noLib",
636
+ "reactNamespace",
637
+ "useDefineForClassFields",
638
+ "emitDecoratorMetadata",
639
+ "experimentalDecorators",
640
+ /* Modules */
641
+ "baseUrl",
642
+ "rootDir",
643
+ "rootDirs",
644
+ "customConditions",
645
+ "module",
646
+ "moduleResolution",
647
+ "moduleSuffixes",
648
+ "noResolve",
649
+ "paths",
650
+ "resolveJsonModule",
651
+ "resolvePackageJsonExports",
652
+ "resolvePackageJsonImports",
653
+ "typeRoots",
654
+ "types",
655
+ "allowArbitraryExtensions",
656
+ "allowImportingTsExtensions",
657
+ "allowUmdGlobalAccess",
658
+ /* JavaScript Support */
659
+ "allowJs",
660
+ "checkJs",
661
+ "maxNodeModuleJsDepth",
662
+ /* Type Checking */
663
+ "strict",
664
+ "strictBindCallApply",
665
+ "strictFunctionTypes",
666
+ "strictNullChecks",
667
+ "strictPropertyInitialization",
668
+ "allowUnreachableCode",
669
+ "allowUnusedLabels",
670
+ "alwaysStrict",
671
+ "exactOptionalPropertyTypes",
672
+ "noFallthroughCasesInSwitch",
673
+ "noImplicitAny",
674
+ "noImplicitOverride",
675
+ "noImplicitReturns",
676
+ "noImplicitThis",
677
+ "noPropertyAccessFromIndexSignature",
678
+ "noUncheckedIndexedAccess",
679
+ "noUnusedLocals",
680
+ "noUnusedParameters",
681
+ "useUnknownInCatchVariables",
682
+ /* Emit */
683
+ "declaration",
684
+ "declarationDir",
685
+ "declarationMap",
686
+ "downlevelIteration",
687
+ "emitBOM",
688
+ "emitDeclarationOnly",
689
+ "importHelpers",
690
+ "importsNotUsedAsValues",
691
+ "inlineSourceMap",
692
+ "inlineSources",
693
+ "mapRoot",
694
+ "newLine",
695
+ "noEmit",
696
+ "noEmitHelpers",
697
+ "noEmitOnError",
698
+ "outDir",
699
+ "outFile",
700
+ "preserveConstEnums",
701
+ "preserveValueImports",
702
+ "removeComments",
703
+ "sourceMap",
704
+ "sourceRoot",
705
+ "stripInternal",
706
+ /* Interop Constraints */
707
+ "allowSyntheticDefaultImports",
708
+ "esModuleInterop",
709
+ "forceConsistentCasingInFileNames",
710
+ "isolatedModules",
711
+ "preserveSymlinks",
712
+ "verbatimModuleSyntax",
713
+ /* Completeness */
714
+ "skipDefaultLibCheck",
715
+ "skipLibCheck"
716
+ ],
717
+ pathPattern: "^compilerOptions$"
718
+ }
719
+ ]
720
+ }
721
+ }
722
+ ];
723
+ }
724
+
725
+ // src/configs/stylistic.js
726
+ async function stylistic() {
727
+ const pluginStylistic = await interopDefault(
728
+ import("@stylistic/eslint-plugin")
729
+ );
730
+ const config = pluginStylistic.configs.customize({
731
+ flat: true,
732
+ pluginName: "style",
733
+ indent: 2,
734
+ jsx: true,
735
+ quotes: "single",
736
+ semi: false,
737
+ commaDangle: "never"
738
+ });
739
+ return [
740
+ {
741
+ name: "cuiqg/stylistic",
742
+ plugins: {
743
+ style: pluginStylistic
744
+ },
745
+ rules: {
746
+ ...config.rules
747
+ }
748
+ }
749
+ ];
750
+ }
751
+
752
+ // src/configs/unicorn.js
753
+ async function unicorn() {
754
+ const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
755
+ return [
756
+ {
757
+ name: "cuiqg/unicorn",
758
+ plugins: {
759
+ unicorn: pluginUnicorn
760
+ },
761
+ rules: {
762
+ "unicorn/consistent-empty-array-spread": "error",
763
+ "unicorn/error-message": "error",
764
+ "unicorn/escape-case": "error",
765
+ "unicorn/new-for-builtins": "error",
766
+ "unicorn/no-instanceof-array": "error",
767
+ "unicorn/no-new-array": "error",
768
+ "unicorn/no-new-buffer": "error",
769
+ "unicorn/number-literal-case": "error",
770
+ "unicorn/prefer-dom-node-text-content": "error",
771
+ "unicorn/prefer-includes": "error",
772
+ "unicorn/prefer-node-protocol": "error",
773
+ "unicorn/prefer-number-properties": "error",
774
+ "unicorn/prefer-string-starts-ends-with": "error",
775
+ "unicorn/prefer-type-error": "error",
776
+ "unicorn/throw-new-error": "error"
777
+ }
778
+ }
779
+ ];
780
+ }
781
+
782
+ // src/configs/unocss.js
783
+ async function unocss() {
784
+ const pluginUnoCSS = await interopDefault(import("@unocss/eslint-plugin"));
785
+ return [
786
+ {
787
+ name: "cuiqg/unocss",
788
+ plugins: {
789
+ unocss: pluginUnoCSS
790
+ },
791
+ rules: {
792
+ "unocss/order": "error",
793
+ "unocss/order-attributify": "warn"
794
+ }
795
+ }
796
+ ];
797
+ }
798
+
799
+ // src/configs/unplugin.js
800
+ var import_node_fs = __toESM(require("fs"), 1);
801
+ var import_node_path = require("path");
802
+ var import_node_process2 = __toESM(require("process"), 1);
803
+ var import_unconfig = require("unconfig");
804
+ async function autoImport() {
805
+ const resolved = (0, import_node_path.resolve)(import_node_process2.default.cwd(), `./.eslintrc-auto-import.json`);
806
+ if (import_node_fs.default.existsSync(resolved) && import_node_fs.default.statSync(resolved).isFile) {
807
+ const cwd = (0, import_node_path.dirname)(resolved);
808
+ const { config } = await (0, import_unconfig.loadConfig)({
809
+ sources: [
810
+ {
811
+ files: resolved,
812
+ extensions: [],
813
+ rewrite(config2) {
814
+ return config2?.globals;
815
+ }
816
+ }
817
+ ],
818
+ cwd
819
+ });
820
+ return [
821
+ {
822
+ name: "cuiqg/unplugin/auto-import",
823
+ languageOptions: {
824
+ globals: {
825
+ ...config
826
+ }
827
+ }
828
+ }
829
+ ];
830
+ } else {
831
+ return [];
832
+ }
833
+ }
834
+
835
+ // src/configs/vue.js
836
+ async function vue() {
837
+ const files = [GLOB_VUE];
838
+ const [pluginVue, parserVue] = await Promise.all([
839
+ interopDefault(import("eslint-plugin-vue")),
840
+ interopDefault(import("vue-eslint-parser"))
841
+ ]);
842
+ return [
843
+ {
844
+ files,
845
+ languageOptions: {
846
+ globals: {
847
+ computed: "readonly",
848
+ defineModel: "readonly",
849
+ defineOptions: "readonly",
850
+ defineProps: "readonly",
851
+ defineRender: "readonly",
852
+ defineSlots: "readonly",
853
+ defineEmits: "readonly",
854
+ defineExpose: "readonly",
855
+ definePage: "readonly",
856
+ onMounted: "readonly",
857
+ onUnmounted: "readonly",
858
+ onActivated: "readonly",
859
+ onDeactivated: "readonly",
860
+ reactive: "readonly",
861
+ ref: "readonly",
862
+ shallowReactive: "readonly",
863
+ shallowRef: "readonly",
864
+ toRef: "readonly",
865
+ toRefs: "readonly",
866
+ watch: "readonly",
867
+ watchEffect: "readonly"
868
+ },
869
+ parser: parserVue,
870
+ parserOptions: {
871
+ ecmaFeatures: {
872
+ jsx: true
873
+ },
874
+ extraFileExtensions: [".vue"],
875
+ parser: null,
876
+ sourceType: "module"
877
+ }
878
+ },
879
+ name: "cuiqg/vue",
880
+ plugins: {
881
+ vue: pluginVue
882
+ },
883
+ processor: pluginVue.processors[".vue"],
884
+ rules: {
885
+ ...pluginVue.configs.base.rules,
886
+ ...pluginVue.configs["vue3-essential"].rules,
887
+ ...pluginVue.configs["vue3-strongly-recommended"].rules,
888
+ ...pluginVue.configs["vue3-recommended"].rules,
889
+ "vue/block-order": ["error", {
890
+ order: ["script", "template", "style", "route"]
891
+ }],
892
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
893
+ "vue/component-options-name-casing": ["error", "PascalCase"],
894
+ "vue/component-tags-order": "off",
895
+ "vue/custom-event-name-casing": ["error", "camelCase"],
896
+ "vue/define-macros-order": ["error", {
897
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
898
+ }],
899
+ "vue/dot-location": ["error", "property"],
900
+ "vue/dot-notation": ["error", { allowKeywords: true }],
901
+ "vue/eqeqeq": ["error", "smart"],
902
+ "vue/html-indent": ["error", 2],
903
+ "vue/html-quotes": ["error", "double"],
904
+ "vue/max-attributes-per-line": ["error", {
905
+ singleline: {
906
+ max: 1
907
+ },
908
+ multiline: {
909
+ max: 1
910
+ }
911
+ }],
912
+ "vue/multi-word-component-names": "off",
913
+ "vue/no-dupe-keys": "off",
914
+ "vue/no-empty-pattern": "error",
915
+ "vue/no-irregular-whitespace": "error",
916
+ "vue/no-loss-of-precision": "error",
917
+ "vue/no-restricted-syntax": [
918
+ "error",
919
+ "DebuggerStatement",
920
+ "LabeledStatement",
921
+ "WithStatement"
922
+ ],
923
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
924
+ "vue/no-setup-props-reactivity-loss": "off",
925
+ "vue/no-sparse-arrays": "error",
926
+ "vue/no-unused-refs": "error",
927
+ "vue/no-useless-v-bind": "error",
928
+ "vue/no-v-html": "off",
929
+ "vue/object-shorthand": [
930
+ "error",
931
+ "always",
932
+ {
933
+ avoidQuotes: true,
934
+ ignoreConstructors: false
935
+ }
936
+ ],
937
+ "vue/prefer-separate-static-class": "error",
938
+ "vue/prefer-template": "error",
939
+ "vue/prop-name-casing": ["error", "camelCase"],
940
+ "vue/require-default-prop": "off",
941
+ "vue/require-prop-types": "off",
942
+ "vue/space-infix-ops": "error",
943
+ "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
944
+ "vue/array-bracket-spacing": ["error", "never"],
945
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
946
+ "vue/block-spacing": ["error", "always"],
947
+ "vue/block-tag-newline": ["error", {
948
+ multiline: "always",
949
+ singleline: "always"
950
+ }],
951
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
952
+ "vue/comma-dangle": ["error", "always-multiline"],
953
+ "vue/comma-spacing": ["error", { after: true, before: false }],
954
+ "vue/comma-style": ["error", "last"],
955
+ "vue/html-comment-content-spacing": ["error", "always", {
956
+ exceptions: ["-"]
957
+ }],
958
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
959
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
960
+ "vue/object-curly-newline": "off",
961
+ "vue/object-curly-spacing": ["error", "always"],
962
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
963
+ "vue/operator-linebreak": ["error", "before"],
964
+ "vue/padding-line-between-blocks": ["error", "always"],
965
+ "vue/quote-props": ["error", "consistent-as-needed"],
966
+ "vue/space-in-parens": ["error", "never"],
967
+ "vue/template-curly-spacing": "error",
968
+ "vue/no-export-in-script-setup": "off",
969
+ // exportRender / exportExpose / exportProps
970
+ "vue/valid-attribute-name": "off",
971
+ // short-vmodel
972
+ "vue/valid-define-props": "off",
973
+ // hoistStatic
974
+ "vue/valid-v-bind": "off",
975
+ "vue/no-unused-vars": "off"
976
+ }
977
+ }
978
+ ];
979
+ }
980
+
981
+ // src/configs/yaml.js
982
+ async function yaml() {
983
+ const files = [GLOB_YAML];
984
+ const [pluginYaml, parserYaml] = await Promise.all([
985
+ interopDefault(import("eslint-plugin-yml")),
986
+ interopDefault(import("yaml-eslint-parser"))
987
+ ]);
988
+ return [
989
+ {
990
+ name: "cuiqg/yaml",
991
+ files,
992
+ plugins: {
993
+ yaml: pluginYaml
994
+ },
995
+ languageOptions: {
996
+ parser: parserYaml
997
+ },
998
+ rules: {
999
+ ...pluginYaml.configs.standard.rules,
1000
+ ...pluginYaml.configs.prettier.rules,
1001
+ "yaml/block-mapping": "error",
1002
+ "yaml/block-sequence": "error",
1003
+ "yaml/no-empty-key": "error",
1004
+ "yaml/no-empty-sequence-entry": "error",
1005
+ "yaml/no-irregular-whitespace": "error",
1006
+ "yaml/plain-scalar": "error",
1007
+ "yaml/vue-custom-block/no-parsing-error": "error"
1008
+ }
1009
+ }
1010
+ ];
1011
+ }
1012
+
1013
+ // src/presets.js
1014
+ var defaultPluginRenaming = {
1015
+ "@stylistic": "style",
1016
+ "import-x": "import",
1017
+ "n": "node",
1018
+ "yml": "yaml"
1019
+ };
1020
+ function cuiqg(options = {}, ...userConfigs) {
1021
+ const {
1022
+ prettier: enablePrettier = false,
1023
+ unocss: enableUnocss = hasUnocss,
1024
+ vue: enableVue = hasVue,
1025
+ stylistic: enableStylistic = true,
1026
+ jsdoc: enableJsdoc = false
1027
+ } = options;
1028
+ const configs = [];
1029
+ configs.push(
1030
+ autoImport(),
1031
+ ignores(),
1032
+ javascript(),
1033
+ comments(),
1034
+ node(),
1035
+ imports(),
1036
+ unicorn(),
1037
+ perfectionist(),
1038
+ jsonc(),
1039
+ sortPackageJson(),
1040
+ sortJsconfig(),
1041
+ yaml()
1042
+ );
1043
+ if (enableStylistic) {
1044
+ configs.push(
1045
+ stylistic()
1046
+ );
1047
+ }
1048
+ if (enableVue) {
1049
+ configs.push(
1050
+ vue()
1051
+ );
1052
+ }
1053
+ if (enableUnocss) {
1054
+ configs.push(
1055
+ unocss()
1056
+ );
1057
+ }
1058
+ if (enablePrettier) {
1059
+ configs.push(
1060
+ prettier()
1061
+ );
1062
+ }
1063
+ if (enableJsdoc) {
1064
+ configs.push(
1065
+ jsdoc()
1066
+ );
1067
+ }
1068
+ let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
1069
+ composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
1070
+ return composer;
1071
+ }
1072
+
1073
+ // src/index.js
1074
+ var src_default = cuiqg;
1075
+ // Annotate the CommonJS export names for ESM import in node:
1076
+ 0 && (module.exports = {
1077
+ GLOB_CSS,
1078
+ GLOB_EXCLUDE,
1079
+ GLOB_HTML,
1080
+ GLOB_JS,
1081
+ GLOB_JSON,
1082
+ GLOB_JSON5,
1083
+ GLOB_JSONC,
1084
+ GLOB_JSX,
1085
+ GLOB_LESS,
1086
+ GLOB_POSTCSS,
1087
+ GLOB_SCSS,
1088
+ GLOB_SRC,
1089
+ GLOB_SRC_EXT,
1090
+ GLOB_STYLE,
1091
+ GLOB_VUE,
1092
+ GLOB_XML,
1093
+ GLOB_YAML,
1094
+ autoImport,
1095
+ comments,
1096
+ cuiqg,
1097
+ defaultPluginRenaming,
1098
+ hasUnocss,
1099
+ hasVue,
1100
+ ignores,
1101
+ imports,
1102
+ interopDefault,
1103
+ isInEditor,
1104
+ javascript,
1105
+ jsdoc,
1106
+ jsonc,
1107
+ node,
1108
+ perfectionist,
1109
+ prettier,
1110
+ sortJsconfig,
1111
+ sortPackageJson,
1112
+ stylistic,
1113
+ unicorn,
1114
+ unocss,
1115
+ vue,
1116
+ yaml
1117
+ });