@so1ve/eslint-config 1.0.0-alpha.1 → 1.0.0-alpha.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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,1693 @@
1
- module.exports = require("C:/Data/Workspace/eslint-prettier-config/node_modules/.pnpm/jiti@1.20.0/node_modules/jiti/lib/index.js")(null, {
2
- "esmResolve": true,
3
- "interopDefault": true,
4
- "alias": {
5
- "@so1ve/eslint-config": "C:/Data/Workspace/eslint-prettier-config/packages/eslint-config"
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var pluginComments = require('@eslint-community/eslint-plugin-eslint-comments');
6
+ var pluginHtml = require('@html-eslint/eslint-plugin');
7
+ var parserHtml = require('@html-eslint/parser');
8
+ var pluginSo1ve = require('@so1ve/eslint-plugin');
9
+ var pluginSortImports = require('@so1ve/eslint-plugin-sort-imports');
10
+ var pluginTs = require('@typescript-eslint/eslint-plugin');
11
+ var parserTs = require('@typescript-eslint/parser');
12
+ var parserMdx = require('eslint-mdx');
13
+ var pluginArrayFunc = require('eslint-plugin-array-func');
14
+ var pluginEtc = require('eslint-plugin-etc');
15
+ var pluginHtmlJsSupport = require('eslint-plugin-html');
16
+ var pluginImport = require('eslint-plugin-i');
17
+ var pluginJestFormatting = require('eslint-plugin-jest-formatting');
18
+ var pluginJsdoc = require('eslint-plugin-jsdoc');
19
+ var pluginJsonSchemaValidator = require('eslint-plugin-json-schema-validator');
20
+ var pluginJsonc = require('eslint-plugin-jsonc');
21
+ var pluginMdx = require('eslint-plugin-mdx');
22
+ var pluginNode = require('eslint-plugin-n');
23
+ var pluginNoOnlyTests = require('eslint-plugin-no-only-tests');
24
+ var pluginOnlyError = require('eslint-plugin-only-error');
25
+ var pluginPromise = require('eslint-plugin-promise');
26
+ var pluginRegexp = require('eslint-plugin-regexp');
27
+ var pluginSolid = require('eslint-plugin-solid');
28
+ var pluginToml = require('eslint-plugin-toml');
29
+ var pluginUnicorn = require('eslint-plugin-unicorn');
30
+ var pluginUnusedImports = require('eslint-plugin-unused-imports');
31
+ var pluginVitest = require('eslint-plugin-vitest');
32
+ var pluginVue = require('eslint-plugin-vue');
33
+ var pluginYaml = require('eslint-plugin-yml');
34
+ var parserJsonc = require('jsonc-eslint-parser');
35
+ var parserToml = require('toml-eslint-parser');
36
+ var parserVue = require('vue-eslint-parser');
37
+ var parserYaml = require('yaml-eslint-parser');
38
+ var globals = require('globals');
39
+ var fs = require('node:fs');
40
+ var gitignore = require('eslint-config-flat-gitignore');
41
+ var localPkg = require('local-pkg');
42
+
43
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
44
+
45
+ var pluginComments__default = /*#__PURE__*/_interopDefaultLegacy(pluginComments);
46
+ var pluginHtml__default = /*#__PURE__*/_interopDefaultLegacy(pluginHtml);
47
+ var parserHtml__default = /*#__PURE__*/_interopDefaultLegacy(parserHtml);
48
+ var pluginSo1ve__default = /*#__PURE__*/_interopDefaultLegacy(pluginSo1ve);
49
+ var pluginSortImports__default = /*#__PURE__*/_interopDefaultLegacy(pluginSortImports);
50
+ var pluginTs__default = /*#__PURE__*/_interopDefaultLegacy(pluginTs);
51
+ var parserTs__default = /*#__PURE__*/_interopDefaultLegacy(parserTs);
52
+ var parserMdx__default = /*#__PURE__*/_interopDefaultLegacy(parserMdx);
53
+ var pluginArrayFunc__default = /*#__PURE__*/_interopDefaultLegacy(pluginArrayFunc);
54
+ var pluginEtc__default = /*#__PURE__*/_interopDefaultLegacy(pluginEtc);
55
+ var pluginHtmlJsSupport__default = /*#__PURE__*/_interopDefaultLegacy(pluginHtmlJsSupport);
56
+ var pluginImport__default = /*#__PURE__*/_interopDefaultLegacy(pluginImport);
57
+ var pluginJestFormatting__default = /*#__PURE__*/_interopDefaultLegacy(pluginJestFormatting);
58
+ var pluginJsdoc__default = /*#__PURE__*/_interopDefaultLegacy(pluginJsdoc);
59
+ var pluginJsonSchemaValidator__default = /*#__PURE__*/_interopDefaultLegacy(pluginJsonSchemaValidator);
60
+ var pluginJsonc__default = /*#__PURE__*/_interopDefaultLegacy(pluginJsonc);
61
+ var pluginMdx__default = /*#__PURE__*/_interopDefaultLegacy(pluginMdx);
62
+ var pluginNode__default = /*#__PURE__*/_interopDefaultLegacy(pluginNode);
63
+ var pluginNoOnlyTests__default = /*#__PURE__*/_interopDefaultLegacy(pluginNoOnlyTests);
64
+ var pluginOnlyError__default = /*#__PURE__*/_interopDefaultLegacy(pluginOnlyError);
65
+ var pluginPromise__default = /*#__PURE__*/_interopDefaultLegacy(pluginPromise);
66
+ var pluginRegexp__default = /*#__PURE__*/_interopDefaultLegacy(pluginRegexp);
67
+ var pluginSolid__default = /*#__PURE__*/_interopDefaultLegacy(pluginSolid);
68
+ var pluginToml__default = /*#__PURE__*/_interopDefaultLegacy(pluginToml);
69
+ var pluginUnicorn__default = /*#__PURE__*/_interopDefaultLegacy(pluginUnicorn);
70
+ var pluginUnusedImports__default = /*#__PURE__*/_interopDefaultLegacy(pluginUnusedImports);
71
+ var pluginVitest__default = /*#__PURE__*/_interopDefaultLegacy(pluginVitest);
72
+ var pluginVue__default = /*#__PURE__*/_interopDefaultLegacy(pluginVue);
73
+ var pluginYaml__default = /*#__PURE__*/_interopDefaultLegacy(pluginYaml);
74
+ var parserJsonc__default = /*#__PURE__*/_interopDefaultLegacy(parserJsonc);
75
+ var parserToml__default = /*#__PURE__*/_interopDefaultLegacy(parserToml);
76
+ var parserVue__default = /*#__PURE__*/_interopDefaultLegacy(parserVue);
77
+ var parserYaml__default = /*#__PURE__*/_interopDefaultLegacy(parserYaml);
78
+ var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);
79
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
80
+ var gitignore__default = /*#__PURE__*/_interopDefaultLegacy(gitignore);
81
+
82
+ const comments = () => [
83
+ {
84
+ plugins: {
85
+ "eslint-comments": pluginComments__default["default"]
86
+ }
87
+ },
88
+ {
89
+ rules: {
90
+ "eslint-comments/no-aggregating-enable": "error",
91
+ "eslint-comments/no-duplicate-disable": "error",
92
+ "eslint-comments/no-unused-enable": "error",
93
+ "eslint-comments/disable-enable-pair": "off",
94
+ "eslint-comments/no-unlimited-disable": "off"
95
+ }
6
96
  }
7
- })("C:/Data/Workspace/eslint-prettier-config/packages/eslint-config/src/index.ts")
97
+ ];
98
+
99
+ const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
100
+ const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
101
+ const GLOB_JS = "**/*.?([cm])js";
102
+ const GLOB_JSX = "**/*.?([cm])jsx";
103
+ const GLOB_TS = "**/*.?([cm])ts";
104
+ const GLOB_TSX = "**/*.?([cm])tsx";
105
+ const GLOB_DTS = "**/*.d.?([cm])tsx";
106
+ const GLOB_STYLE = "**/*.{c,le,sc}ss";
107
+ const GLOB_CSS = "**/*.css";
108
+ const GLOB_LESS = "**/*.less";
109
+ const GLOB_SCSS = "**/*.scss";
110
+ const GLOB_JSON = "**/*.json";
111
+ const GLOB_JSON5 = "**/*.json5";
112
+ const GLOB_JSONC = "**/*.jsonc";
113
+ const GLOB_ESLINTRC = "**/.eslintrc";
114
+ const GLOB_MARKDOWN = "**/*.md?(x)";
115
+ const GLOB_VUE = "**/*.vue";
116
+ const GLOB_YAML = "**/*.y?(a)ml";
117
+ const GLOB_TOML = "**/*.toml";
118
+ const GLOB_HTML = "**/*.htm?(l)";
119
+ const GLOB_PACKAGEJSON = "**/package.json";
120
+ const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
121
+ const GLOB_TESTS = [
122
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
123
+ `**/*.spec.${GLOB_SRC_EXT}`,
124
+ `**/*.test.${GLOB_SRC_EXT}`
125
+ ];
126
+ const GLOB_ALL_SRC = [
127
+ GLOB_SRC,
128
+ GLOB_STYLE,
129
+ GLOB_JSON,
130
+ GLOB_JSON5,
131
+ GLOB_ESLINTRC,
132
+ GLOB_MARKDOWN,
133
+ GLOB_VUE,
134
+ GLOB_YAML,
135
+ GLOB_HTML
136
+ ];
137
+ const GLOB_EXCLUDE = [
138
+ "**/node_modules",
139
+ "**/dist",
140
+ "**/out",
141
+ "**/output",
142
+ "**/package-lock.json",
143
+ "**/yarn.lock",
144
+ "**/pnpm-lock.yaml",
145
+ "**/coverage",
146
+ "**/temp",
147
+ "**/.vitepress/cache",
148
+ "**/.nuxt",
149
+ "**/.nitro",
150
+ "**/.vercel",
151
+ "**/.netlify",
152
+ "**/.output",
153
+ "**/.vercel",
154
+ "**/.changeset",
155
+ "**/.idea",
156
+ "**/.vite-inspect",
157
+ "**/.yarn",
158
+ "**/CHANGELOG*.md",
159
+ "**/*.min.*",
160
+ "**/LICENSE*",
161
+ "**/__snapshots__",
162
+ "**/auto-import?(s).d.ts",
163
+ "**/components.d.ts",
164
+ // Volar
165
+ "**/*.vue.js",
166
+ "**/*.vue.jsx",
167
+ "**/*.vue.ts",
168
+ "**/*.vue.tsx"
169
+ ];
170
+
171
+ const html = () => [
172
+ {
173
+ plugins: {
174
+ "html": pluginHtml__default["default"],
175
+ "html-js-support": pluginHtmlJsSupport__default["default"]
176
+ }
177
+ },
178
+ {
179
+ languageOptions: {
180
+ parser: parserHtml__default["default"]
181
+ },
182
+ settings: {
183
+ "html/report-bad-indent": "off"
184
+ },
185
+ files: [GLOB_HTML],
186
+ rules: {
187
+ ...pluginHtml__default["default"].configs.recommended.rules,
188
+ "html/indent": "off",
189
+ "html/no-trailing-spaces": "off",
190
+ "html/require-closing-tags": "off",
191
+ "html/no-extra-spacing-attrs": "off",
192
+ "html/quotes": "off"
193
+ }
194
+ }
195
+ ];
196
+
197
+ const ignores = () => [
198
+ { ignores: GLOB_EXCLUDE }
199
+ ];
200
+
201
+ const imports = (options = {}) => [
202
+ {
203
+ plugins: {
204
+ import: pluginImport__default["default"]
205
+ }
206
+ },
207
+ {
208
+ settings: options.typescript ? {
209
+ "import/resolver": {
210
+ node: { extensions: [".js", ".mjs"] }
211
+ }
212
+ } : {
213
+ node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] },
214
+ typescript: {
215
+ extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"]
216
+ }
217
+ },
218
+ rules: {
219
+ ...pluginImport__default["default"].configs.recommended.rules,
220
+ "import/first": "error",
221
+ "import/no-mutable-exports": "error",
222
+ "import/no-useless-path-segments": ["error", { noUselessIndex: true }],
223
+ "import/no-unresolved": "off",
224
+ "import/no-absolute-path": "off",
225
+ "import/namespace": "off",
226
+ // Disable this for better performance
227
+ "import/export": "error",
228
+ "import/no-duplicates": "error",
229
+ "import/no-named-default": "error",
230
+ "import/no-webpack-loader-syntax": "error",
231
+ "import/no-named-as-default-member": "off"
232
+ }
233
+ },
234
+ {
235
+ files: [GLOB_DTS],
236
+ rules: {
237
+ "import/no-duplicates": "off"
238
+ }
239
+ }
240
+ ];
241
+
242
+ const javascript = ({
243
+ overrides
244
+ } = {}) => [
245
+ {
246
+ plugins: {
247
+ "so1ve": pluginSo1ve__default["default"],
248
+ "unused-imports": pluginUnusedImports__default["default"],
249
+ "sort-imports": pluginSortImports__default["default"],
250
+ "array-func": pluginArrayFunc__default["default"],
251
+ "json-schema-validator": pluginJsonSchemaValidator__default["default"],
252
+ "regexp": pluginRegexp__default["default"]
253
+ }
254
+ },
255
+ {
256
+ languageOptions: {
257
+ ecmaVersion: 2022,
258
+ globals: {
259
+ ...globals__default["default"].browser,
260
+ ...globals__default["default"].es2021,
261
+ ...globals__default["default"].node,
262
+ document: "readonly",
263
+ navigator: "readonly",
264
+ window: "readonly"
265
+ },
266
+ parserOptions: {
267
+ ecmaFeatures: {
268
+ jsx: true
269
+ },
270
+ ecmaVersion: 2022,
271
+ sourceType: "module"
272
+ },
273
+ sourceType: "module"
274
+ },
275
+ rules: {
276
+ // Common
277
+ "array-bracket-newline": "off",
278
+ "array-element-newline": "off",
279
+ "arrow-body-style": "off",
280
+ "arrow-parens": "off",
281
+ "dot-notation": ["error", { allowKeywords: true }],
282
+ "function-call-argument-newline": "off",
283
+ "function-paren-newline": "off",
284
+ "generator-star": "off",
285
+ "implicit-arrow-linebreak": "off",
286
+ "indent": "off",
287
+ "indent-legacy": "off",
288
+ "jsx-quotes": "off",
289
+ "linebreak-style": "off",
290
+ "newline-per-chained-call": "off",
291
+ "no-arrow-condition": "off",
292
+ "no-comma-dangle": "off",
293
+ "no-confusing-arrow": "off",
294
+ "no-extra-semi": "off",
295
+ "no-reserved-keys": "off",
296
+ "no-spaced-func": "off",
297
+ "no-space-before-semi": "off",
298
+ "no-wrap-func": "off",
299
+ "nonblock-statement-body-position": "off",
300
+ "one-var-declaration-per-line": "off",
301
+ "switch-colon-spacing": "off",
302
+ "symbol-description": "off",
303
+ "wrap-regex": "off",
304
+ "unused-imports/no-unused-imports": "error",
305
+ "unused-imports/no-unused-vars": [
306
+ "error",
307
+ {
308
+ vars: "all",
309
+ varsIgnorePattern: "^_",
310
+ args: "after-used",
311
+ argsIgnorePattern: "^_"
312
+ }
313
+ ],
314
+ "accessor-pairs": [
315
+ "error",
316
+ { setWithoutGet: true, enforceForClassMembers: true }
317
+ ],
318
+ "constructor-super": "error",
319
+ "default-case-last": "error",
320
+ "lines-between-class-members": [
321
+ "error",
322
+ "always",
323
+ { exceptAfterSingleLine: true }
324
+ ],
325
+ "new-cap": [
326
+ "error",
327
+ { newIsCap: true, capIsNew: false, properties: true }
328
+ ],
329
+ "no-array-constructor": "error",
330
+ "no-async-promise-executor": "error",
331
+ "no-caller": "error",
332
+ "no-class-assign": "error",
333
+ "no-compare-neg-zero": "error",
334
+ "no-const-assign": "error",
335
+ "no-control-regex": "error",
336
+ "no-delete-var": "error",
337
+ "no-dupe-args": "error",
338
+ "no-dupe-class-members": "error",
339
+ "no-dupe-keys": "error",
340
+ "no-duplicate-case": "error",
341
+ "no-useless-backreference": "error",
342
+ "no-useless-call": "error",
343
+ "no-useless-computed-key": "error",
344
+ "no-useless-constructor": "error",
345
+ "no-useless-rename": "error",
346
+ "no-useless-return": "error",
347
+ "no-void": "error",
348
+ "no-empty": ["error", { allowEmptyCatch: true }],
349
+ "no-empty-character-class": "error",
350
+ "no-empty-pattern": "error",
351
+ "no-eval": "error",
352
+ "no-ex-assign": "error",
353
+ "no-extend-native": "error",
354
+ "no-extra-bind": "error",
355
+ "no-extra-boolean-cast": "error",
356
+ "no-extra-parens": ["error", "functions"],
357
+ "no-fallthrough": "error",
358
+ "no-func-assign": "error",
359
+ "no-global-assign": "error",
360
+ "no-implied-eval": "error",
361
+ "no-import-assign": "error",
362
+ "no-invalid-regexp": "error",
363
+ "no-irregular-whitespace": "error",
364
+ "no-iterator": "error",
365
+ "no-labels": ["error", { allowLoop: true, allowSwitch: false }],
366
+ "no-lone-blocks": "error",
367
+ "no-loss-of-precision": "error",
368
+ "no-misleading-character-class": "error",
369
+ "no-new-func": "error",
370
+ "no-new-object": "error",
371
+ "no-new-symbol": "error",
372
+ "no-new-wrappers": "error",
373
+ "no-prototype-builtins": "error",
374
+ "no-useless-catch": "error",
375
+ "no-param-reassign": "off",
376
+ "no-constant-condition": "error",
377
+ "no-debugger": "error",
378
+ "no-console": ["error", { allow: ["error", "warn", "table", "time"] }],
379
+ "no-cond-assign": ["error", "always"],
380
+ "no-restricted-syntax": [
381
+ "error",
382
+ "DebuggerStatement",
383
+ "LabeledStatement",
384
+ "WithStatement"
385
+ ],
386
+ "no-restricted-globals": [
387
+ "error",
388
+ { name: "global", message: "Use `globalThis` instead." },
389
+ { name: "self", message: "Use `globalThis` instead." },
390
+ { name: "isNaN", message: "Use `Number.isNaN` instead" },
391
+ { name: "isFinite", message: "Use `Number.isFinite` instead" },
392
+ { name: "parseFloat", message: "Use `Number.parseFloat` instead" },
393
+ { name: "parseInt", message: "Use `Number.parseInt` instead" }
394
+ ],
395
+ "no-restricted-properties": [
396
+ "error",
397
+ {
398
+ object: "globalThis",
399
+ property: "isNaN",
400
+ message: "Use `Number.isNaN` instead"
401
+ },
402
+ {
403
+ object: "globalThis",
404
+ property: "isFinite",
405
+ message: "Use `Number.isFinite` instead"
406
+ },
407
+ {
408
+ object: "globalThis",
409
+ property: "parseFloat",
410
+ message: "Use `Number.parseFloat` instead"
411
+ },
412
+ {
413
+ object: "globalThis",
414
+ property: "parseInt",
415
+ message: "Use `Number.parseInt` instead"
416
+ },
417
+ {
418
+ object: "window",
419
+ property: "isNaN",
420
+ message: "Use `Number.isNaN` instead"
421
+ },
422
+ {
423
+ object: "window",
424
+ property: "isFinite",
425
+ message: "Use `Number.isFinite` instead"
426
+ },
427
+ {
428
+ object: "window",
429
+ property: "parseFloat",
430
+ message: "Use `Number.parseFloat` instead"
431
+ },
432
+ {
433
+ object: "window",
434
+ property: "parseInt",
435
+ message: "Use `Number.parseInt` instead"
436
+ }
437
+ ],
438
+ "no-obj-calls": "error",
439
+ "no-octal": "error",
440
+ "no-octal-escape": "error",
441
+ "no-proto": "error",
442
+ "no-redeclare": ["error", { builtinGlobals: false }],
443
+ "no-regex-spaces": "error",
444
+ "no-self-assign": ["error", { props: true }],
445
+ "no-self-compare": "error",
446
+ "no-sequences": "error",
447
+ "no-shadow-restricted-names": "error",
448
+ "no-template-curly-in-string": "error",
449
+ "no-this-before-super": "error",
450
+ "no-throw-literal": "error",
451
+ "no-undef": "error",
452
+ "no-undef-init": "error",
453
+ "no-unexpected-multiline": "error",
454
+ "no-unmodified-loop-condition": "error",
455
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
456
+ "no-unreachable": "error",
457
+ "no-unreachable-loop": "error",
458
+ "no-unsafe-finally": "error",
459
+ "no-unsafe-negation": "error",
460
+ "no-return-await": "off",
461
+ // es6
462
+ "no-var": "error",
463
+ "prefer-const": [
464
+ "error",
465
+ {
466
+ destructuring: "all",
467
+ ignoreReadBeforeAssign: true
468
+ }
469
+ ],
470
+ "prefer-arrow-callback": [
471
+ "error",
472
+ {
473
+ allowNamedFunctions: false,
474
+ allowUnboundThis: true
475
+ }
476
+ ],
477
+ "one-var": ["error", "never"],
478
+ "object-shorthand": [
479
+ "error",
480
+ "always",
481
+ {
482
+ ignoreConstructors: false
483
+ }
484
+ ],
485
+ "quote-props": ["error", "consistent-as-needed"],
486
+ "padding-line-between-statements": [
487
+ "error",
488
+ { blankLine: "always", prev: "*", next: "return" }
489
+ ],
490
+ "prefer-exponentiation-operator": "error",
491
+ "prefer-rest-params": "error",
492
+ "prefer-spread": "error",
493
+ "prefer-template": "error",
494
+ "prefer-promise-reject-errors": "error",
495
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
496
+ "yoda": ["error", "never"],
497
+ "spaced-comment": [
498
+ "error",
499
+ "always",
500
+ {
501
+ line: {
502
+ markers: ["/"],
503
+ exceptions: ["/", "#"]
504
+ },
505
+ block: {
506
+ markers: ["!"],
507
+ exceptions: ["*"],
508
+ balanced: true
509
+ }
510
+ }
511
+ ],
512
+ // best-practice
513
+ "array-callback-return": "error",
514
+ "block-scoped-var": "error",
515
+ "no-unused-expressions": [
516
+ "error",
517
+ {
518
+ allowShortCircuit: true,
519
+ allowTernary: true,
520
+ allowTaggedTemplates: true
521
+ }
522
+ ],
523
+ "no-unused-vars": [
524
+ "error",
525
+ {
526
+ args: "none",
527
+ caughtErrors: "none",
528
+ ignoreRestSiblings: true,
529
+ vars: "all"
530
+ }
531
+ ],
532
+ "no-use-before-define": [
533
+ "error",
534
+ { functions: false, classes: false, variables: true }
535
+ ],
536
+ "consistent-return": "off",
537
+ "complexity": ["off", 11],
538
+ "eqeqeq": ["error", "smart"],
539
+ "no-alert": "error",
540
+ "no-case-declarations": "error",
541
+ "no-multi-str": "error",
542
+ "no-with": "error",
543
+ "no-invalid-this": "error",
544
+ "vars-on-top": "error",
545
+ "require-await": "off",
546
+ "use-isnan": [
547
+ "error",
548
+ {
549
+ enforceForSwitchCase: true,
550
+ enforceForIndexOf: true
551
+ }
552
+ ],
553
+ "valid-typeof": ["error", { requireStringLiterals: true }],
554
+ // so1ve
555
+ "so1ve/import-dedupe": "error",
556
+ "so1ve/no-useless-template-string": "error",
557
+ "so1ve/no-negated-comparison": "error",
558
+ "so1ve/no-import-promises-as": "error",
559
+ "so1ve/pad-after-last-import": "error",
560
+ "so1ve/function-style": "error",
561
+ "so1ve/use-async-with-await": "error",
562
+ // Sort Imports
563
+ "sort-imports/imports": ["error"],
564
+ "sort-imports/exports": "error",
565
+ // array-func
566
+ "array-func/prefer-array-from": "off",
567
+ // json-schema-validator
568
+ "json-schema-validator/no-invalid": "warn",
569
+ // regexp
570
+ "regexp/no-unused-capturing-group": "warn",
571
+ ...overrides
572
+ }
573
+ },
574
+ {
575
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
576
+ rules: {
577
+ "no-console": "off"
578
+ }
579
+ }
580
+ ];
581
+
582
+ const jsdoc = () => [
583
+ {
584
+ plugins: {
585
+ jsdoc: pluginJsdoc__default["default"]
586
+ },
587
+ rules: {
588
+ "jsdoc/check-access": "error",
589
+ "jsdoc/check-alignment": "error",
590
+ "jsdoc/check-param-names": "error",
591
+ "jsdoc/check-property-names": "error",
592
+ "jsdoc/check-types": "error",
593
+ "jsdoc/empty-tags": "error",
594
+ "jsdoc/implements-on-classes": "error",
595
+ "jsdoc/multiline-blocks": "error",
596
+ "jsdoc/no-defaults": "error",
597
+ "jsdoc/no-multi-asterisks": "error",
598
+ "jsdoc/no-types": "error",
599
+ "jsdoc/require-param-name": "error",
600
+ "jsdoc/require-property": "error",
601
+ "jsdoc/require-property-description": "error",
602
+ "jsdoc/require-property-name": "error",
603
+ "jsdoc/require-returns-check": "error",
604
+ "jsdoc/require-returns-description": "error",
605
+ "jsdoc/require-yields-check": "error",
606
+ "jsdoc/valid-types": "error"
607
+ }
608
+ }
609
+ ];
610
+
611
+ const jsonc = () => [
612
+ {
613
+ plugins: {
614
+ jsonc: pluginJsonc__default["default"]
615
+ }
616
+ },
617
+ {
618
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_ESLINTRC],
619
+ languageOptions: {
620
+ parser: parserJsonc__default["default"]
621
+ },
622
+ rules: {
623
+ ...pluginJsonc__default["default"].configs.base.overrides[0].rules,
624
+ ...pluginJsonc__default["default"].configs["recommended-with-jsonc"].rules,
625
+ "jsonc/no-octal-escape": "error",
626
+ "jsonc/quotes": "off",
627
+ "jsonc/quotes-props": "off"
628
+ }
629
+ },
630
+ {
631
+ files: [GLOB_PACKAGEJSON],
632
+ rules: {
633
+ "jsonc/sort-keys": [
634
+ "error",
635
+ {
636
+ pathPattern: "^exports$",
637
+ order: { type: "asc" }
638
+ },
639
+ {
640
+ pathPattern: "^exports.*$",
641
+ order: ["types", "require", "import", "default"]
642
+ }
643
+ ]
644
+ }
645
+ }
646
+ ];
647
+
648
+ const mdx = ({
649
+ componentExts = [],
650
+ overrides
651
+ } = {}) => [
652
+ {
653
+ plugins: {
654
+ mdx: pluginMdx__default["default"]
655
+ }
656
+ },
657
+ {
658
+ languageOptions: {
659
+ parser: parserMdx__default["default"]
660
+ },
661
+ settings: {
662
+ "mdx/code-blocks": true
663
+ },
664
+ files: [GLOB_MARKDOWN],
665
+ processor: "mdx/remark",
666
+ rules: {
667
+ "mdx/remark": "warn",
668
+ "no-unused-expressions": "error"
669
+ }
670
+ },
671
+ {
672
+ files: [
673
+ GLOB_MARKDOWN_CODE,
674
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
675
+ ],
676
+ languageOptions: {
677
+ parserOptions: {
678
+ ecmaFeatures: {
679
+ impliedStrict: true
680
+ }
681
+ }
682
+ },
683
+ rules: {
684
+ "html/require-doctype": "off",
685
+ "ts/no-redeclare": "off",
686
+ "ts/no-unused-vars": "off",
687
+ "ts/no-use-before-define": "off",
688
+ "ts/no-var-requires": "off",
689
+ "ts/consistent-type-imports": "off",
690
+ "ts/no-namespace": "off",
691
+ "ts/no-require-imports": "off",
692
+ "import/no-unresolved": "off",
693
+ "unused-imports/no-unused-imports": "off",
694
+ "unused-imports/no-unused-vars": "off",
695
+ "no-alert": "off",
696
+ "no-console": "off",
697
+ "no-restricted-imports": "off",
698
+ "no-undef": "off",
699
+ "no-unused-expressions": "off",
700
+ ...overrides
701
+ }
702
+ }
703
+ ];
704
+
705
+ const node = () => [
706
+ {
707
+ plugins: {
708
+ node: pluginNode__default["default"]
709
+ }
710
+ },
711
+ {
712
+ rules: {
713
+ "node/no-callback-literal": "off",
714
+ "node/handle-callback-err": ["error", "^(err|error)$"],
715
+ "node/no-deprecated-api": "error",
716
+ "node/no-exports-assign": "error",
717
+ "node/no-new-require": "error",
718
+ "node/no-path-concat": "error",
719
+ "node/process-exit-as-throw": "error"
720
+ }
721
+ }
722
+ ];
723
+
724
+ const onlyError = () => [
725
+ {
726
+ plugins: {
727
+ "only-error": pluginOnlyError__default["default"]
728
+ }
729
+ }
730
+ ];
731
+
732
+ const promise = () => [
733
+ {
734
+ plugins: {
735
+ promise: pluginPromise__default["default"]
736
+ }
737
+ },
738
+ {
739
+ rules: {
740
+ "promise/param-names": "error"
741
+ }
742
+ }
743
+ ];
744
+
745
+ const solid = ({
746
+ overrides,
747
+ typescript
748
+ } = {}) => [
749
+ {
750
+ plugins: {
751
+ solid: pluginSolid__default["default"]
752
+ }
753
+ },
754
+ {
755
+ languageOptions: {
756
+ sourceType: "module",
757
+ parserOptions: {
758
+ ecmaFeatures: {
759
+ jsx: true
760
+ }
761
+ }
762
+ },
763
+ rules: {
764
+ ...pluginSolid__default["default"].configs.recommended.rules,
765
+ ...typescript ? pluginSolid__default["default"].configs.typescript.rules : {},
766
+ ...overrides
767
+ }
768
+ }
769
+ ];
770
+
771
+ const sortImports = () => [
772
+ {
773
+ plugins: {
774
+ "sort-imports": pluginSortImports__default["default"]
775
+ }
776
+ },
777
+ {
778
+ rules: {
779
+ "sort-imports/imports": "error",
780
+ "sort-imports/exports": "error"
781
+ }
782
+ }
783
+ ];
784
+
785
+ const test = ({
786
+ overrides
787
+ } = {}) => [
788
+ {
789
+ plugins: {
790
+ "no-only-tests": pluginNoOnlyTests__default["default"],
791
+ "vitest": pluginVitest__default["default"],
792
+ "jest-formatting": pluginJestFormatting__default["default"]
793
+ }
794
+ },
795
+ {
796
+ files: GLOB_TESTS,
797
+ rules: {
798
+ ...pluginVitest__default["default"].configs.recommended.rules,
799
+ "no-only-tests/no-only-tests": "error",
800
+ "vitest/expect-expect": "off",
801
+ "vitest/valid-describe-callback": "off",
802
+ "vitest/no-alias-methods": "error",
803
+ "vitest/no-interpolation-in-snapshots": "error",
804
+ "vitest/no-test-prefixes": "error",
805
+ "vitest/prefer-expect-resolves": "error",
806
+ "vitest/prefer-comparison-matcher": "error",
807
+ "vitest/prefer-mock-promise-shorthand": "error",
808
+ "vitest/prefer-spy-on": "error",
809
+ "vitest/prefer-to-be-falsy": "error",
810
+ "vitest/prefer-to-be-object": "error",
811
+ "vitest/prefer-to-be-truthy": "error",
812
+ "vitest/prefer-to-contain": "error",
813
+ "vitest/prefer-to-have-length": "error",
814
+ "vitest/prefer-todo": "error",
815
+ "vitest/valid-title": ["error", { allowArguments: true }],
816
+ "jest-formatting/padding-around-all": "error",
817
+ ...overrides
818
+ }
819
+ }
820
+ ];
821
+
822
+ const toml = ({
823
+ overrides
824
+ } = {}) => [
825
+ {
826
+ plugins: {
827
+ toml: pluginToml__default["default"]
828
+ }
829
+ },
830
+ {
831
+ languageOptions: {
832
+ parser: parserToml__default["default"]
833
+ },
834
+ files: [GLOB_TOML],
835
+ rules: {
836
+ ...pluginToml__default["default"].configs.recommended.rules,
837
+ "no-irregular-whitespace": "off",
838
+ "spaced-comment": "off",
839
+ ...overrides
840
+ }
841
+ }
842
+ ];
843
+
844
+ const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
845
+ const renameRules = (rules, from, to) => Object.fromEntries(
846
+ Object.entries(rules).map(([key, value]) => {
847
+ if (key.startsWith(from)) {
848
+ return [to + key.slice(from.length), value];
849
+ }
850
+ return [key, value];
851
+ })
852
+ );
853
+ const rulesOn = /* @__PURE__ */ new Set();
854
+ const rulesOff = /* @__PURE__ */ new Set();
855
+ function recordRulesStateConfigs(configs) {
856
+ var _a;
857
+ for (const config of configs) {
858
+ recordRulesState((_a = config.rules) != null ? _a : {});
859
+ }
860
+ return configs;
861
+ }
862
+ function recordRulesState(rules) {
863
+ for (const [key, value] of Object.entries(rules != null ? rules : {})) {
864
+ const firstValue = Array.isArray(value) ? value[0] : value;
865
+ if (firstValue == null) {
866
+ continue;
867
+ }
868
+ if (firstValue === "off" || firstValue === 0) {
869
+ rulesOff.add(key);
870
+ } else {
871
+ rulesOn.add(key);
872
+ }
873
+ }
874
+ return rules;
875
+ }
876
+ function warnUnnecessaryOffRules() {
877
+ const unnecessaryOffRules = [...rulesOff].filter((key) => !rulesOn.has(key));
878
+ for (const off of unnecessaryOffRules) {
879
+ console.warn(
880
+ `[eslint] rule \`${off}\` is never turned on, you can remove the rule from your config`
881
+ );
882
+ }
883
+ }
884
+
885
+ const typescript = ({
886
+ componentExts = [],
887
+ overrides
888
+ } = {}) => [
889
+ {
890
+ // Install the plugins without globs, so they can be configured separately.
891
+ plugins: {
892
+ import: pluginImport__default["default"],
893
+ ts: pluginTs__default["default"]
894
+ }
895
+ },
896
+ {
897
+ files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
898
+ languageOptions: {
899
+ parser: parserTs__default["default"],
900
+ parserOptions: {
901
+ sourceType: "module"
902
+ }
903
+ },
904
+ settings: {
905
+ "import/resolver": {
906
+ node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] },
907
+ typescript: {
908
+ extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"]
909
+ }
910
+ }
911
+ },
912
+ rules: {
913
+ ...renameRules(
914
+ pluginTs__default["default"].configs["eslint-recommended"].overrides[0].rules,
915
+ "@typescript-eslint/",
916
+ "ts/"
917
+ ),
918
+ ...renameRules(
919
+ pluginTs__default["default"].configs.recommended.rules,
920
+ "@typescript-eslint/",
921
+ "ts/"
922
+ ),
923
+ "import/named": "off",
924
+ // TS
925
+ "ts/comma-dangle": "off",
926
+ "ts/brace-style": "off",
927
+ "ts/comma-spacing": "off",
928
+ "ts/func-call-spacing": "off",
929
+ "ts/indent": "off",
930
+ "ts/keyword-spacing": "off",
931
+ "ts/member-delimiter-style": "off",
932
+ "ts/no-extra-parens": "off",
933
+ "ts/no-extra-semi": "off",
934
+ "ts/quotes": "off",
935
+ "ts/semi": "off",
936
+ "ts/space-before-function-paren": "off",
937
+ "ts/type-annotation-spacing": "off",
938
+ "ts/ban-ts-comment": [
939
+ "error",
940
+ {
941
+ minimumDescriptionLength: 0
942
+ }
943
+ ],
944
+ "ts/ban-types": [
945
+ "error",
946
+ {
947
+ extendDefaults: false,
948
+ types: {
949
+ String: {
950
+ message: "Use `string` instead.",
951
+ fixWith: "string"
952
+ },
953
+ Number: {
954
+ message: "Use `number` instead.",
955
+ fixWith: "number"
956
+ },
957
+ Boolean: {
958
+ message: "Use `boolean` instead.",
959
+ fixWith: "boolean"
960
+ },
961
+ Symbol: {
962
+ message: "Use `symbol` instead.",
963
+ fixWith: "symbol"
964
+ },
965
+ BigInt: {
966
+ message: "Use `bigint` instead.",
967
+ fixWith: "bigint"
968
+ },
969
+ Object: {
970
+ message: "The `Object` type is mostly the same as `unknown`. You probably want `Record<PropertyKey, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
971
+ fixWith: "Record<PropertyKey, unknown>"
972
+ },
973
+ object: {
974
+ message: "The `object` type is hard to use. Use `Record<PropertyKey, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
975
+ fixWith: "Record<PropertyKey, unknown>"
976
+ },
977
+ Function: {
978
+ message: "Use `(...args: any[]) => any` instead.",
979
+ fixWith: "(...args: any[]) => any"
980
+ }
981
+ }
982
+ }
983
+ ],
984
+ "ts/consistent-type-imports": [
985
+ "error",
986
+ { prefer: "type-imports", disallowTypeAnnotations: false }
987
+ ],
988
+ "ts/consistent-type-definitions": ["error", "interface"],
989
+ "ts/consistent-indexed-object-style": ["error", "record"],
990
+ "ts/prefer-ts-expect-error": "error",
991
+ "ts/no-require-imports": "error",
992
+ "ts/method-signature-style": ["error", "property"],
993
+ // Override JS
994
+ "no-useless-constructor": "off",
995
+ "no-invalid-this": "off",
996
+ "ts/no-invalid-this": "error",
997
+ "no-redeclare": "off",
998
+ "ts/no-redeclare": "error",
999
+ "no-use-before-define": "off",
1000
+ "ts/no-use-before-define": [
1001
+ "error",
1002
+ { functions: false, classes: false, variables: true }
1003
+ ],
1004
+ "object-curly-spacing": "off",
1005
+ "space-before-blocks": "off",
1006
+ "ts/space-before-blocks": "off",
1007
+ "space-before-function-paren": "off",
1008
+ "no-dupe-class-members": "off",
1009
+ "ts/no-dupe-class-members": "error",
1010
+ "no-loss-of-precision": "off",
1011
+ "ts/no-loss-of-precision": "error",
1012
+ "lines-between-class-members": "off",
1013
+ "ts/lines-between-class-members": [
1014
+ "error",
1015
+ "always",
1016
+ { exceptAfterSingleLine: true }
1017
+ ],
1018
+ // so1ve
1019
+ "so1ve/no-inline-type-import": "error",
1020
+ // off
1021
+ "ts/camelcase": "off",
1022
+ "ts/explicit-function-return-type": "off",
1023
+ "ts/explicit-member-accessibility": "off",
1024
+ "ts/no-explicit-any": "off",
1025
+ "ts/no-parameter-properties": "off",
1026
+ "ts/no-empty-interface": "off",
1027
+ "ts/ban-ts-ignore": "off",
1028
+ "ts/no-empty-function": "off",
1029
+ "ts/no-non-null-assertion": "off",
1030
+ "ts/explicit-module-boundary-types": "off",
1031
+ "ts/triple-slash-reference": "off",
1032
+ "ts/prefer-for-of": "error",
1033
+ "ts/no-duplicate-enum-values": "error",
1034
+ "ts/no-non-null-asserted-nullish-coalescing": "error",
1035
+ // handled by unused-imports/no-unused-imports
1036
+ "ts/no-unused-vars": "off",
1037
+ ...overrides
1038
+ }
1039
+ },
1040
+ {
1041
+ files: ["**/*.d.ts"],
1042
+ rules: {
1043
+ "eslint-comments/no-unlimited-disable": "off",
1044
+ "import/no-duplicates": "off",
1045
+ "unused-imports/no-unused-vars": "off"
1046
+ }
1047
+ },
1048
+ {
1049
+ files: ["**/*.js", "**/*.cjs"],
1050
+ rules: {
1051
+ "ts/no-require-imports": "off",
1052
+ "ts/no-var-requires": "off"
1053
+ }
1054
+ }
1055
+ ];
1056
+ const typescriptWithTypes = ({
1057
+ componentExts = [],
1058
+ tsconfigPath,
1059
+ tsconfigRootDir = process.cwd(),
1060
+ overrides = {}
1061
+ }) => [
1062
+ {
1063
+ files: [
1064
+ GLOB_TS,
1065
+ GLOB_TSX,
1066
+ ...componentExts.map((ext) => `**/*.${ext}`),
1067
+ `!${GLOB_MARKDOWN}/*.*`
1068
+ ],
1069
+ plugins: {
1070
+ etc: pluginEtc__default["default"]
1071
+ },
1072
+ languageOptions: {
1073
+ parser: parserTs__default["default"],
1074
+ parserOptions: {
1075
+ project: [tsconfigPath],
1076
+ tsconfigRootDir,
1077
+ EXPERIMENTAL_useProjectService: true
1078
+ }
1079
+ },
1080
+ rules: {
1081
+ "etc/no-assign-mutated-array": "error",
1082
+ "etc/no-deprecated": "warn",
1083
+ "etc/no-internal": "error",
1084
+ "no-throw-literal": "off",
1085
+ "ts/no-throw-literal": "error",
1086
+ "no-implied-eval": "off",
1087
+ "ts/no-implied-eval": "error",
1088
+ "dot-notation": "off",
1089
+ "ts/dot-notation": ["error", { allowKeywords: true }],
1090
+ "no-void": ["error", { allowAsStatement: true }],
1091
+ "ts/await-thenable": "error",
1092
+ "ts/no-for-in-array": "error",
1093
+ "ts/no-unnecessary-type-assertion": "error",
1094
+ "ts/restrict-template-expressions": [
1095
+ "error",
1096
+ {
1097
+ allowAny: true,
1098
+ allowNumber: true,
1099
+ allowBoolean: true
1100
+ }
1101
+ ],
1102
+ "ts/array-type": ["error", { default: "array", readonly: "array" }],
1103
+ "ts/consistent-generic-constructors": "error",
1104
+ "ts/consistent-type-exports": "error",
1105
+ "ts/consistent-type-assertions": [
1106
+ "error",
1107
+ { assertionStyle: "as", objectLiteralTypeAssertions: "allow" }
1108
+ ],
1109
+ "ts/prefer-nullish-coalescing": "error",
1110
+ "ts/prefer-optional-chain": "error",
1111
+ "ts/prefer-return-this-type": "error",
1112
+ "ts/no-unnecessary-type-arguments": "error",
1113
+ "ts/non-nullable-type-assertion-style": "error",
1114
+ ...overrides
1115
+ }
1116
+ }
1117
+ ];
1118
+
1119
+ const unicorn = () => [
1120
+ {
1121
+ plugins: {
1122
+ unicorn: pluginUnicorn__default["default"]
1123
+ },
1124
+ rules: {
1125
+ "unicorn/error-message": "error",
1126
+ "unicorn/escape-case": "error",
1127
+ "unicorn/no-instanceof-array": "error",
1128
+ "unicorn/no-new-buffer": "error",
1129
+ "unicorn/no-new-array": "error",
1130
+ "unicorn/no-unsafe-regex": "off",
1131
+ "unicorn/number-literal-case": "error",
1132
+ "unicorn/numeric-separators-style": "error",
1133
+ "unicorn/throw-new-error": "error",
1134
+ "unicorn/no-useless-spread": "error",
1135
+ "unicorn/relative-url-style": ["error", "always"],
1136
+ "unicorn/explicit-length-check": "error",
1137
+ "unicorn/new-for-builtins": "error",
1138
+ "unicorn/no-array-for-each": "error",
1139
+ "unicorn/no-array-method-this-argument": "error",
1140
+ "unicorn/no-for-loop": "error",
1141
+ "unicorn/no-lonely-if": "error",
1142
+ "unicorn/no-negated-condition": "error",
1143
+ "unicorn/switch-case-braces": "error",
1144
+ "unicorn/prefer-ternary": "error",
1145
+ "unicorn/prefer-query-selector": "error",
1146
+ "unicorn/prefer-modern-dom-apis": "error",
1147
+ "unicorn/prefer-modern-math-apis": "error",
1148
+ "unicorn/prefer-json-parse-buffer": "error",
1149
+ "unicorn/prefer-date-now": "error",
1150
+ "unicorn/prefer-array-some": "error",
1151
+ "unicorn/prefer-array-index-of": "error",
1152
+ "unicorn/prefer-array-flat": "error",
1153
+ "unicorn/prefer-array-find": "error",
1154
+ "unicorn/prefer-spread": "error",
1155
+ "unicorn/prefer-set-size": "error",
1156
+ "unicorn/prefer-string-slice": "error",
1157
+ "unicorn/prefer-includes": "error",
1158
+ "unicorn/prefer-string-starts-ends-with": "error",
1159
+ "unicorn/prefer-text-content": "error",
1160
+ "unicorn/prefer-type-error": "error",
1161
+ "unicorn/prefer-node-protocol": "error",
1162
+ "unicorn/prefer-regexp-test": "error",
1163
+ "unicorn/prefer-optional-catch-binding": "error"
1164
+ }
1165
+ }
1166
+ ];
1167
+
1168
+ const vue = ({
1169
+ overrides,
1170
+ typescript
1171
+ } = {}) => [
1172
+ {
1173
+ plugins: {
1174
+ vue: pluginVue__default["default"]
1175
+ }
1176
+ },
1177
+ {
1178
+ files: [GLOB_VUE],
1179
+ languageOptions: {
1180
+ parser: parserVue__default["default"],
1181
+ parserOptions: {
1182
+ ecmaFeatures: {
1183
+ jsx: true
1184
+ },
1185
+ extraFileExtensions: [".vue"],
1186
+ parser: typescript ? parserTs__default["default"] : null,
1187
+ sourceType: "module"
1188
+ }
1189
+ },
1190
+ processor: pluginVue__default["default"].processors[".vue"],
1191
+ rules: {
1192
+ ...pluginVue__default["default"].configs.base.rules,
1193
+ ...pluginVue__default["default"].configs["vue3-essential"].rules,
1194
+ ...pluginVue__default["default"].configs["vue3-strongly-recommended"].rules,
1195
+ ...pluginVue__default["default"].configs["vue3-recommended"].rules,
1196
+ "no-unused-vars": "off",
1197
+ "no-undef": "off",
1198
+ "@typescript-eslint/no-unused-vars": "off",
1199
+ "vue/no-v-html": "off",
1200
+ "vue/require-prop-types": "off",
1201
+ "vue/require-default-prop": "off",
1202
+ "vue/multi-word-component-names": "off",
1203
+ "vue/no-ref-object-reactivity-loss": "error",
1204
+ "vue/no-setup-props-reactivity-loss": "error",
1205
+ "vue/block-order": [
1206
+ "error",
1207
+ {
1208
+ order: ["script", "template", "style"]
1209
+ }
1210
+ ],
1211
+ "vue/component-api-style": ["error", ["script-setup", "composition"]],
1212
+ "vue/component-name-in-template-casing": [
1213
+ "error",
1214
+ "PascalCase",
1215
+ { registeredComponentsOnly: false }
1216
+ ],
1217
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1218
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1219
+ "vue/define-macros-order": [
1220
+ "error",
1221
+ {
1222
+ order: ["defineOptions", "defineEmits", "defineProps", "defineSlots"]
1223
+ }
1224
+ ],
1225
+ "vue/html-comment-content-spacing": [
1226
+ "error",
1227
+ "always",
1228
+ { exceptions: ["-"] }
1229
+ ],
1230
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1231
+ "vue/no-useless-v-bind": ["error", { ignoreIncludesComment: true }],
1232
+ "vue/no-unused-refs": "error",
1233
+ "vue/no-v-text-v-html-on-component": "error",
1234
+ "vue/padding-line-between-blocks": ["error", "always"],
1235
+ "vue/prefer-separate-static-class": "error",
1236
+ // extensions
1237
+ "vue/dot-location": ["error", "property"],
1238
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1239
+ "vue/eqeqeq": ["error", "smart"],
1240
+ "vue/no-constant-condition": "error",
1241
+ "vue/no-empty-pattern": "error",
1242
+ "vue/no-irregular-whitespace": "error",
1243
+ "vue/no-loss-of-precision": "error",
1244
+ "vue/no-restricted-syntax": [
1245
+ "error",
1246
+ "DebuggerStatement",
1247
+ "LabeledStatement",
1248
+ "WithStatement"
1249
+ ],
1250
+ "vue/no-sparse-arrays": "error",
1251
+ "vue/object-curly-newline": [
1252
+ "error",
1253
+ { multiline: true, consistent: true }
1254
+ ],
1255
+ "vue/object-property-newline": [
1256
+ "error",
1257
+ { allowMultiplePropertiesPerLine: true }
1258
+ ],
1259
+ "vue/object-shorthand": [
1260
+ "error",
1261
+ "always",
1262
+ { ignoreConstructors: false, avoidQuotes: true }
1263
+ ],
1264
+ "vue/prefer-template": "error",
1265
+ "vue/quote-props": ["error", "consistent-as-needed"],
1266
+ "vue/block-lang": [
1267
+ "error",
1268
+ {
1269
+ script: {
1270
+ lang: ["js", "ts"]
1271
+ },
1272
+ template: {
1273
+ lang: ["html", "jade", "pug", "ejs"]
1274
+ },
1275
+ style: {
1276
+ lang: ["css", "sass", "scss", "less", "stylus", "postcss"]
1277
+ }
1278
+ }
1279
+ ],
1280
+ "vue/require-macro-variable-name": [
1281
+ "error",
1282
+ {
1283
+ defineProps: "props",
1284
+ defineEmits: "emit",
1285
+ defineSlots: "slots",
1286
+ useSlots: "slots",
1287
+ useAttrs: "attrs"
1288
+ }
1289
+ ],
1290
+ "vue/require-typed-ref": "error",
1291
+ "vue/no-static-inline-styles": ["error", { allowBinding: true }],
1292
+ "vue/no-console": [
1293
+ "error",
1294
+ { allow: ["error", "warn", "table", "time"] }
1295
+ ],
1296
+ "vue/camelcase": "error",
1297
+ "vue/v-for-delimiter-style": ["error", "in"],
1298
+ "vue/attributes-order": [
1299
+ "error",
1300
+ {
1301
+ order: [
1302
+ "DEFINITION",
1303
+ "LIST_RENDERING",
1304
+ "CONDITIONALS",
1305
+ "RENDER_MODIFIERS",
1306
+ "TWO_WAY_BINDING",
1307
+ "OTHER_DIRECTIVES",
1308
+ ["UNIQUE", "SLOT"],
1309
+ "GLOBAL",
1310
+ "OTHER_ATTR",
1311
+ "EVENTS",
1312
+ "CONTENT"
1313
+ ],
1314
+ alphabetical: true
1315
+ }
1316
+ ],
1317
+ "vue/prefer-true-attribute-shorthand": "error",
1318
+ "vue/prefer-define-options": "error",
1319
+ "vue/html-comment-content-newline": [
1320
+ "error",
1321
+ { singleline: "ignore", multiline: "always" }
1322
+ ],
1323
+ "vue/html-comment-indent": ["error", "tab"],
1324
+ "vue/html-self-closing": [
1325
+ "error",
1326
+ {
1327
+ html: {
1328
+ void: "always",
1329
+ normal: "always",
1330
+ component: "always"
1331
+ },
1332
+ svg: "always",
1333
+ math: "always"
1334
+ }
1335
+ ],
1336
+ "vue/no-useless-concat": "error",
1337
+ // off
1338
+ "vue/no-multiple-template-root": "off",
1339
+ "vue/multiline-html-element-content-newline": "off",
1340
+ "vue/singleline-html-element-content-newline": "off",
1341
+ "vue/no-extra-parens": "off",
1342
+ "vue/array-bracket-spacing": "off",
1343
+ "vue/arrow-spacing": "off",
1344
+ "vue/block-spacing": "off",
1345
+ "vue/brace-style": "off",
1346
+ "vue/comma-dangle": "off",
1347
+ "vue/comma-spacing": "off",
1348
+ "vue/comma-style": "off",
1349
+ "vue/operator-linebreak": "off",
1350
+ "vue/template-curly-spacing": "off",
1351
+ "vue/key-spacing": "off",
1352
+ "vue/keyword-spacing": "off",
1353
+ "vue/html-quotes": "off",
1354
+ "vue/html-indent": "off",
1355
+ "vue/no-multi-spaces": "off",
1356
+ "vue/max-attributes-per-line": "off",
1357
+ "vue/html-closing-bracket-spacing": "off",
1358
+ ...overrides
1359
+ }
1360
+ }
1361
+ ];
1362
+
1363
+ const yaml = ({
1364
+ overrides
1365
+ } = {}) => [
1366
+ {
1367
+ plugins: {
1368
+ yaml: pluginYaml__default["default"]
1369
+ },
1370
+ languageOptions: {
1371
+ parser: parserYaml__default["default"]
1372
+ },
1373
+ files: [GLOB_YAML],
1374
+ rules: {
1375
+ ...renameRules(pluginYaml__default["default"].configs.prettier.rules, "yml/", "yaml/"),
1376
+ ...renameRules(pluginYaml__default["default"].configs.recommended.rules, "yml/", "yaml/"),
1377
+ "yaml/no-empty-document": "off",
1378
+ "spaced-comment": "off",
1379
+ ...overrides
1380
+ }
1381
+ }
1382
+ ];
1383
+
1384
+ const flatConfigProps = [
1385
+ "files",
1386
+ "ignores",
1387
+ "languageOptions",
1388
+ "linterOptions",
1389
+ "processor",
1390
+ "plugins",
1391
+ "rules",
1392
+ "settings"
1393
+ ];
1394
+ const VuePackages = ["vue", "nuxt", "vitepress", "@slidev/cli"];
1395
+ function so1ve(options = {}, ...userConfigs) {
1396
+ var _a, _b, _c, _d, _e;
1397
+ const {
1398
+ vue: enableVue = VuePackages.some((i) => localPkg.isPackageExists(i)),
1399
+ solid: enableSolid = localPkg.isPackageExists("solid-js"),
1400
+ typescript: enableTypeScript = localPkg.isPackageExists("typescript"),
1401
+ gitignore: enableGitignore = true,
1402
+ overrides = {}
1403
+ } = options;
1404
+ const configs = [];
1405
+ if (enableGitignore) {
1406
+ if (typeof enableGitignore === "boolean") {
1407
+ if (fs__default["default"].existsSync(".gitignore")) {
1408
+ configs.push([gitignore__default["default"]()]);
1409
+ }
1410
+ } else {
1411
+ configs.push([gitignore__default["default"](enableGitignore)]);
1412
+ }
1413
+ }
1414
+ configs.push(
1415
+ ignores(),
1416
+ javascript({
1417
+ // overrides: overrides.javascript,
1418
+ }),
1419
+ comments(),
1420
+ node(),
1421
+ onlyError(),
1422
+ promise(),
1423
+ // jsdoc(),
1424
+ sortImports(),
1425
+ imports(),
1426
+ jsdoc(),
1427
+ unicorn()
1428
+ );
1429
+ const componentExts = [];
1430
+ if (enableVue) {
1431
+ componentExts.push("vue");
1432
+ }
1433
+ if (enableTypeScript) {
1434
+ configs.push(
1435
+ typescript({
1436
+ // componentExts,
1437
+ // overrides: overrides.typescript,
1438
+ })
1439
+ );
1440
+ if (typeof enableTypeScript !== "boolean") {
1441
+ configs.push(
1442
+ typescriptWithTypes({
1443
+ ...enableTypeScript,
1444
+ componentExts,
1445
+ overrides: overrides.typescriptWithTypes
1446
+ })
1447
+ );
1448
+ }
1449
+ }
1450
+ if ((_a = options.test) != null ? _a : true) {
1451
+ configs.push(
1452
+ test({
1453
+ overrides: overrides.test
1454
+ })
1455
+ );
1456
+ }
1457
+ if (enableVue) {
1458
+ configs.push(
1459
+ vue({
1460
+ overrides: overrides.vue,
1461
+ typescript: !!enableTypeScript
1462
+ })
1463
+ );
1464
+ }
1465
+ if (enableSolid) {
1466
+ configs.push(
1467
+ solid({
1468
+ overrides: overrides.solid,
1469
+ typescript: !!enableTypeScript
1470
+ })
1471
+ );
1472
+ }
1473
+ if ((_b = options.jsonc) != null ? _b : true) {
1474
+ configs.push(jsonc());
1475
+ }
1476
+ if ((_c = options.toml) != null ? _c : true) {
1477
+ configs.push(
1478
+ toml({
1479
+ overrides: overrides.toml
1480
+ })
1481
+ );
1482
+ }
1483
+ if ((_d = options.yaml) != null ? _d : true) {
1484
+ configs.push(
1485
+ yaml({
1486
+ overrides: overrides.yaml
1487
+ })
1488
+ );
1489
+ }
1490
+ if ((_e = options.mdx) != null ? _e : true) {
1491
+ configs.push(
1492
+ mdx({
1493
+ componentExts,
1494
+ overrides: overrides.mdx
1495
+ })
1496
+ );
1497
+ }
1498
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
1499
+ if (key in options) {
1500
+ acc[key] = options[key];
1501
+ }
1502
+ return acc;
1503
+ }, {});
1504
+ if (Object.keys(fusedConfig).length > 0) {
1505
+ configs.push([fusedConfig]);
1506
+ }
1507
+ const merged = combine(...configs, ...userConfigs);
1508
+ return merged;
1509
+ }
1510
+
1511
+ Object.defineProperty(exports, 'pluginComments', {
1512
+ enumerable: true,
1513
+ get: function () { return pluginComments__default["default"]; }
1514
+ });
1515
+ Object.defineProperty(exports, 'pluginHtml', {
1516
+ enumerable: true,
1517
+ get: function () { return pluginHtml__default["default"]; }
1518
+ });
1519
+ Object.defineProperty(exports, 'parserHtml', {
1520
+ enumerable: true,
1521
+ get: function () { return parserHtml__default["default"]; }
1522
+ });
1523
+ Object.defineProperty(exports, 'pluginSo1ve', {
1524
+ enumerable: true,
1525
+ get: function () { return pluginSo1ve__default["default"]; }
1526
+ });
1527
+ Object.defineProperty(exports, 'pluginSortImports', {
1528
+ enumerable: true,
1529
+ get: function () { return pluginSortImports__default["default"]; }
1530
+ });
1531
+ Object.defineProperty(exports, 'pluginTs', {
1532
+ enumerable: true,
1533
+ get: function () { return pluginTs__default["default"]; }
1534
+ });
1535
+ Object.defineProperty(exports, 'parserTs', {
1536
+ enumerable: true,
1537
+ get: function () { return parserTs__default["default"]; }
1538
+ });
1539
+ Object.defineProperty(exports, 'parserMdx', {
1540
+ enumerable: true,
1541
+ get: function () { return parserMdx__default["default"]; }
1542
+ });
1543
+ Object.defineProperty(exports, 'pluginArrayFunc', {
1544
+ enumerable: true,
1545
+ get: function () { return pluginArrayFunc__default["default"]; }
1546
+ });
1547
+ Object.defineProperty(exports, 'pluginEtc', {
1548
+ enumerable: true,
1549
+ get: function () { return pluginEtc__default["default"]; }
1550
+ });
1551
+ Object.defineProperty(exports, 'pluginHtmlJsSupport', {
1552
+ enumerable: true,
1553
+ get: function () { return pluginHtmlJsSupport__default["default"]; }
1554
+ });
1555
+ Object.defineProperty(exports, 'pluginImport', {
1556
+ enumerable: true,
1557
+ get: function () { return pluginImport__default["default"]; }
1558
+ });
1559
+ Object.defineProperty(exports, 'pluginJestFormatting', {
1560
+ enumerable: true,
1561
+ get: function () { return pluginJestFormatting__default["default"]; }
1562
+ });
1563
+ Object.defineProperty(exports, 'pluginJsdoc', {
1564
+ enumerable: true,
1565
+ get: function () { return pluginJsdoc__default["default"]; }
1566
+ });
1567
+ Object.defineProperty(exports, 'pluginJsonSchemaValidator', {
1568
+ enumerable: true,
1569
+ get: function () { return pluginJsonSchemaValidator__default["default"]; }
1570
+ });
1571
+ Object.defineProperty(exports, 'pluginJsonc', {
1572
+ enumerable: true,
1573
+ get: function () { return pluginJsonc__default["default"]; }
1574
+ });
1575
+ Object.defineProperty(exports, 'pluginMdx', {
1576
+ enumerable: true,
1577
+ get: function () { return pluginMdx__default["default"]; }
1578
+ });
1579
+ Object.defineProperty(exports, 'pluginNode', {
1580
+ enumerable: true,
1581
+ get: function () { return pluginNode__default["default"]; }
1582
+ });
1583
+ Object.defineProperty(exports, 'pluginNoOnlyTests', {
1584
+ enumerable: true,
1585
+ get: function () { return pluginNoOnlyTests__default["default"]; }
1586
+ });
1587
+ Object.defineProperty(exports, 'pluginOnlyError', {
1588
+ enumerable: true,
1589
+ get: function () { return pluginOnlyError__default["default"]; }
1590
+ });
1591
+ Object.defineProperty(exports, 'pluginPromise', {
1592
+ enumerable: true,
1593
+ get: function () { return pluginPromise__default["default"]; }
1594
+ });
1595
+ Object.defineProperty(exports, 'pluginRegexp', {
1596
+ enumerable: true,
1597
+ get: function () { return pluginRegexp__default["default"]; }
1598
+ });
1599
+ Object.defineProperty(exports, 'pluginSolid', {
1600
+ enumerable: true,
1601
+ get: function () { return pluginSolid__default["default"]; }
1602
+ });
1603
+ Object.defineProperty(exports, 'pluginToml', {
1604
+ enumerable: true,
1605
+ get: function () { return pluginToml__default["default"]; }
1606
+ });
1607
+ Object.defineProperty(exports, 'pluginUnicorn', {
1608
+ enumerable: true,
1609
+ get: function () { return pluginUnicorn__default["default"]; }
1610
+ });
1611
+ Object.defineProperty(exports, 'pluginUnusedImports', {
1612
+ enumerable: true,
1613
+ get: function () { return pluginUnusedImports__default["default"]; }
1614
+ });
1615
+ Object.defineProperty(exports, 'pluginVitest', {
1616
+ enumerable: true,
1617
+ get: function () { return pluginVitest__default["default"]; }
1618
+ });
1619
+ Object.defineProperty(exports, 'pluginVue', {
1620
+ enumerable: true,
1621
+ get: function () { return pluginVue__default["default"]; }
1622
+ });
1623
+ Object.defineProperty(exports, 'pluginYaml', {
1624
+ enumerable: true,
1625
+ get: function () { return pluginYaml__default["default"]; }
1626
+ });
1627
+ Object.defineProperty(exports, 'parserJsonc', {
1628
+ enumerable: true,
1629
+ get: function () { return parserJsonc__default["default"]; }
1630
+ });
1631
+ Object.defineProperty(exports, 'parserToml', {
1632
+ enumerable: true,
1633
+ get: function () { return parserToml__default["default"]; }
1634
+ });
1635
+ Object.defineProperty(exports, 'parserVue', {
1636
+ enumerable: true,
1637
+ get: function () { return parserVue__default["default"]; }
1638
+ });
1639
+ Object.defineProperty(exports, 'parserYaml', {
1640
+ enumerable: true,
1641
+ get: function () { return parserYaml__default["default"]; }
1642
+ });
1643
+ exports.GLOB_ALL_SRC = GLOB_ALL_SRC;
1644
+ exports.GLOB_CSS = GLOB_CSS;
1645
+ exports.GLOB_DTS = GLOB_DTS;
1646
+ exports.GLOB_ESLINTRC = GLOB_ESLINTRC;
1647
+ exports.GLOB_EXCLUDE = GLOB_EXCLUDE;
1648
+ exports.GLOB_HTML = GLOB_HTML;
1649
+ exports.GLOB_JS = GLOB_JS;
1650
+ exports.GLOB_JSON = GLOB_JSON;
1651
+ exports.GLOB_JSON5 = GLOB_JSON5;
1652
+ exports.GLOB_JSONC = GLOB_JSONC;
1653
+ exports.GLOB_JSX = GLOB_JSX;
1654
+ exports.GLOB_LESS = GLOB_LESS;
1655
+ exports.GLOB_MARKDOWN = GLOB_MARKDOWN;
1656
+ exports.GLOB_MARKDOWN_CODE = GLOB_MARKDOWN_CODE;
1657
+ exports.GLOB_PACKAGEJSON = GLOB_PACKAGEJSON;
1658
+ exports.GLOB_SCSS = GLOB_SCSS;
1659
+ exports.GLOB_SRC = GLOB_SRC;
1660
+ exports.GLOB_SRC_EXT = GLOB_SRC_EXT;
1661
+ exports.GLOB_STYLE = GLOB_STYLE;
1662
+ exports.GLOB_TESTS = GLOB_TESTS;
1663
+ exports.GLOB_TOML = GLOB_TOML;
1664
+ exports.GLOB_TS = GLOB_TS;
1665
+ exports.GLOB_TSX = GLOB_TSX;
1666
+ exports.GLOB_VUE = GLOB_VUE;
1667
+ exports.GLOB_YAML = GLOB_YAML;
1668
+ exports.combine = combine;
1669
+ exports.comments = comments;
1670
+ exports.html = html;
1671
+ exports.ignores = ignores;
1672
+ exports.imports = imports;
1673
+ exports.javascript = javascript;
1674
+ exports.jsdoc = jsdoc;
1675
+ exports.jsonc = jsonc;
1676
+ exports.mdx = mdx;
1677
+ exports.node = node;
1678
+ exports.onlyError = onlyError;
1679
+ exports.promise = promise;
1680
+ exports.recordRulesState = recordRulesState;
1681
+ exports.recordRulesStateConfigs = recordRulesStateConfigs;
1682
+ exports.renameRules = renameRules;
1683
+ exports.so1ve = so1ve;
1684
+ exports.solid = solid;
1685
+ exports.sortImports = sortImports;
1686
+ exports.test = test;
1687
+ exports.toml = toml;
1688
+ exports.typescript = typescript;
1689
+ exports.typescriptWithTypes = typescriptWithTypes;
1690
+ exports.unicorn = unicorn;
1691
+ exports.vue = vue;
1692
+ exports.warnUnnecessaryOffRules = warnUnnecessaryOffRules;
1693
+ exports.yaml = yaml;