@curev/eslint-config 0.3.0 → 0.3.2

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 (107) hide show
  1. package/dist/chunk-TMQW6NVO.js +69 -0
  2. package/dist/dist-LIAOFFCU.js +226696 -0
  3. package/dist/index.cjs +228966 -0
  4. package/dist/index.d.cts +516 -0
  5. package/dist/index.d.ts +516 -0
  6. package/dist/index.js +2155 -0
  7. package/package.json +8 -5
  8. package/.eslintignore +0 -1
  9. package/.github/workflows/release.yml +0 -37
  10. package/.vscode/settings.json +0 -36
  11. package/CHANGELOG.md +0 -740
  12. package/eslint.config.ts +0 -3
  13. package/fixtures/input/css.css +0 -10
  14. package/fixtures/input/html.html +0 -17
  15. package/fixtures/input/javascript.js +0 -69
  16. package/fixtures/input/jsx.jsx +0 -27
  17. package/fixtures/input/markdown.md +0 -34
  18. package/fixtures/input/svelte.svelte +0 -8
  19. package/fixtures/input/toml.toml +0 -23
  20. package/fixtures/input/tsx.tsx +0 -32
  21. package/fixtures/input/typescript.ts +0 -84
  22. package/fixtures/input/vue-ts.vue +0 -35
  23. package/fixtures/input/vue.vue +0 -27
  24. package/fixtures/output/all/javascript.js +0 -72
  25. package/fixtures/output/all/jsx.jsx +0 -26
  26. package/fixtures/output/all/markdown.md +0 -33
  27. package/fixtures/output/all/svelte.svelte +0 -8
  28. package/fixtures/output/all/toml.toml +0 -23
  29. package/fixtures/output/all/tsx.tsx +0 -32
  30. package/fixtures/output/all/typescript.ts +0 -83
  31. package/fixtures/output/all/vue-ts.vue +0 -35
  32. package/fixtures/output/all/vue.vue +0 -24
  33. package/fixtures/output/js/javascript.js +0 -72
  34. package/fixtures/output/js/markdown.md +0 -33
  35. package/fixtures/output/js/toml.toml +0 -23
  36. package/fixtures/output/no-markdown-with-formatters/javascript.js +0 -72
  37. package/fixtures/output/no-markdown-with-formatters/jsx.jsx +0 -24
  38. package/fixtures/output/no-markdown-with-formatters/markdown.md +0 -33
  39. package/fixtures/output/no-markdown-with-formatters/toml.toml +0 -23
  40. package/fixtures/output/no-markdown-with-formatters/tsx.tsx +0 -23
  41. package/fixtures/output/no-markdown-with-formatters/typescript.ts +0 -83
  42. package/fixtures/output/no-style/javascript.js +0 -72
  43. package/fixtures/output/no-style/jsx.jsx +0 -21
  44. package/fixtures/output/no-style/toml.toml +0 -23
  45. package/fixtures/output/no-style/typescript.ts +0 -80
  46. package/fixtures/output/no-style/vue-ts.vue +0 -35
  47. package/fixtures/output/no-style/vue.vue +0 -24
  48. package/fixtures/output/tab-double-quotes/javascript.js +0 -72
  49. package/fixtures/output/tab-double-quotes/jsx.jsx +0 -26
  50. package/fixtures/output/tab-double-quotes/markdown.md +0 -33
  51. package/fixtures/output/tab-double-quotes/toml.toml +0 -23
  52. package/fixtures/output/tab-double-quotes/tsx.tsx +0 -32
  53. package/fixtures/output/tab-double-quotes/typescript.ts +0 -83
  54. package/fixtures/output/tab-double-quotes/vue-ts.vue +0 -35
  55. package/fixtures/output/tab-double-quotes/vue.vue +0 -24
  56. package/fixtures/output/ts-override/javascript.js +0 -72
  57. package/fixtures/output/ts-override/jsx.jsx +0 -26
  58. package/fixtures/output/ts-override/markdown.md +0 -33
  59. package/fixtures/output/ts-override/toml.toml +0 -23
  60. package/fixtures/output/ts-override/tsx.tsx +0 -32
  61. package/fixtures/output/ts-override/typescript.ts +0 -83
  62. package/fixtures/output/ts-override/vue-ts.vue +0 -35
  63. package/fixtures/output/ts-override/vue.vue +0 -24
  64. package/fixtures/output/with-formatters/css.css +0 -11
  65. package/fixtures/output/with-formatters/html.html +0 -28
  66. package/fixtures/output/with-formatters/javascript.js +0 -72
  67. package/fixtures/output/with-formatters/jsx.jsx +0 -26
  68. package/fixtures/output/with-formatters/markdown.md +0 -34
  69. package/fixtures/output/with-formatters/toml.toml +0 -23
  70. package/fixtures/output/with-formatters/tsx.tsx +0 -32
  71. package/fixtures/output/with-formatters/typescript.ts +0 -83
  72. package/fixtures/output/with-formatters/vue-ts.vue +0 -38
  73. package/fixtures/output/with-formatters/vue.vue +0 -24
  74. package/src/configs/comments.ts +0 -19
  75. package/src/configs/formatters.ts +0 -187
  76. package/src/configs/ignores.ts +0 -10
  77. package/src/configs/imports.ts +0 -46
  78. package/src/configs/index.ts +0 -21
  79. package/src/configs/javascript.ts +0 -277
  80. package/src/configs/jsdoc.ts +0 -41
  81. package/src/configs/jsonc.ts +0 -86
  82. package/src/configs/markdown.ts +0 -110
  83. package/src/configs/node.ts +0 -24
  84. package/src/configs/perfectionist.ts +0 -18
  85. package/src/configs/react.ts +0 -111
  86. package/src/configs/sort.ts +0 -223
  87. package/src/configs/stylistic.ts +0 -52
  88. package/src/configs/svelte.ts +0 -107
  89. package/src/configs/test.ts +0 -54
  90. package/src/configs/toml.ts +0 -72
  91. package/src/configs/typescript.ts +0 -171
  92. package/src/configs/unicorn.ts +0 -41
  93. package/src/configs/unocss.ts +0 -43
  94. package/src/configs/vue.ts +0 -170
  95. package/src/configs/yaml.ts +0 -72
  96. package/src/factory.ts +0 -255
  97. package/src/globs.ts +0 -81
  98. package/src/index.ts +0 -9
  99. package/src/plugins.ts +0 -10
  100. package/src/stub.d.ts +0 -3
  101. package/src/types.ts +0 -364
  102. package/src/utils.ts +0 -76
  103. package/src/vender/prettier-types.ts +0 -136
  104. package/test/cli.spec.ts +0 -90
  105. package/test/fixtures.test.ts +0 -127
  106. package/tsconfig.json +0 -17
  107. package/tsup.config.ts +0 -8
package/dist/index.js ADDED
@@ -0,0 +1,2155 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-TMQW6NVO.js";
4
+
5
+ // src/index.ts
6
+ init_esm_shims();
7
+
8
+ // src/factory.ts
9
+ init_esm_shims();
10
+ import process3 from "process";
11
+ import fs from "fs";
12
+ import { isPackageExists as isPackageExists3 } from "local-pkg";
13
+
14
+ // src/configs/index.ts
15
+ init_esm_shims();
16
+
17
+ // src/configs/comments.ts
18
+ init_esm_shims();
19
+
20
+ // src/plugins.ts
21
+ init_esm_shims();
22
+ import { default as default2 } from "@curev/eslint-plugin";
23
+ import { default as default3 } from "eslint-plugin-eslint-comments";
24
+ import * as pluginImport from "eslint-plugin-i";
25
+ import { default as default4 } from "eslint-plugin-n";
26
+ import { default as default5 } from "eslint-plugin-unicorn";
27
+ import { default as default6 } from "eslint-plugin-unused-imports";
28
+ import { default as default7 } from "eslint-plugin-perfectionist";
29
+
30
+ // src/configs/comments.ts
31
+ async function comments() {
32
+ return [
33
+ {
34
+ name: "curev:eslint-comments",
35
+ plugins: {
36
+ "eslint-comments": default3
37
+ },
38
+ rules: {
39
+ "eslint-comments/no-aggregating-enable": "error",
40
+ "eslint-comments/no-duplicate-disable": "error",
41
+ "eslint-comments/no-unlimited-disable": "error",
42
+ "eslint-comments/no-unused-enable": "error"
43
+ }
44
+ }
45
+ ];
46
+ }
47
+
48
+ // src/configs/ignores.ts
49
+ init_esm_shims();
50
+
51
+ // src/globs.ts
52
+ init_esm_shims();
53
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
54
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
55
+ var GLOB_JS = "**/*.?([cm])js";
56
+ var GLOB_JSX = "**/*.?([cm])jsx";
57
+ var GLOB_TS = "**/*.?([cm])ts";
58
+ var GLOB_TSX = "**/*.?([cm])tsx";
59
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
60
+ var GLOB_CSS = "**/*.css";
61
+ var GLOB_POSTCSS = "**/*.{p,post}css";
62
+ var GLOB_LESS = "**/*.less";
63
+ var GLOB_SCSS = "**/*.scss";
64
+ var GLOB_JSON = "**/*.json";
65
+ var GLOB_JSON5 = "**/*.json5";
66
+ var GLOB_JSONC = "**/*.jsonc";
67
+ var GLOB_MARKDOWN = "**/*.md";
68
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
69
+ var GLOB_SVELTE = "**/*.svelte";
70
+ var GLOB_VUE = "**/*.vue";
71
+ var GLOB_YAML = "**/*.y?(a)ml";
72
+ var GLOB_TOML = "**/*.toml";
73
+ var GLOB_HTML = "**/*.htm?(l)";
74
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
75
+ var GLOB_TESTS = [
76
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
77
+ `**/*.spec.${GLOB_SRC_EXT}`,
78
+ `**/*.test.${GLOB_SRC_EXT}`,
79
+ `**/*.bench.${GLOB_SRC_EXT}`,
80
+ `**/*.benchmark.${GLOB_SRC_EXT}`
81
+ ];
82
+ var GLOB_ALL_SRC = [
83
+ GLOB_SRC,
84
+ GLOB_STYLE,
85
+ GLOB_JSON,
86
+ GLOB_JSON5,
87
+ GLOB_MARKDOWN,
88
+ GLOB_SVELTE,
89
+ GLOB_VUE,
90
+ GLOB_YAML,
91
+ GLOB_HTML
92
+ ];
93
+ var GLOB_EXCLUDE = [
94
+ "**/node_modules",
95
+ "**/dist",
96
+ "**/package-lock.json",
97
+ "**/yarn.lock",
98
+ "**/pnpm-lock.yaml",
99
+ "**/bun.lockb",
100
+ "**/output",
101
+ "**/coverage",
102
+ "**/temp",
103
+ "**/.temp",
104
+ "**/tmp",
105
+ "**/.tmp",
106
+ "**/.history",
107
+ "**/.vitepress/cache",
108
+ "**/.nuxt",
109
+ "**/.next",
110
+ "**/.vercel",
111
+ "**/.changeset",
112
+ "**/.idea",
113
+ "**/.cache",
114
+ "**/.output",
115
+ "**/.vite-inspect",
116
+ "**/CHANGELOG*.md",
117
+ "**/*.min.*",
118
+ "**/LICENSE*",
119
+ "**/__snapshots__",
120
+ "**/auto-import?(s).d.ts",
121
+ "**/components.d.ts"
122
+ ];
123
+
124
+ // src/configs/ignores.ts
125
+ async function ignores() {
126
+ return [
127
+ {
128
+ ignores: GLOB_EXCLUDE
129
+ }
130
+ ];
131
+ }
132
+
133
+ // src/configs/imports.ts
134
+ init_esm_shims();
135
+ async function imports(options = {}) {
136
+ const {
137
+ stylistic: stylistic2 = true
138
+ } = options;
139
+ return [
140
+ {
141
+ name: "curev:imports",
142
+ plugins: {
143
+ curev: default2,
144
+ import: pluginImport
145
+ },
146
+ rules: {
147
+ "antfu/import-dedupe": "error",
148
+ "antfu/no-import-dist": "error",
149
+ "antfu/no-import-node-modules-by-path": "error",
150
+ "import/first": "error",
151
+ "import/no-duplicates": "error",
152
+ "import/no-mutable-exports": "error",
153
+ "import/no-named-default": "error",
154
+ "import/no-self-import": "error",
155
+ "import/no-webpack-loader-syntax": "error",
156
+ "import/order": "error",
157
+ ...stylistic2 ? {
158
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }]
159
+ } : {}
160
+ }
161
+ },
162
+ {
163
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
164
+ name: "curev:imports:bin",
165
+ rules: {
166
+ "antfu/no-import-dist": "off",
167
+ "antfu/no-import-node-modules-by-path": "off"
168
+ }
169
+ }
170
+ ];
171
+ }
172
+
173
+ // src/configs/javascript.ts
174
+ init_esm_shims();
175
+ import globals from "globals";
176
+ async function javascript(options = {}) {
177
+ const {
178
+ isInEditor = false,
179
+ overrides = {}
180
+ } = options;
181
+ return [
182
+ {
183
+ languageOptions: {
184
+ ecmaVersion: 2022,
185
+ globals: {
186
+ ...globals.browser,
187
+ ...globals.es2021,
188
+ ...globals.node,
189
+ document: "readonly",
190
+ navigator: "readonly",
191
+ window: "readonly"
192
+ },
193
+ parserOptions: {
194
+ ecmaFeatures: {
195
+ jsx: true
196
+ },
197
+ ecmaVersion: 2022,
198
+ sourceType: "module"
199
+ },
200
+ sourceType: "module"
201
+ },
202
+ linterOptions: {
203
+ reportUnusedDisableDirectives: true
204
+ },
205
+ name: "curev:javascript",
206
+ plugins: {
207
+ "antfu": default2,
208
+ "unused-imports": default6
209
+ },
210
+ rules: {
211
+ "no-var": "warn",
212
+ "object-shorthand": ["warn", "properties"],
213
+ "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
214
+ "array-callback-return": ["error", {
215
+ allowImplicit: false,
216
+ checkForEach: false
217
+ }],
218
+ "camelcase": ["error", {
219
+ allow: ["^UNSAFE_"],
220
+ properties: "never",
221
+ ignoreGlobals: true,
222
+ ignoreImports: true
223
+ }],
224
+ "constructor-super": "error",
225
+ "default-case-last": "error",
226
+ "eol-last": "error",
227
+ "eqeqeq": ["error", "always", { null: "ignore" }],
228
+ "func-call-spacing": ["error", "never"],
229
+ "generator-star-spacing": ["error", { before: true, after: true }],
230
+ "lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
231
+ "multiline-ternary": ["error", "always-multiline"],
232
+ "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
233
+ "new-parens": "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",
241
+ "no-const-assign": "error",
242
+ "no-constant-condition": ["error", { checkLoops: false }],
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-useless-backreference": "error",
251
+ "no-empty": ["error", { allowEmptyCatch: true }],
252
+ "no-empty-character-class": "error",
253
+ "no-empty-pattern": "error",
254
+ "no-eval": "error",
255
+ "no-ex-assign": "error",
256
+ "no-extend-native": "error",
257
+ "no-extra-bind": "error",
258
+ "no-extra-boolean-cast": "error",
259
+ "no-extra-parens": ["error", "functions"],
260
+ "no-fallthrough": "error",
261
+ "no-floating-decimal": "error",
262
+ "no-func-assign": "error",
263
+ "no-global-assign": "error",
264
+ "no-implied-eval": "error",
265
+ "no-import-assign": "error",
266
+ "no-invalid-regexp": "error",
267
+ "no-irregular-whitespace": "error",
268
+ "no-iterator": "error",
269
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
270
+ "no-lone-blocks": "error",
271
+ "no-loss-of-precision": "error",
272
+ "no-misleading-character-class": "error",
273
+ "no-prototype-builtins": "error",
274
+ "no-useless-catch": "error",
275
+ "no-mixed-operators": ["error", {
276
+ groups: [
277
+ ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
278
+ ["&&", "||"],
279
+ ["in", "instanceof"]
280
+ ],
281
+ allowSamePrecedence: true
282
+ }],
283
+ "no-mixed-spaces-and-tabs": "error",
284
+ "no-multi-spaces": "error",
285
+ "no-multi-str": "error",
286
+ "no-new": "error",
287
+ "no-new-func": "error",
288
+ "no-new-object": "error",
289
+ "no-new-symbol": "error",
290
+ "no-new-wrappers": "error",
291
+ "no-obj-calls": "error",
292
+ "no-octal": "error",
293
+ "no-octal-escape": "error",
294
+ "no-proto": "error",
295
+ "no-redeclare": ["error", { builtinGlobals: false }],
296
+ "no-regex-spaces": "error",
297
+ "no-return-assign": ["error", "except-parens"],
298
+ "no-self-assign": ["error", { props: true }],
299
+ "no-self-compare": "error",
300
+ "no-sequences": "error",
301
+ "no-shadow-restricted-names": "error",
302
+ "no-sparse-arrays": "error",
303
+ "no-tabs": "error",
304
+ "no-template-curly-in-string": "error",
305
+ "no-this-before-super": "error",
306
+ "no-throw-literal": "error",
307
+ "no-trailing-spaces": [
308
+ "error",
309
+ {
310
+ skipBlankLines: true
311
+ }
312
+ ],
313
+ "no-multiple-empty-lines": [
314
+ "error",
315
+ {
316
+ max: 3,
317
+ maxBOF: 0,
318
+ maxEOF: 1
319
+ }
320
+ ],
321
+ "no-undef": "error",
322
+ "no-undef-init": "error",
323
+ "no-unexpected-multiline": "error",
324
+ "no-unmodified-loop-condition": "error",
325
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
326
+ "no-unreachable": "error",
327
+ "no-unreachable-loop": "error",
328
+ "no-unsafe-finally": "error",
329
+ "no-unsafe-negation": "error",
330
+ "no-unused-expressions": ["error", {
331
+ allowShortCircuit: true,
332
+ allowTernary: true,
333
+ allowTaggedTemplates: true
334
+ }],
335
+ "no-unused-vars": ["error", {
336
+ args: "none",
337
+ caughtErrors: "none",
338
+ ignoreRestSiblings: true,
339
+ vars: "all"
340
+ }],
341
+ "no-use-before-define": ["error", { functions: false, classes: false, variables: false }],
342
+ "no-useless-call": "error",
343
+ "no-useless-computed-key": "error",
344
+ "no-useless-constructor": "error",
345
+ "no-useless-escape": "error",
346
+ "no-useless-rename": "error",
347
+ "no-useless-return": "error",
348
+ "no-void": "error",
349
+ "no-with": "error",
350
+ "object-curly-newline": ["error", { multiline: true, consistent: true }],
351
+ "object-curly-spacing": ["error", "always"],
352
+ "object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
353
+ "one-var": ["error", { initialized: "never" }],
354
+ "padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
355
+ "prefer-const": ["error", { destructuring: "all" }],
356
+ "prefer-promise-reject-errors": "error",
357
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
358
+ "rest-spread-spacing": ["error", "never"],
359
+ "symbol-description": "error",
360
+ "template-curly-spacing": ["error", "never"],
361
+ "template-tag-spacing": ["error", "never"],
362
+ "unicode-bom": ["error", "never"],
363
+ "use-isnan": ["error", {
364
+ enforceForSwitchCase: true,
365
+ enforceForIndexOf: true
366
+ }],
367
+ "valid-typeof": ["error", { requireStringLiterals: true }],
368
+ "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
369
+ "yield-star-spacing": ["error", "both"],
370
+ "yoda": ["error", "never"],
371
+ "import/export": "error",
372
+ "import/first": "error",
373
+ "import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
374
+ "import/no-duplicates": "error",
375
+ "import/no-named-default": "error",
376
+ "import/no-webpack-loader-syntax": "error",
377
+ "block-scoped-var": "error",
378
+ "no-alert": "error",
379
+ "no-console": ["error", { allow: ["warn", "error"] }],
380
+ "no-restricted-globals": [
381
+ "error",
382
+ { message: "Use `globalThis` instead.", name: "global" },
383
+ { message: "Use `globalThis` instead.", name: "self" }
384
+ ],
385
+ "no-restricted-properties": [
386
+ "error",
387
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
388
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
389
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
390
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
391
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
392
+ ],
393
+ "no-restricted-syntax": [
394
+ "error",
395
+ "DebuggerStatement",
396
+ "LabeledStatement",
397
+ "WithStatement",
398
+ "TSEnumDeclaration[const=true]",
399
+ "TSExportAssignment"
400
+ ],
401
+ "prefer-arrow-callback": [
402
+ "error",
403
+ {
404
+ allowNamedFunctions: false,
405
+ allowUnboundThis: true
406
+ }
407
+ ],
408
+ "prefer-exponentiation-operator": "error",
409
+ "prefer-rest-params": "error",
410
+ "prefer-spread": "error",
411
+ "prefer-template": "error",
412
+ "sort-imports": [
413
+ "error",
414
+ {
415
+ allowSeparatedGroups: false,
416
+ ignoreCase: false,
417
+ ignoreDeclarationSort: true,
418
+ ignoreMemberSort: false,
419
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
420
+ }
421
+ ],
422
+ "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
423
+ "unused-imports/no-unused-vars": [
424
+ "error",
425
+ { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" }
426
+ ],
427
+ "vars-on-top": "error",
428
+ ...overrides
429
+ }
430
+ },
431
+ {
432
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
433
+ name: "curev:scripts-overrides",
434
+ rules: {
435
+ "no-console": "off"
436
+ }
437
+ }
438
+ ];
439
+ }
440
+
441
+ // src/configs/jsdoc.ts
442
+ init_esm_shims();
443
+
444
+ // src/utils.ts
445
+ init_esm_shims();
446
+ import process from "process";
447
+ import { isPackageExists } from "local-pkg";
448
+ var parserPlain = {
449
+ meta: {
450
+ name: "parser-plain"
451
+ },
452
+ parseForESLint: (code) => ({
453
+ ast: {
454
+ body: [],
455
+ comments: [],
456
+ loc: { end: code.length, start: 0 },
457
+ range: [0, code.length],
458
+ tokens: [],
459
+ type: "Program"
460
+ },
461
+ scopeManager: null,
462
+ services: { isPlain: true },
463
+ visitorKeys: {
464
+ Program: []
465
+ }
466
+ })
467
+ };
468
+ async function combine(...configs) {
469
+ const resolved = await Promise.all(configs);
470
+ return resolved.flat();
471
+ }
472
+ function renameRules(rules, from, to) {
473
+ return Object.fromEntries(
474
+ Object.entries(rules).map(([key, value]) => {
475
+ if (key.startsWith(from)) {
476
+ return [to + key.slice(from.length), value];
477
+ }
478
+ return [key, value];
479
+ })
480
+ );
481
+ }
482
+ function toArray(value) {
483
+ return Array.isArray(value) ? value : [value];
484
+ }
485
+ async function interopDefault(m) {
486
+ const resolved = await m;
487
+ return resolved.default || resolved;
488
+ }
489
+ async function ensurePackages(packages) {
490
+ if (process.env.CI || process.stdout.isTTY === false) {
491
+ return;
492
+ }
493
+ const nonExistingPackages = packages.filter((i) => !isPackageExists(i));
494
+ if (nonExistingPackages.length === 0) {
495
+ return;
496
+ }
497
+ const { default: prompts } = await import("prompts");
498
+ const { result } = await prompts([
499
+ {
500
+ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
501
+ name: "result",
502
+ type: "confirm"
503
+ }
504
+ ]);
505
+ if (result) {
506
+ await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
507
+ }
508
+ }
509
+
510
+ // src/configs/jsdoc.ts
511
+ async function jsdoc(options = {}) {
512
+ const {
513
+ stylistic: stylistic2 = true
514
+ } = options;
515
+ return [
516
+ {
517
+ name: "curev:jsdoc",
518
+ plugins: {
519
+ jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
520
+ },
521
+ rules: {
522
+ "jsdoc/check-access": "warn",
523
+ "jsdoc/check-param-names": "warn",
524
+ "jsdoc/check-property-names": "warn",
525
+ "jsdoc/check-types": "warn",
526
+ "jsdoc/empty-tags": "warn",
527
+ "jsdoc/implements-on-classes": "warn",
528
+ "jsdoc/no-defaults": "warn",
529
+ "jsdoc/no-multi-asterisks": "warn",
530
+ "jsdoc/require-param-name": "warn",
531
+ "jsdoc/require-property": "warn",
532
+ "jsdoc/require-property-description": "warn",
533
+ "jsdoc/require-property-name": "warn",
534
+ "jsdoc/require-returns-check": "warn",
535
+ "jsdoc/require-returns-description": "warn",
536
+ "jsdoc/require-yields-check": "warn",
537
+ ...stylistic2 ? {
538
+ "jsdoc/check-alignment": "warn",
539
+ "jsdoc/multiline-blocks": "warn"
540
+ } : {}
541
+ }
542
+ }
543
+ ];
544
+ }
545
+
546
+ // src/configs/jsonc.ts
547
+ init_esm_shims();
548
+ async function jsonc(options = {}) {
549
+ const {
550
+ files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
551
+ overrides = {},
552
+ stylistic: stylistic2 = true
553
+ } = options;
554
+ const {
555
+ indent = 2
556
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
557
+ const [
558
+ pluginJsonc,
559
+ parserJsonc
560
+ ] = await Promise.all([
561
+ interopDefault(import("eslint-plugin-jsonc")),
562
+ interopDefault(import("jsonc-eslint-parser"))
563
+ ]);
564
+ return [
565
+ {
566
+ name: "curev:jsonc:setup",
567
+ plugins: {
568
+ jsonc: pluginJsonc
569
+ }
570
+ },
571
+ {
572
+ files,
573
+ languageOptions: {
574
+ parser: parserJsonc
575
+ },
576
+ name: "curev:jsonc:rules",
577
+ rules: {
578
+ "jsonc/no-bigint-literals": "error",
579
+ "jsonc/no-binary-expression": "error",
580
+ "jsonc/no-binary-numeric-literals": "error",
581
+ "jsonc/no-dupe-keys": "error",
582
+ "jsonc/no-escape-sequence-in-identifier": "error",
583
+ "jsonc/no-floating-decimal": "error",
584
+ "jsonc/no-hexadecimal-numeric-literals": "error",
585
+ "jsonc/no-infinity": "error",
586
+ "jsonc/no-multi-str": "error",
587
+ "jsonc/no-nan": "error",
588
+ "jsonc/no-number-props": "error",
589
+ "jsonc/no-numeric-separators": "error",
590
+ "jsonc/no-octal": "error",
591
+ "jsonc/no-octal-escape": "error",
592
+ "jsonc/no-octal-numeric-literals": "error",
593
+ "jsonc/no-parenthesized": "error",
594
+ "jsonc/no-plus-sign": "error",
595
+ "jsonc/no-regexp-literals": "error",
596
+ "jsonc/no-sparse-arrays": "error",
597
+ "jsonc/no-template-literals": "error",
598
+ "jsonc/no-undefined-value": "error",
599
+ "jsonc/no-unicode-codepoint-escapes": "error",
600
+ "jsonc/no-useless-escape": "error",
601
+ "jsonc/space-unary-ops": "error",
602
+ "jsonc/valid-json-number": "error",
603
+ "jsonc/vue-custom-block/no-parsing-error": "error",
604
+ ...stylistic2 ? {
605
+ "jsonc/array-bracket-spacing": ["error", "never"],
606
+ "jsonc/comma-dangle": ["error", "never"],
607
+ "jsonc/comma-style": ["error", "last"],
608
+ "jsonc/indent": ["error", indent],
609
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
610
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
611
+ "jsonc/object-curly-spacing": ["error", "always"],
612
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
613
+ "jsonc/quote-props": "error",
614
+ "jsonc/quotes": "error"
615
+ } : {},
616
+ ...overrides
617
+ }
618
+ }
619
+ ];
620
+ }
621
+
622
+ // src/configs/markdown.ts
623
+ init_esm_shims();
624
+ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
625
+ async function markdown(options = {}) {
626
+ const {
627
+ componentExts = [],
628
+ files = [GLOB_MARKDOWN],
629
+ overrides = {}
630
+ } = options;
631
+ const markdown2 = await interopDefault(import("eslint-plugin-markdown"));
632
+ return [
633
+ {
634
+ name: "curev:markdown:setup",
635
+ plugins: {
636
+ markdown: markdown2
637
+ }
638
+ },
639
+ {
640
+ files,
641
+ ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
642
+ name: "curev:markdown:processor",
643
+ // `eslint-plugin-markdown` only creates virtual files for code blocks,
644
+ // but not the markdown file itself. We use `eslint-merge-processors` to
645
+ // add a pass-through processor for the markdown file itself.
646
+ processor: mergeProcessors([
647
+ markdown2.processors.markdown,
648
+ processorPassThrough
649
+ ])
650
+ },
651
+ {
652
+ files,
653
+ languageOptions: {
654
+ parser: parserPlain
655
+ },
656
+ name: "curev:markdown:parser"
657
+ },
658
+ {
659
+ files: [
660
+ GLOB_MARKDOWN_CODE,
661
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
662
+ ],
663
+ languageOptions: {
664
+ parserOptions: {
665
+ ecmaFeatures: {
666
+ impliedStrict: true
667
+ }
668
+ }
669
+ },
670
+ name: "curev:markdown:disables",
671
+ rules: {
672
+ "import/newline-after-import": "off",
673
+ "no-alert": "off",
674
+ "no-console": "off",
675
+ "no-labels": "off",
676
+ "no-lone-blocks": "off",
677
+ "no-restricted-syntax": "off",
678
+ "no-undef": "off",
679
+ "no-unused-expressions": "off",
680
+ "no-unused-labels": "off",
681
+ "no-unused-vars": "off",
682
+ "node/prefer-global/process": "off",
683
+ "style/comma-dangle": "off",
684
+ "style/eol-last": "off",
685
+ "ts/consistent-type-imports": "off",
686
+ "ts/no-namespace": "off",
687
+ "ts/no-redeclare": "off",
688
+ "ts/no-require-imports": "off",
689
+ "ts/no-unused-vars": "off",
690
+ "ts/no-use-before-define": "off",
691
+ "ts/no-var-requires": "off",
692
+ "unicode-bom": "off",
693
+ "unused-imports/no-unused-imports": "off",
694
+ "unused-imports/no-unused-vars": "off",
695
+ // Type aware rules
696
+ ...{
697
+ "ts/await-thenable": "off",
698
+ "ts/dot-notation": "off",
699
+ "ts/no-floating-promises": "off",
700
+ "ts/no-for-in-array": "off",
701
+ "ts/no-implied-eval": "off",
702
+ "ts/no-misused-promises": "off",
703
+ "ts/no-throw-literal": "off",
704
+ "ts/no-unnecessary-type-assertion": "off",
705
+ "ts/no-unsafe-argument": "off",
706
+ "ts/no-unsafe-assignment": "off",
707
+ "ts/no-unsafe-call": "off",
708
+ "ts/no-unsafe-member-access": "off",
709
+ "ts/no-unsafe-return": "off",
710
+ "ts/restrict-plus-operands": "off",
711
+ "ts/restrict-template-expressions": "off",
712
+ "ts/unbound-method": "off"
713
+ },
714
+ ...overrides
715
+ }
716
+ }
717
+ ];
718
+ }
719
+
720
+ // src/configs/node.ts
721
+ init_esm_shims();
722
+ async function node() {
723
+ return [
724
+ {
725
+ name: "curev:node",
726
+ plugins: {
727
+ node: default4
728
+ },
729
+ rules: {
730
+ "node/handle-callback-err": ["error", "^(err|error)$"],
731
+ "node/no-deprecated-api": "error",
732
+ "node/no-exports-assign": "error",
733
+ "node/no-new-require": "error",
734
+ "node/no-path-concat": "error",
735
+ "node/prefer-global/buffer": ["error", "never"],
736
+ "node/prefer-global/process": ["error", "never"],
737
+ "node/process-exit-as-throw": "error",
738
+ "node/no-callback-literal": "error"
739
+ }
740
+ }
741
+ ];
742
+ }
743
+
744
+ // src/configs/perfectionist.ts
745
+ init_esm_shims();
746
+ async function perfectionist() {
747
+ return [
748
+ {
749
+ name: "curev:perfectionist",
750
+ plugins: {
751
+ perfectionist: default7
752
+ }
753
+ }
754
+ ];
755
+ }
756
+
757
+ // src/configs/formatters.ts
758
+ init_esm_shims();
759
+
760
+ // src/configs/stylistic.ts
761
+ init_esm_shims();
762
+ var StylisticConfigDefaults = {
763
+ indent: 2,
764
+ jsx: true,
765
+ quotes: "double",
766
+ semi: true,
767
+ braceStyle: "1tbs",
768
+ commaDangle: "never"
769
+ };
770
+ async function stylistic(options = {}) {
771
+ const mergeOptions = {
772
+ ...StylisticConfigDefaults,
773
+ ...options
774
+ };
775
+ const { overrides = {} } = mergeOptions;
776
+ const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
777
+ const config = pluginStylistic.configs.customize({
778
+ flat: true,
779
+ pluginName: "style",
780
+ ...mergeOptions
781
+ });
782
+ return [
783
+ {
784
+ name: "curev:stylistic",
785
+ plugins: {
786
+ curev: default2,
787
+ style: pluginStylistic
788
+ },
789
+ rules: {
790
+ ...config.rules,
791
+ "curev/consistent-list-newline": "error",
792
+ "curev/if-newline": "off",
793
+ "curev/top-level-function": "error",
794
+ "semi-spacing": ["error", { before: false, after: true }],
795
+ "style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
796
+ "curly": ["error", "all"],
797
+ "style/max-statements-per-line": ["off"],
798
+ "curev/max-statements-per-line": ["error", { max: 1 }],
799
+ ...overrides
800
+ }
801
+ }
802
+ ];
803
+ }
804
+
805
+ // src/configs/formatters.ts
806
+ async function formatters(options = {}, stylistic2 = {}) {
807
+ await ensurePackages([
808
+ "eslint-plugin-format"
809
+ ]);
810
+ if (options === true) {
811
+ options = {
812
+ css: true,
813
+ graphql: true,
814
+ html: true,
815
+ markdown: true
816
+ };
817
+ }
818
+ const {
819
+ indent,
820
+ quotes,
821
+ semi
822
+ } = {
823
+ ...StylisticConfigDefaults,
824
+ ...stylistic2
825
+ };
826
+ const prettierOptions = Object.assign(
827
+ {
828
+ endOfLine: "auto",
829
+ semi,
830
+ singleQuote: quotes === "single",
831
+ tabWidth: typeof indent === "number" ? indent : 2,
832
+ trailingComma: "all",
833
+ useTabs: indent === "tab"
834
+ },
835
+ options.prettierOptions || {}
836
+ );
837
+ const dprintOptions = Object.assign(
838
+ {
839
+ indentWidth: typeof indent === "number" ? indent : 2,
840
+ quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
841
+ useTabs: indent === "tab"
842
+ },
843
+ options.dprintOptions || {}
844
+ );
845
+ const pluginFormat = await interopDefault(import("eslint-plugin-format"));
846
+ const configs = [
847
+ {
848
+ name: "curev:formatters:setup",
849
+ plugins: {
850
+ format: pluginFormat
851
+ }
852
+ }
853
+ ];
854
+ if (options.css) {
855
+ configs.push(
856
+ {
857
+ files: [GLOB_CSS, GLOB_POSTCSS],
858
+ languageOptions: {
859
+ parser: parserPlain
860
+ },
861
+ name: "curev:formatter:css",
862
+ rules: {
863
+ "format/prettier": [
864
+ "error",
865
+ {
866
+ ...prettierOptions,
867
+ parser: "css"
868
+ }
869
+ ]
870
+ }
871
+ },
872
+ {
873
+ files: [GLOB_SCSS],
874
+ languageOptions: {
875
+ parser: parserPlain
876
+ },
877
+ name: "curev:formatter:scss",
878
+ rules: {
879
+ "format/prettier": [
880
+ "error",
881
+ {
882
+ ...prettierOptions,
883
+ parser: "scss"
884
+ }
885
+ ]
886
+ }
887
+ },
888
+ {
889
+ files: [GLOB_LESS],
890
+ languageOptions: {
891
+ parser: parserPlain
892
+ },
893
+ name: "curev:formatter:less",
894
+ rules: {
895
+ "format/prettier": [
896
+ "error",
897
+ {
898
+ ...prettierOptions,
899
+ parser: "less"
900
+ }
901
+ ]
902
+ }
903
+ }
904
+ );
905
+ }
906
+ if (options.html) {
907
+ configs.push({
908
+ files: ["**/*.html"],
909
+ languageOptions: {
910
+ parser: parserPlain
911
+ },
912
+ name: "curev:formatter:html",
913
+ rules: {
914
+ "format/prettier": [
915
+ "error",
916
+ {
917
+ ...prettierOptions,
918
+ parser: "html"
919
+ }
920
+ ]
921
+ }
922
+ });
923
+ }
924
+ if (options.markdown) {
925
+ const formater = options.markdown === true ? "prettier" : options.markdown;
926
+ configs.push({
927
+ files: [GLOB_MARKDOWN],
928
+ languageOptions: {
929
+ parser: parserPlain
930
+ },
931
+ name: "curev:formatter:markdown",
932
+ rules: {
933
+ [`format/${formater}`]: [
934
+ "error",
935
+ formater === "prettier" ? {
936
+ printWidth: 120,
937
+ ...prettierOptions,
938
+ embeddedLanguageFormatting: "off",
939
+ parser: "markdown"
940
+ } : {
941
+ ...dprintOptions,
942
+ language: "markdown"
943
+ }
944
+ ]
945
+ }
946
+ });
947
+ }
948
+ if (options.graphql) {
949
+ configs.push({
950
+ files: ["**/*.graphql"],
951
+ languageOptions: {
952
+ parser: parserPlain
953
+ },
954
+ name: "curev:formatter:graphql",
955
+ rules: {
956
+ "format/prettier": [
957
+ "error",
958
+ {
959
+ ...prettierOptions,
960
+ parser: "graphql"
961
+ }
962
+ ]
963
+ }
964
+ });
965
+ }
966
+ return configs;
967
+ }
968
+
969
+ // src/configs/react.ts
970
+ init_esm_shims();
971
+ import { isPackageExists as isPackageExists2 } from "local-pkg";
972
+ var ReactRefreshAllowConstantExportPackages = [
973
+ "vite"
974
+ ];
975
+ async function react(options = {}) {
976
+ const {
977
+ files = [GLOB_JSX, GLOB_TSX],
978
+ overrides = {},
979
+ typescript: typescript2 = true
980
+ } = options;
981
+ await ensurePackages([
982
+ "eslint-plugin-react",
983
+ "eslint-plugin-react-hooks",
984
+ "eslint-plugin-react-refresh"
985
+ ]);
986
+ const [
987
+ pluginReact,
988
+ pluginReactHooks,
989
+ pluginReactRefresh
990
+ ] = await Promise.all([
991
+ interopDefault(import("eslint-plugin-react")),
992
+ interopDefault(import("eslint-plugin-react-hooks")),
993
+ interopDefault(import("eslint-plugin-react-refresh"))
994
+ ]);
995
+ const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
996
+ (i) => isPackageExists2(i)
997
+ );
998
+ return [
999
+ {
1000
+ name: "curev:react:setup",
1001
+ plugins: {
1002
+ "react": pluginReact,
1003
+ "react-hooks": pluginReactHooks,
1004
+ "react-refresh": pluginReactRefresh
1005
+ },
1006
+ settings: {
1007
+ react: {
1008
+ version: "detect"
1009
+ }
1010
+ }
1011
+ },
1012
+ {
1013
+ files,
1014
+ languageOptions: {
1015
+ parserOptions: {
1016
+ ecmaFeatures: {
1017
+ jsx: true
1018
+ }
1019
+ }
1020
+ },
1021
+ name: "curev:react:rules",
1022
+ rules: {
1023
+ // recommended rules react-hooks
1024
+ "react-hooks/exhaustive-deps": "warn",
1025
+ "react-hooks/rules-of-hooks": "error",
1026
+ // react refresh
1027
+ "react-refresh/only-export-components": [
1028
+ "warn",
1029
+ { allowConstantExport: isAllowConstantExport }
1030
+ ],
1031
+ // recommended rules react
1032
+ "react/display-name": "error",
1033
+ "react/jsx-key": "error",
1034
+ "react/jsx-no-comment-textnodes": "error",
1035
+ "react/jsx-no-duplicate-props": "error",
1036
+ "react/jsx-no-target-blank": "error",
1037
+ "react/jsx-no-undef": "error",
1038
+ "react/jsx-uses-react": "error",
1039
+ "react/jsx-uses-vars": "error",
1040
+ "react/no-children-prop": "error",
1041
+ "react/no-danger-with-children": "error",
1042
+ "react/no-deprecated": "error",
1043
+ "react/no-direct-mutation-state": "error",
1044
+ "react/no-find-dom-node": "error",
1045
+ "react/no-is-mounted": "error",
1046
+ "react/no-render-return-value": "error",
1047
+ "react/no-string-refs": "error",
1048
+ "react/no-unescaped-entities": "error",
1049
+ "react/no-unknown-property": "error",
1050
+ "react/no-unsafe": "off",
1051
+ "react/prop-types": "error",
1052
+ "react/react-in-jsx-scope": "off",
1053
+ "react/require-render-return": "error",
1054
+ ...typescript2 ? {
1055
+ "react/jsx-no-undef": "off",
1056
+ "react/prop-type": "off"
1057
+ } : {},
1058
+ // overrides
1059
+ ...overrides
1060
+ }
1061
+ }
1062
+ ];
1063
+ }
1064
+
1065
+ // src/configs/sort.ts
1066
+ init_esm_shims();
1067
+ async function sortPackageJson() {
1068
+ return [
1069
+ {
1070
+ files: ["**/package.json"],
1071
+ name: "curev:sort-package-json",
1072
+ rules: {
1073
+ "jsonc/sort-array-values": [
1074
+ "error",
1075
+ {
1076
+ order: { type: "asc" },
1077
+ pathPattern: "^files$"
1078
+ }
1079
+ ],
1080
+ "jsonc/sort-keys": [
1081
+ "error",
1082
+ {
1083
+ order: [
1084
+ "publisher",
1085
+ "name",
1086
+ "displayName",
1087
+ "type",
1088
+ "version",
1089
+ "private",
1090
+ "packageManager",
1091
+ "description",
1092
+ "author",
1093
+ "license",
1094
+ "funding",
1095
+ "homepage",
1096
+ "repository",
1097
+ "bugs",
1098
+ "keywords",
1099
+ "categories",
1100
+ "sideEffects",
1101
+ "exports",
1102
+ "main",
1103
+ "module",
1104
+ "unpkg",
1105
+ "jsdelivr",
1106
+ "types",
1107
+ "typesVersions",
1108
+ "bin",
1109
+ "icon",
1110
+ "files",
1111
+ "engines",
1112
+ "activationEvents",
1113
+ "contributes",
1114
+ "scripts",
1115
+ "peerDependencies",
1116
+ "peerDependenciesMeta",
1117
+ "dependencies",
1118
+ "optionalDependencies",
1119
+ "devDependencies",
1120
+ "pnpm",
1121
+ "overrides",
1122
+ "resolutions",
1123
+ "husky",
1124
+ "simple-git-hooks",
1125
+ "lint-staged",
1126
+ "eslintConfig"
1127
+ ],
1128
+ pathPattern: "^$"
1129
+ },
1130
+ {
1131
+ order: { type: "asc" },
1132
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1133
+ },
1134
+ {
1135
+ order: { type: "asc" },
1136
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1137
+ },
1138
+ {
1139
+ order: [
1140
+ "types",
1141
+ "import",
1142
+ "require",
1143
+ "default"
1144
+ ],
1145
+ pathPattern: "^exports.*$"
1146
+ }
1147
+ ]
1148
+ }
1149
+ }
1150
+ ];
1151
+ }
1152
+ function sortTsconfig() {
1153
+ return [
1154
+ {
1155
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
1156
+ name: "curev:sort-tsconfig",
1157
+ rules: {
1158
+ "jsonc/sort-keys": [
1159
+ "error",
1160
+ {
1161
+ order: [
1162
+ "extends",
1163
+ "compilerOptions",
1164
+ "references",
1165
+ "files",
1166
+ "include",
1167
+ "exclude"
1168
+ ],
1169
+ pathPattern: "^$"
1170
+ },
1171
+ {
1172
+ order: [
1173
+ /* Projects */
1174
+ "incremental",
1175
+ "composite",
1176
+ "tsBuildInfoFile",
1177
+ "disableSourceOfProjectReferenceRedirect",
1178
+ "disableSolutionSearching",
1179
+ "disableReferencedProjectLoad",
1180
+ /* Language and Environment */
1181
+ "target",
1182
+ "jsx",
1183
+ "jsxFactory",
1184
+ "jsxFragmentFactory",
1185
+ "jsxImportSource",
1186
+ "lib",
1187
+ "moduleDetection",
1188
+ "noLib",
1189
+ "reactNamespace",
1190
+ "useDefineForClassFields",
1191
+ "emitDecoratorMetadata",
1192
+ "experimentalDecorators",
1193
+ /* Modules */
1194
+ "baseUrl",
1195
+ "rootDir",
1196
+ "rootDirs",
1197
+ "customConditions",
1198
+ "module",
1199
+ "moduleResolution",
1200
+ "moduleSuffixes",
1201
+ "noResolve",
1202
+ "paths",
1203
+ "resolveJsonModule",
1204
+ "resolvePackageJsonExports",
1205
+ "resolvePackageJsonImports",
1206
+ "typeRoots",
1207
+ "types",
1208
+ "allowArbitraryExtensions",
1209
+ "allowImportingTsExtensions",
1210
+ "allowUmdGlobalAccess",
1211
+ /* JavaScript Support */
1212
+ "allowJs",
1213
+ "checkJs",
1214
+ "maxNodeModuleJsDepth",
1215
+ /* Type Checking */
1216
+ "strict",
1217
+ "strictBindCallApply",
1218
+ "strictFunctionTypes",
1219
+ "strictNullChecks",
1220
+ "strictPropertyInitialization",
1221
+ "allowUnreachableCode",
1222
+ "allowUnusedLabels",
1223
+ "alwaysStrict",
1224
+ "exactOptionalPropertyTypes",
1225
+ "noFallthroughCasesInSwitch",
1226
+ "noImplicitAny",
1227
+ "noImplicitOverride",
1228
+ "noImplicitReturns",
1229
+ "noImplicitThis",
1230
+ "noPropertyAccessFromIndexSignature",
1231
+ "noUncheckedIndexedAccess",
1232
+ "noUnusedLocals",
1233
+ "noUnusedParameters",
1234
+ "useUnknownInCatchVariables",
1235
+ /* Emit */
1236
+ "declaration",
1237
+ "declarationDir",
1238
+ "declarationMap",
1239
+ "downlevelIteration",
1240
+ "emitBOM",
1241
+ "emitDeclarationOnly",
1242
+ "importHelpers",
1243
+ "importsNotUsedAsValues",
1244
+ "inlineSourceMap",
1245
+ "inlineSources",
1246
+ "mapRoot",
1247
+ "newLine",
1248
+ "noEmit",
1249
+ "noEmitHelpers",
1250
+ "noEmitOnError",
1251
+ "outDir",
1252
+ "outFile",
1253
+ "preserveConstEnums",
1254
+ "preserveValueImports",
1255
+ "removeComments",
1256
+ "sourceMap",
1257
+ "sourceRoot",
1258
+ "stripInternal",
1259
+ /* Interop Constraints */
1260
+ "allowSyntheticDefaultImports",
1261
+ "esModuleInterop",
1262
+ "forceConsistentCasingInFileNames",
1263
+ "isolatedModules",
1264
+ "preserveSymlinks",
1265
+ "verbatimModuleSyntax",
1266
+ /* Completeness */
1267
+ "skipDefaultLibCheck",
1268
+ "skipLibCheck"
1269
+ ],
1270
+ pathPattern: "^compilerOptions$"
1271
+ }
1272
+ ]
1273
+ }
1274
+ }
1275
+ ];
1276
+ }
1277
+
1278
+ // src/configs/svelte.ts
1279
+ init_esm_shims();
1280
+ async function svelte(options = {}) {
1281
+ const {
1282
+ files = [GLOB_SVELTE],
1283
+ overrides = {},
1284
+ stylistic: stylistic2 = true
1285
+ } = options;
1286
+ const {
1287
+ indent = 2,
1288
+ quotes = "single"
1289
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1290
+ await ensurePackages([
1291
+ "eslint-plugin-svelte"
1292
+ ]);
1293
+ const [
1294
+ pluginSvelte,
1295
+ parserSvelte
1296
+ ] = await Promise.all([
1297
+ interopDefault(import("eslint-plugin-svelte")),
1298
+ interopDefault(import("svelte-eslint-parser"))
1299
+ ]);
1300
+ return [
1301
+ {
1302
+ name: "curev:svelte:setup",
1303
+ plugins: {
1304
+ svelte: pluginSvelte
1305
+ }
1306
+ },
1307
+ {
1308
+ files,
1309
+ languageOptions: {
1310
+ parser: parserSvelte,
1311
+ parserOptions: {
1312
+ extraFileExtensions: [".svelte"],
1313
+ parser: options.typescript ? await interopDefault(import("./dist-LIAOFFCU.js")) : null
1314
+ }
1315
+ },
1316
+ name: "curev:svelte:rules",
1317
+ processor: pluginSvelte.processors[".svelte"],
1318
+ rules: {
1319
+ "import/no-mutable-exports": "off",
1320
+ "no-undef": "off",
1321
+ // incompatible with most recent (attribute-form) generic types RFC
1322
+ "no-unused-vars": ["error", {
1323
+ args: "none",
1324
+ caughtErrors: "none",
1325
+ ignoreRestSiblings: true,
1326
+ vars: "all",
1327
+ varsIgnorePattern: "^\\$\\$Props$"
1328
+ }],
1329
+ "svelte/comment-directive": "error",
1330
+ "svelte/no-at-debug-tags": "warn",
1331
+ "svelte/no-at-html-tags": "error",
1332
+ "svelte/no-dupe-else-if-blocks": "error",
1333
+ "svelte/no-dupe-style-properties": "error",
1334
+ "svelte/no-dupe-use-directives": "error",
1335
+ "svelte/no-dynamic-slot-name": "error",
1336
+ "svelte/no-export-load-in-svelte-module-in-kit-pages": "error",
1337
+ "svelte/no-inner-declarations": "error",
1338
+ "svelte/no-not-function-handler": "error",
1339
+ "svelte/no-object-in-text-mustaches": "error",
1340
+ "svelte/no-reactive-functions": "error",
1341
+ "svelte/no-reactive-literals": "error",
1342
+ "svelte/no-shorthand-style-property-overrides": "error",
1343
+ "svelte/no-unknown-style-directive-property": "error",
1344
+ "svelte/no-unused-svelte-ignore": "error",
1345
+ "svelte/no-useless-mustaches": "error",
1346
+ "svelte/require-store-callbacks-use-set-param": "error",
1347
+ "svelte/system": "error",
1348
+ "svelte/valid-compile": "error",
1349
+ "svelte/valid-each-key": "error",
1350
+ "unused-imports/no-unused-vars": [
1351
+ "error",
1352
+ { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^(_|\\$\\$Props$)" }
1353
+ ],
1354
+ ...stylistic2 ? {
1355
+ "style/no-trailing-spaces": "off",
1356
+ // superseded by svelte/no-trailing-spaces
1357
+ "svelte/derived-has-same-inputs-outputs": "error",
1358
+ "svelte/html-closing-bracket-spacing": "error",
1359
+ "svelte/html-quotes": ["error", { prefer: quotes }],
1360
+ "svelte/indent": ["error", { alignAttributesVertically: true, indent }],
1361
+ "svelte/mustache-spacing": "error",
1362
+ "svelte/no-spaces-around-equal-signs-in-attribute": "error",
1363
+ "svelte/no-trailing-spaces": "error",
1364
+ "svelte/spaced-html-comment": "error"
1365
+ } : {},
1366
+ ...overrides
1367
+ }
1368
+ }
1369
+ ];
1370
+ }
1371
+
1372
+ // src/configs/test.ts
1373
+ init_esm_shims();
1374
+ async function test(options = {}) {
1375
+ const {
1376
+ files = GLOB_TESTS,
1377
+ isInEditor = false,
1378
+ overrides = {}
1379
+ } = options;
1380
+ const [
1381
+ pluginVitest,
1382
+ pluginNoOnlyTests
1383
+ ] = await Promise.all([
1384
+ interopDefault(import("eslint-plugin-vitest")),
1385
+ // @ts-expect-error missing types
1386
+ interopDefault(import("eslint-plugin-no-only-tests"))
1387
+ ]);
1388
+ return [
1389
+ {
1390
+ name: "curev:test:setup",
1391
+ plugins: {
1392
+ test: {
1393
+ ...pluginVitest,
1394
+ rules: {
1395
+ ...pluginVitest.rules,
1396
+ // extend `test/no-only-tests` rule
1397
+ ...pluginNoOnlyTests.rules
1398
+ }
1399
+ }
1400
+ }
1401
+ },
1402
+ {
1403
+ files,
1404
+ name: "curev:test:rules",
1405
+ rules: {
1406
+ "node/prefer-global/process": "off",
1407
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1408
+ "test/no-identical-title": "error",
1409
+ "test/no-import-node-test": "error",
1410
+ "test/no-only-tests": isInEditor ? "off" : "error",
1411
+ "test/prefer-hooks-in-order": "error",
1412
+ "test/prefer-lowercase-title": "error",
1413
+ ...overrides
1414
+ }
1415
+ }
1416
+ ];
1417
+ }
1418
+
1419
+ // src/configs/typescript.ts
1420
+ init_esm_shims();
1421
+ import process2 from "process";
1422
+ async function typescript(options = {}) {
1423
+ const {
1424
+ componentExts = [],
1425
+ overrides = {},
1426
+ parserOptions = {}
1427
+ } = options;
1428
+ const files = options.files ?? [
1429
+ GLOB_SRC,
1430
+ ...componentExts.map((ext) => `**/*.${ext}`)
1431
+ ];
1432
+ const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1433
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1434
+ const isTypeAware = !!tsconfigPath;
1435
+ const typeAwareRules = {
1436
+ "dot-notation": "off",
1437
+ "no-implied-eval": "off",
1438
+ "no-throw-literal": "off",
1439
+ "ts/await-thenable": "error",
1440
+ "ts/dot-notation": ["error", { allowKeywords: true }],
1441
+ "ts/no-floating-promises": "error",
1442
+ "ts/no-for-in-array": "error",
1443
+ "ts/no-implied-eval": "error",
1444
+ "ts/no-misused-promises": "error",
1445
+ "ts/no-throw-literal": "error",
1446
+ "ts/no-unnecessary-type-assertion": "error",
1447
+ "ts/no-unsafe-argument": "error",
1448
+ "ts/no-unsafe-assignment": "error",
1449
+ "ts/no-unsafe-call": "error",
1450
+ "ts/no-unsafe-member-access": "error",
1451
+ "ts/no-unsafe-return": "error",
1452
+ "ts/restrict-plus-operands": "error",
1453
+ "ts/restrict-template-expressions": "error",
1454
+ "ts/unbound-method": "error"
1455
+ };
1456
+ const [
1457
+ pluginTs,
1458
+ parserTs
1459
+ ] = await Promise.all([
1460
+ interopDefault(import("@typescript-eslint/eslint-plugin")),
1461
+ interopDefault(import("./dist-LIAOFFCU.js"))
1462
+ ]);
1463
+ function makeParser(typeAware, files2, ignores2) {
1464
+ return {
1465
+ files: files2,
1466
+ ...ignores2 ? { ignores: ignores2 } : {},
1467
+ languageOptions: {
1468
+ parser: parserTs,
1469
+ parserOptions: {
1470
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1471
+ sourceType: "module",
1472
+ ...typeAware ? {
1473
+ project: tsconfigPath,
1474
+ tsconfigRootDir: process2.cwd()
1475
+ } : {},
1476
+ ...parserOptions
1477
+ }
1478
+ },
1479
+ name: `curev:typescript:${typeAware ? "type-aware-parser" : "parser"}`
1480
+ };
1481
+ }
1482
+ return [
1483
+ {
1484
+ // Install the plugins without globs, so they can be configured separately.
1485
+ name: "curev:typescript:setup",
1486
+ plugins: {
1487
+ curev: default2,
1488
+ ts: pluginTs
1489
+ }
1490
+ },
1491
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
1492
+ ...isTypeAware ? [
1493
+ makeParser(true, filesTypeAware),
1494
+ makeParser(false, files, filesTypeAware)
1495
+ ] : [makeParser(false, files)],
1496
+ {
1497
+ files,
1498
+ name: "curev:typescript:rules",
1499
+ rules: {
1500
+ ...renameRules(
1501
+ pluginTs.configs["eslint-recommended"].overrides[0].rules,
1502
+ "@typescript-eslint/",
1503
+ "ts/"
1504
+ ),
1505
+ ...renameRules(
1506
+ pluginTs.configs.strict.rules,
1507
+ "@typescript-eslint/",
1508
+ "ts/"
1509
+ ),
1510
+ "no-dupe-class-members": "off",
1511
+ "no-loss-of-precision": "off",
1512
+ "no-redeclare": "off",
1513
+ "no-use-before-define": "off",
1514
+ "no-useless-constructor": "off",
1515
+ "ts/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
1516
+ "ts/ban-types": ["error", { types: { Function: false } }],
1517
+ "ts/consistent-type-definitions": ["error", "interface"],
1518
+ "ts/consistent-type-imports": ["error", { disallowTypeAnnotations: false, prefer: "type-imports" }],
1519
+ "ts/no-dupe-class-members": "error",
1520
+ "ts/no-dynamic-delete": "off",
1521
+ "ts/no-explicit-any": "off",
1522
+ "ts/no-extraneous-class": "off",
1523
+ "ts/no-import-type-side-effects": "error",
1524
+ "ts/no-invalid-void-type": "off",
1525
+ "ts/no-loss-of-precision": "error",
1526
+ "ts/no-non-null-assertion": "off",
1527
+ "ts/no-redeclare": "error",
1528
+ "ts/no-require-imports": "error",
1529
+ "ts/no-unused-vars": "off",
1530
+ "ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
1531
+ "ts/no-useless-constructor": "off",
1532
+ "ts/prefer-ts-expect-error": "error",
1533
+ "ts/triple-slash-reference": "off",
1534
+ "ts/unified-signatures": "off",
1535
+ ...overrides
1536
+ }
1537
+ },
1538
+ {
1539
+ files: filesTypeAware,
1540
+ name: "curev:typescript:rules-type-aware",
1541
+ rules: {
1542
+ ...tsconfigPath ? typeAwareRules : {},
1543
+ ...overrides
1544
+ }
1545
+ },
1546
+ {
1547
+ files: ["**/*.d.ts"],
1548
+ name: "curev:typescript:dts-overrides",
1549
+ rules: {
1550
+ "eslint-comments/no-unlimited-disable": "off",
1551
+ "import/no-duplicates": "off",
1552
+ "no-restricted-syntax": "off",
1553
+ "unused-imports/no-unused-vars": "off"
1554
+ }
1555
+ },
1556
+ {
1557
+ files: ["**/*.{test,spec}.ts?(x)"],
1558
+ name: "curev:typescript:tests-overrides",
1559
+ rules: {
1560
+ "no-unused-expressions": "off"
1561
+ }
1562
+ },
1563
+ {
1564
+ files: ["**/*.js", "**/*.cjs"],
1565
+ name: "curev:typescript:javascript-overrides",
1566
+ rules: {
1567
+ "ts/no-require-imports": "off",
1568
+ "ts/no-var-requires": "off"
1569
+ }
1570
+ }
1571
+ ];
1572
+ }
1573
+
1574
+ // src/configs/unicorn.ts
1575
+ init_esm_shims();
1576
+ async function unicorn() {
1577
+ return [
1578
+ {
1579
+ name: "curev:unicorn",
1580
+ plugins: {
1581
+ unicorn: default5
1582
+ },
1583
+ rules: {
1584
+ // Pass error message when throwing errors
1585
+ "unicorn/error-message": "error",
1586
+ // Uppercase regex escapes
1587
+ "unicorn/escape-case": "error",
1588
+ // Array.isArray instead of instanceof
1589
+ "unicorn/no-instanceof-array": "error",
1590
+ // Ban `new Array` as `Array` constructor's params are ambiguous
1591
+ "unicorn/no-new-array": "error",
1592
+ // Prevent deprecated `new Buffer()`
1593
+ "unicorn/no-new-buffer": "error",
1594
+ // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
1595
+ "unicorn/number-literal-case": "error",
1596
+ // textContent instead of innerText
1597
+ "unicorn/prefer-dom-node-text-content": "error",
1598
+ // includes over indexOf when checking for existence
1599
+ "unicorn/prefer-includes": "error",
1600
+ // Prefer using the node: protocol
1601
+ "unicorn/prefer-node-protocol": "error",
1602
+ // Prefer using number properties like `Number.isNaN` rather than `isNaN`
1603
+ "unicorn/prefer-number-properties": "error",
1604
+ // String methods startsWith/endsWith instead of more complicated stuff
1605
+ "unicorn/prefer-string-starts-ends-with": "error",
1606
+ // Enforce throwing type error when throwing error while checking typeof
1607
+ "unicorn/prefer-type-error": "error",
1608
+ // Use new when throwing error
1609
+ "unicorn/throw-new-error": "error"
1610
+ }
1611
+ }
1612
+ ];
1613
+ }
1614
+
1615
+ // src/configs/unocss.ts
1616
+ init_esm_shims();
1617
+ async function unocss(options = {}) {
1618
+ const {
1619
+ attributify = true,
1620
+ strict = false
1621
+ } = options;
1622
+ await ensurePackages([
1623
+ "@unocss/eslint-plugin"
1624
+ ]);
1625
+ const [
1626
+ pluginUnoCSS
1627
+ ] = await Promise.all([
1628
+ interopDefault(import("@unocss/eslint-plugin"))
1629
+ ]);
1630
+ return [
1631
+ {
1632
+ name: "curev:unocss",
1633
+ plugins: {
1634
+ unocss: pluginUnoCSS
1635
+ },
1636
+ rules: {
1637
+ "unocss/order": "warn",
1638
+ ...attributify ? {
1639
+ "unocss/order-attributify": "warn"
1640
+ } : {},
1641
+ ...strict ? {
1642
+ "unocss/blocklist": "error"
1643
+ } : {}
1644
+ }
1645
+ }
1646
+ ];
1647
+ }
1648
+
1649
+ // src/configs/vue.ts
1650
+ init_esm_shims();
1651
+ import { mergeProcessors as mergeProcessors2 } from "eslint-merge-processors";
1652
+ async function vue(options = {}) {
1653
+ const {
1654
+ files = [GLOB_VUE],
1655
+ overrides = {},
1656
+ stylistic: stylistic2 = true,
1657
+ vueVersion = 3
1658
+ } = options;
1659
+ const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
1660
+ const {
1661
+ indent = 2
1662
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1663
+ const [
1664
+ pluginVue,
1665
+ parserVue,
1666
+ processorVueBlocks
1667
+ ] = await Promise.all([
1668
+ // @ts-expect-error missing types
1669
+ interopDefault(import("eslint-plugin-vue")),
1670
+ interopDefault(import("vue-eslint-parser")),
1671
+ interopDefault(import("eslint-processor-vue-blocks"))
1672
+ ]);
1673
+ return [
1674
+ {
1675
+ name: "curev:vue:setup",
1676
+ plugins: {
1677
+ vue: pluginVue
1678
+ }
1679
+ },
1680
+ {
1681
+ files,
1682
+ languageOptions: {
1683
+ parser: parserVue,
1684
+ parserOptions: {
1685
+ ecmaFeatures: {
1686
+ jsx: true
1687
+ },
1688
+ extraFileExtensions: [".vue"],
1689
+ parser: options.typescript ? await interopDefault(import("./dist-LIAOFFCU.js")) : null,
1690
+ sourceType: "module"
1691
+ }
1692
+ },
1693
+ name: "curev:vue:rules",
1694
+ processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors2([
1695
+ pluginVue.processors[".vue"],
1696
+ processorVueBlocks({
1697
+ ...sfcBlocks,
1698
+ blocks: {
1699
+ styles: true,
1700
+ ...sfcBlocks.blocks
1701
+ }
1702
+ })
1703
+ ]),
1704
+ rules: {
1705
+ ...pluginVue.configs.base.rules,
1706
+ ...vueVersion === 2 ? {
1707
+ ...pluginVue.configs.essential.rules,
1708
+ ...pluginVue.configs["strongly-recommended"].rules,
1709
+ ...pluginVue.configs.recommended.rules
1710
+ } : {
1711
+ ...pluginVue.configs["vue3-essential"].rules,
1712
+ ...pluginVue.configs["vue3-strongly-recommended"].rules,
1713
+ ...pluginVue.configs["vue3-recommended"].rules
1714
+ },
1715
+ "node/prefer-global/process": "off",
1716
+ "vue/block-order": ["error", {
1717
+ order: ["script", "template", "style"]
1718
+ }],
1719
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
1720
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1721
+ // this is deprecated
1722
+ "vue/component-tags-order": "off",
1723
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1724
+ "vue/define-macros-order": ["error", {
1725
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1726
+ }],
1727
+ "vue/dot-location": ["error", "property"],
1728
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1729
+ "vue/eqeqeq": ["error", "smart"],
1730
+ "vue/html-indent": ["error", indent],
1731
+ "vue/html-quotes": ["error", "double"],
1732
+ "vue/max-attributes-per-line": "off",
1733
+ "vue/multi-word-component-names": "off",
1734
+ "vue/no-dupe-keys": "off",
1735
+ "vue/no-empty-pattern": "error",
1736
+ "vue/no-irregular-whitespace": "error",
1737
+ "vue/no-loss-of-precision": "error",
1738
+ "vue/no-restricted-syntax": [
1739
+ "error",
1740
+ "DebuggerStatement",
1741
+ "LabeledStatement",
1742
+ "WithStatement"
1743
+ ],
1744
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1745
+ "vue/no-setup-props-reactivity-loss": "off",
1746
+ "vue/no-sparse-arrays": "error",
1747
+ "vue/no-unused-refs": "error",
1748
+ "vue/no-useless-v-bind": "error",
1749
+ "vue/no-v-html": "off",
1750
+ "vue/object-shorthand": [
1751
+ "error",
1752
+ "always",
1753
+ {
1754
+ avoidQuotes: true,
1755
+ ignoreConstructors: false
1756
+ }
1757
+ ],
1758
+ "vue/prefer-separate-static-class": "error",
1759
+ "vue/prefer-template": "error",
1760
+ "vue/prop-name-casing": ["error", "camelCase"],
1761
+ "vue/require-default-prop": "off",
1762
+ "vue/require-prop-types": "off",
1763
+ "vue/space-infix-ops": "error",
1764
+ "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1765
+ ...stylistic2 ? {
1766
+ "vue/array-bracket-spacing": ["error", "never"],
1767
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
1768
+ "vue/block-spacing": ["error", "always"],
1769
+ "vue/block-tag-newline": ["error", {
1770
+ multiline: "always",
1771
+ singleline: "always"
1772
+ }],
1773
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1774
+ "vue/comma-dangle": ["error", "always-multiline"],
1775
+ "vue/comma-spacing": ["error", { after: true, before: false }],
1776
+ "vue/comma-style": ["error", "last"],
1777
+ "vue/html-comment-content-spacing": ["error", "always", {
1778
+ exceptions: ["-"]
1779
+ }],
1780
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1781
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
1782
+ "vue/object-curly-newline": "off",
1783
+ "vue/object-curly-spacing": ["error", "always"],
1784
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1785
+ "vue/operator-linebreak": ["error", "before"],
1786
+ "vue/padding-line-between-blocks": ["error", "always"],
1787
+ "vue/quote-props": ["error", "consistent-as-needed"],
1788
+ "vue/space-in-parens": ["error", "never"],
1789
+ "vue/template-curly-spacing": "error"
1790
+ } : {},
1791
+ ...overrides
1792
+ }
1793
+ }
1794
+ ];
1795
+ }
1796
+
1797
+ // src/configs/yaml.ts
1798
+ init_esm_shims();
1799
+ async function yaml(options = {}) {
1800
+ const {
1801
+ files = [GLOB_YAML],
1802
+ overrides = {},
1803
+ stylistic: stylistic2 = true
1804
+ } = options;
1805
+ const {
1806
+ indent = 2,
1807
+ quotes = "single"
1808
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1809
+ const [
1810
+ pluginYaml,
1811
+ parserYaml
1812
+ ] = await Promise.all([
1813
+ interopDefault(import("eslint-plugin-yml")),
1814
+ interopDefault(import("yaml-eslint-parser"))
1815
+ ]);
1816
+ return [
1817
+ {
1818
+ name: "curev:yaml:setup",
1819
+ plugins: {
1820
+ yaml: pluginYaml
1821
+ }
1822
+ },
1823
+ {
1824
+ files,
1825
+ languageOptions: {
1826
+ parser: parserYaml
1827
+ },
1828
+ name: "curev:yaml:rules",
1829
+ rules: {
1830
+ "style/spaced-comment": "off",
1831
+ "yaml/block-mapping": "error",
1832
+ "yaml/block-sequence": "error",
1833
+ "yaml/no-empty-key": "error",
1834
+ "yaml/no-empty-sequence-entry": "error",
1835
+ "yaml/no-irregular-whitespace": "error",
1836
+ "yaml/plain-scalar": "error",
1837
+ "yaml/vue-custom-block/no-parsing-error": "error",
1838
+ ...stylistic2 ? {
1839
+ "yaml/block-mapping-question-indicator-newline": "error",
1840
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
1841
+ "yaml/flow-mapping-curly-newline": "error",
1842
+ "yaml/flow-mapping-curly-spacing": "error",
1843
+ "yaml/flow-sequence-bracket-newline": "error",
1844
+ "yaml/flow-sequence-bracket-spacing": "error",
1845
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
1846
+ "yaml/key-spacing": "error",
1847
+ "yaml/no-tab-indent": "error",
1848
+ "yaml/quotes": ["error", { avoidEscape: false, prefer: quotes }],
1849
+ "yaml/spaced-comment": "error"
1850
+ } : {},
1851
+ ...overrides
1852
+ }
1853
+ }
1854
+ ];
1855
+ }
1856
+
1857
+ // src/configs/toml.ts
1858
+ init_esm_shims();
1859
+ async function toml(options = {}) {
1860
+ const {
1861
+ files = [GLOB_TOML],
1862
+ overrides = {},
1863
+ stylistic: stylistic2 = true
1864
+ } = options;
1865
+ const {
1866
+ indent = 2
1867
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1868
+ const [
1869
+ pluginToml,
1870
+ parserToml
1871
+ ] = await Promise.all([
1872
+ interopDefault(import("eslint-plugin-toml")),
1873
+ interopDefault(import("toml-eslint-parser"))
1874
+ ]);
1875
+ return [
1876
+ {
1877
+ name: "curev:toml:setup",
1878
+ plugins: {
1879
+ toml: pluginToml
1880
+ }
1881
+ },
1882
+ {
1883
+ files,
1884
+ languageOptions: {
1885
+ parser: parserToml
1886
+ },
1887
+ name: "curev:toml:rules",
1888
+ rules: {
1889
+ "style/spaced-comment": "off",
1890
+ "toml/comma-style": "error",
1891
+ "toml/keys-order": "error",
1892
+ "toml/no-space-dots": "error",
1893
+ "toml/no-unreadable-number-separator": "error",
1894
+ "toml/precision-of-fractional-seconds": "error",
1895
+ "toml/precision-of-integer": "error",
1896
+ "toml/tables-order": "error",
1897
+ "toml/vue-custom-block/no-parsing-error": "error",
1898
+ ...stylistic2 ? {
1899
+ "toml/array-bracket-newline": "error",
1900
+ "toml/array-bracket-spacing": "error",
1901
+ "toml/array-element-newline": "error",
1902
+ "toml/indent": ["error", indent === "tab" ? 2 : indent],
1903
+ "toml/inline-table-curly-spacing": "error",
1904
+ "toml/key-spacing": "error",
1905
+ "toml/padding-line-between-pairs": "error",
1906
+ "toml/padding-line-between-tables": "error",
1907
+ "toml/quoted-keys": "error",
1908
+ "toml/spaced-comment": "error",
1909
+ "toml/table-bracket-spacing": "error"
1910
+ } : {},
1911
+ ...overrides
1912
+ }
1913
+ }
1914
+ ];
1915
+ }
1916
+
1917
+ // src/factory.ts
1918
+ var flatConfigProps = [
1919
+ "name",
1920
+ "files",
1921
+ "ignores",
1922
+ "languageOptions",
1923
+ "linterOptions",
1924
+ "processor",
1925
+ "plugins",
1926
+ "rules",
1927
+ "settings"
1928
+ ];
1929
+ var VuePackages = [
1930
+ "vue",
1931
+ "nuxt",
1932
+ "vitepress",
1933
+ "@slidev/cli"
1934
+ ];
1935
+ async function curev(options = {}, ...userConfigs) {
1936
+ const {
1937
+ componentExts = [],
1938
+ gitignore: enableGitignore = true,
1939
+ isInEditor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
1940
+ react: enableReact = false,
1941
+ svelte: enableSvelte = false,
1942
+ typescript: enableTypeScript = isPackageExists3("typescript"),
1943
+ unocss: enableUnoCSS = false,
1944
+ vue: enableVue = VuePackages.some((i) => isPackageExists3(i))
1945
+ } = options;
1946
+ const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
1947
+ if (stylisticOptions && !("jsx" in stylisticOptions)) {
1948
+ stylisticOptions.jsx = options.jsx ?? true;
1949
+ }
1950
+ const configs = [];
1951
+ if (enableGitignore) {
1952
+ if (typeof enableGitignore !== "boolean") {
1953
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
1954
+ } else {
1955
+ if (fs.existsSync(".gitignore")) {
1956
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
1957
+ }
1958
+ }
1959
+ }
1960
+ configs.push(
1961
+ ignores(),
1962
+ javascript({
1963
+ isInEditor,
1964
+ overrides: getOverrides(options, "javascript")
1965
+ }),
1966
+ comments(),
1967
+ node(),
1968
+ jsdoc({
1969
+ stylistic: stylisticOptions
1970
+ }),
1971
+ imports({
1972
+ stylistic: stylisticOptions
1973
+ }),
1974
+ unicorn(),
1975
+ // Optional plugins (installed but not enabled by default)
1976
+ perfectionist()
1977
+ );
1978
+ if (enableVue) {
1979
+ componentExts.push("vue");
1980
+ }
1981
+ if (enableTypeScript) {
1982
+ configs.push(typescript({
1983
+ ...resolveSubOptions(options, "typescript"),
1984
+ componentExts,
1985
+ overrides: getOverrides(options, "typescript")
1986
+ }));
1987
+ }
1988
+ if (stylisticOptions) {
1989
+ configs.push(stylistic({
1990
+ ...stylisticOptions,
1991
+ overrides: getOverrides(options, "stylistic")
1992
+ }));
1993
+ }
1994
+ if (options.test ?? true) {
1995
+ configs.push(test({
1996
+ isInEditor,
1997
+ overrides: getOverrides(options, "test")
1998
+ }));
1999
+ }
2000
+ if (enableVue) {
2001
+ configs.push(vue({
2002
+ ...resolveSubOptions(options, "vue"),
2003
+ overrides: getOverrides(options, "vue"),
2004
+ stylistic: stylisticOptions,
2005
+ typescript: !!enableTypeScript
2006
+ }));
2007
+ }
2008
+ if (enableReact) {
2009
+ configs.push(react({
2010
+ overrides: getOverrides(options, "react"),
2011
+ typescript: !!enableTypeScript
2012
+ }));
2013
+ }
2014
+ if (enableSvelte) {
2015
+ configs.push(svelte({
2016
+ overrides: getOverrides(options, "svelte"),
2017
+ stylistic: stylisticOptions,
2018
+ typescript: !!enableTypeScript
2019
+ }));
2020
+ }
2021
+ if (enableUnoCSS) {
2022
+ configs.push(unocss({
2023
+ ...resolveSubOptions(options, "unocss"),
2024
+ overrides: getOverrides(options, "unocss")
2025
+ }));
2026
+ }
2027
+ if (options.jsonc ?? true) {
2028
+ configs.push(
2029
+ jsonc({
2030
+ overrides: getOverrides(options, "jsonc"),
2031
+ stylistic: stylisticOptions
2032
+ }),
2033
+ sortPackageJson(),
2034
+ sortTsconfig()
2035
+ );
2036
+ }
2037
+ if (options.yaml ?? true) {
2038
+ configs.push(yaml({
2039
+ overrides: getOverrides(options, "yaml"),
2040
+ stylistic: stylisticOptions
2041
+ }));
2042
+ }
2043
+ if (options.toml ?? true) {
2044
+ configs.push(toml({
2045
+ overrides: getOverrides(options, "toml"),
2046
+ stylistic: stylisticOptions
2047
+ }));
2048
+ }
2049
+ if (options.markdown ?? true) {
2050
+ configs.push(
2051
+ markdown(
2052
+ {
2053
+ componentExts,
2054
+ overrides: getOverrides(options, "markdown")
2055
+ }
2056
+ )
2057
+ );
2058
+ }
2059
+ if (options.formatters) {
2060
+ configs.push(formatters(
2061
+ options.formatters,
2062
+ typeof stylisticOptions === "boolean" ? {} : stylisticOptions
2063
+ ));
2064
+ }
2065
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
2066
+ if (key in options) {
2067
+ acc[key] = options[key];
2068
+ }
2069
+ return acc;
2070
+ }, {});
2071
+ if (Object.keys(fusedConfig).length) {
2072
+ configs.push([fusedConfig]);
2073
+ }
2074
+ const merged = combine(
2075
+ ...configs,
2076
+ ...userConfigs
2077
+ );
2078
+ return merged;
2079
+ }
2080
+ function resolveSubOptions(options, key) {
2081
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
2082
+ }
2083
+ function getOverrides(options, key) {
2084
+ const sub = resolveSubOptions(options, key);
2085
+ return {
2086
+ ...options.overrides?.[key],
2087
+ ..."overrides" in sub ? sub.overrides : {}
2088
+ };
2089
+ }
2090
+
2091
+ // src/types.ts
2092
+ init_esm_shims();
2093
+
2094
+ // src/index.ts
2095
+ var src_default = curev;
2096
+ export {
2097
+ GLOB_ALL_SRC,
2098
+ GLOB_CSS,
2099
+ GLOB_EXCLUDE,
2100
+ GLOB_HTML,
2101
+ GLOB_JS,
2102
+ GLOB_JSON,
2103
+ GLOB_JSON5,
2104
+ GLOB_JSONC,
2105
+ GLOB_JSX,
2106
+ GLOB_LESS,
2107
+ GLOB_MARKDOWN,
2108
+ GLOB_MARKDOWN_CODE,
2109
+ GLOB_MARKDOWN_IN_MARKDOWN,
2110
+ GLOB_POSTCSS,
2111
+ GLOB_SCSS,
2112
+ GLOB_SRC,
2113
+ GLOB_SRC_EXT,
2114
+ GLOB_STYLE,
2115
+ GLOB_SVELTE,
2116
+ GLOB_TESTS,
2117
+ GLOB_TOML,
2118
+ GLOB_TS,
2119
+ GLOB_TSX,
2120
+ GLOB_VUE,
2121
+ GLOB_YAML,
2122
+ StylisticConfigDefaults,
2123
+ combine,
2124
+ comments,
2125
+ curev,
2126
+ src_default as default,
2127
+ ensurePackages,
2128
+ formatters,
2129
+ getOverrides,
2130
+ ignores,
2131
+ imports,
2132
+ interopDefault,
2133
+ javascript,
2134
+ jsdoc,
2135
+ jsonc,
2136
+ markdown,
2137
+ node,
2138
+ parserPlain,
2139
+ perfectionist,
2140
+ react,
2141
+ renameRules,
2142
+ resolveSubOptions,
2143
+ sortPackageJson,
2144
+ sortTsconfig,
2145
+ stylistic,
2146
+ svelte,
2147
+ test,
2148
+ toArray,
2149
+ toml,
2150
+ typescript,
2151
+ unicorn,
2152
+ unocss,
2153
+ vue,
2154
+ yaml
2155
+ };