@so1ve/eslint-config 1.0.0-alpha.1 → 1.0.0-alpha.3

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,1675 @@
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 eslintMdx = 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 eslintMdx__default = /*#__PURE__*/_interopDefaultLegacy(eslintMdx);
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,mdx}";
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/require-param-name": "error",
599
+ "jsdoc/require-property": "error",
600
+ "jsdoc/require-property-description": "error",
601
+ "jsdoc/require-property-name": "error",
602
+ "jsdoc/require-returns-check": "error",
603
+ "jsdoc/require-returns-description": "error",
604
+ "jsdoc/require-yields-check": "error",
605
+ "jsdoc/valid-types": "error"
606
+ }
607
+ }
608
+ ];
609
+
610
+ const jsonc = () => [
611
+ {
612
+ plugins: {
613
+ jsonc: pluginJsonc__default["default"]
614
+ }
615
+ },
616
+ {
617
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_ESLINTRC],
618
+ languageOptions: {
619
+ parser: parserJsonc__default["default"]
620
+ },
621
+ rules: {
622
+ ...pluginJsonc__default["default"].configs.base.overrides[0].rules,
623
+ ...pluginJsonc__default["default"].configs["recommended-with-jsonc"].rules,
624
+ "jsonc/no-octal-escape": "error",
625
+ "jsonc/quotes": "off",
626
+ "jsonc/quotes-props": "off"
627
+ }
628
+ },
629
+ {
630
+ files: [GLOB_PACKAGEJSON],
631
+ rules: {
632
+ "jsonc/sort-keys": [
633
+ "error",
634
+ {
635
+ pathPattern: "^exports$",
636
+ order: { type: "asc" }
637
+ },
638
+ {
639
+ pathPattern: "^exports.*$",
640
+ order: ["types", "require", "import", "default"]
641
+ }
642
+ ]
643
+ }
644
+ }
645
+ ];
646
+
647
+ const mdx = ({
648
+ componentExts = [],
649
+ overrides
650
+ } = {}) => [
651
+ {
652
+ ...pluginMdx__default["default"].flat,
653
+ processor: pluginMdx__default["default"].createRemarkProcessor({
654
+ lintCodeBlocks: true,
655
+ languageMapper: {}
656
+ })
657
+ },
658
+ {
659
+ ...pluginMdx__default["default"].flatCodeBlocks,
660
+ files: [
661
+ ...pluginMdx__default["default"].flatCodeBlocks.files,
662
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/*.${ext}`)
663
+ ],
664
+ rules: {
665
+ ...pluginMdx__default["default"].flatCodeBlocks.rules,
666
+ "html/require-doctype": "off",
667
+ "ts/no-redeclare": "off",
668
+ "ts/no-unused-vars": "off",
669
+ "ts/no-use-before-define": "off",
670
+ "ts/no-var-requires": "off",
671
+ "ts/consistent-type-imports": "off",
672
+ "ts/no-namespace": "off",
673
+ "ts/no-require-imports": "off",
674
+ "import/no-unresolved": "off",
675
+ "unused-imports/no-unused-imports": "off",
676
+ "unused-imports/no-unused-vars": "off",
677
+ "no-alert": "off",
678
+ "no-console": "off",
679
+ "no-restricted-imports": "off",
680
+ "no-undef": "off",
681
+ "no-unused-expressions": "off",
682
+ ...overrides
683
+ }
684
+ }
685
+ ];
686
+
687
+ const node = () => [
688
+ {
689
+ plugins: {
690
+ node: pluginNode__default["default"]
691
+ }
692
+ },
693
+ {
694
+ rules: {
695
+ "node/no-callback-literal": "off",
696
+ "node/handle-callback-err": ["error", "^(err|error)$"],
697
+ "node/no-deprecated-api": "error",
698
+ "node/no-exports-assign": "error",
699
+ "node/no-new-require": "error",
700
+ "node/no-path-concat": "error",
701
+ "node/process-exit-as-throw": "error"
702
+ }
703
+ }
704
+ ];
705
+
706
+ const onlyError = () => [
707
+ {
708
+ plugins: {
709
+ "only-error": pluginOnlyError__default["default"]
710
+ }
711
+ }
712
+ ];
713
+
714
+ const promise = () => [
715
+ {
716
+ plugins: {
717
+ promise: pluginPromise__default["default"]
718
+ }
719
+ },
720
+ {
721
+ rules: {
722
+ "promise/param-names": "error"
723
+ }
724
+ }
725
+ ];
726
+
727
+ const solid = ({
728
+ overrides,
729
+ typescript
730
+ } = {}) => [
731
+ {
732
+ plugins: {
733
+ solid: pluginSolid__default["default"]
734
+ }
735
+ },
736
+ {
737
+ languageOptions: {
738
+ sourceType: "module",
739
+ parserOptions: {
740
+ ecmaFeatures: {
741
+ jsx: true
742
+ }
743
+ }
744
+ },
745
+ rules: {
746
+ ...pluginSolid__default["default"].configs.recommended.rules,
747
+ ...typescript ? pluginSolid__default["default"].configs.typescript.rules : {},
748
+ ...overrides
749
+ }
750
+ }
751
+ ];
752
+
753
+ const sortImports = () => [
754
+ {
755
+ plugins: {
756
+ "sort-imports": pluginSortImports__default["default"]
757
+ }
758
+ },
759
+ {
760
+ rules: {
761
+ "sort-imports/imports": "error",
762
+ "sort-imports/exports": "error"
763
+ }
764
+ }
765
+ ];
766
+
767
+ const test = ({
768
+ overrides
769
+ } = {}) => [
770
+ {
771
+ plugins: {
772
+ "no-only-tests": pluginNoOnlyTests__default["default"],
773
+ "vitest": pluginVitest__default["default"],
774
+ "jest-formatting": pluginJestFormatting__default["default"]
775
+ }
776
+ },
777
+ {
778
+ files: GLOB_TESTS,
779
+ rules: {
780
+ ...pluginVitest__default["default"].configs.recommended.rules,
781
+ "no-only-tests/no-only-tests": "error",
782
+ "vitest/expect-expect": "off",
783
+ "vitest/valid-describe-callback": "off",
784
+ "vitest/no-alias-methods": "error",
785
+ "vitest/no-interpolation-in-snapshots": "error",
786
+ "vitest/no-test-prefixes": "error",
787
+ "vitest/prefer-expect-resolves": "error",
788
+ "vitest/prefer-comparison-matcher": "error",
789
+ "vitest/prefer-mock-promise-shorthand": "error",
790
+ "vitest/prefer-spy-on": "error",
791
+ "vitest/prefer-to-be-falsy": "error",
792
+ "vitest/prefer-to-be-object": "error",
793
+ "vitest/prefer-to-be-truthy": "error",
794
+ "vitest/prefer-to-contain": "error",
795
+ "vitest/prefer-to-have-length": "error",
796
+ "vitest/prefer-todo": "error",
797
+ "vitest/valid-title": ["error", { allowArguments: true }],
798
+ "jest-formatting/padding-around-all": "error",
799
+ ...overrides
800
+ }
801
+ }
802
+ ];
803
+
804
+ const toml = ({
805
+ overrides
806
+ } = {}) => [
807
+ {
808
+ plugins: {
809
+ toml: pluginToml__default["default"]
810
+ }
811
+ },
812
+ {
813
+ languageOptions: {
814
+ parser: parserToml__default["default"]
815
+ },
816
+ files: [GLOB_TOML],
817
+ rules: {
818
+ ...pluginToml__default["default"].configs.recommended.rules,
819
+ "no-irregular-whitespace": "off",
820
+ "spaced-comment": "off",
821
+ ...overrides
822
+ }
823
+ }
824
+ ];
825
+
826
+ const combine = (...configs) => configs.flatMap((config) => Array.isArray(config) ? config : [config]);
827
+ const renameRules = (rules, from, to) => Object.fromEntries(
828
+ Object.entries(rules).map(([key, value]) => {
829
+ if (key.startsWith(from)) {
830
+ return [to + key.slice(from.length), value];
831
+ }
832
+ return [key, value];
833
+ })
834
+ );
835
+ const rulesOn = /* @__PURE__ */ new Set();
836
+ const rulesOff = /* @__PURE__ */ new Set();
837
+ function recordRulesStateConfigs(configs) {
838
+ var _a;
839
+ for (const config of configs) {
840
+ recordRulesState((_a = config.rules) != null ? _a : {});
841
+ }
842
+ return configs;
843
+ }
844
+ function recordRulesState(rules) {
845
+ for (const [key, value] of Object.entries(rules != null ? rules : {})) {
846
+ const firstValue = Array.isArray(value) ? value[0] : value;
847
+ if (firstValue == null) {
848
+ continue;
849
+ }
850
+ if (firstValue === "off" || firstValue === 0) {
851
+ rulesOff.add(key);
852
+ } else {
853
+ rulesOn.add(key);
854
+ }
855
+ }
856
+ return rules;
857
+ }
858
+ function warnUnnecessaryOffRules() {
859
+ const unnecessaryOffRules = [...rulesOff].filter((key) => !rulesOn.has(key));
860
+ for (const off of unnecessaryOffRules) {
861
+ console.warn(
862
+ `[eslint] rule \`${off}\` is never turned on, you can remove the rule from your config`
863
+ );
864
+ }
865
+ }
866
+
867
+ const typescript = ({
868
+ componentExts = [],
869
+ overrides
870
+ } = {}) => [
871
+ {
872
+ // Install the plugins without globs, so they can be configured separately.
873
+ plugins: {
874
+ import: pluginImport__default["default"],
875
+ ts: pluginTs__default["default"]
876
+ }
877
+ },
878
+ {
879
+ files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
880
+ languageOptions: {
881
+ parser: parserTs__default["default"],
882
+ parserOptions: {
883
+ sourceType: "module"
884
+ }
885
+ },
886
+ settings: {
887
+ "import/resolver": {
888
+ node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] },
889
+ typescript: {
890
+ extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"]
891
+ }
892
+ }
893
+ },
894
+ rules: {
895
+ ...renameRules(
896
+ pluginTs__default["default"].configs["eslint-recommended"].overrides[0].rules,
897
+ "@typescript-eslint/",
898
+ "ts/"
899
+ ),
900
+ ...renameRules(
901
+ pluginTs__default["default"].configs.recommended.rules,
902
+ "@typescript-eslint/",
903
+ "ts/"
904
+ ),
905
+ "import/named": "off",
906
+ // TS
907
+ "ts/comma-dangle": "off",
908
+ "ts/brace-style": "off",
909
+ "ts/comma-spacing": "off",
910
+ "ts/func-call-spacing": "off",
911
+ "ts/indent": "off",
912
+ "ts/keyword-spacing": "off",
913
+ "ts/member-delimiter-style": "off",
914
+ "ts/no-extra-parens": "off",
915
+ "ts/no-extra-semi": "off",
916
+ "ts/quotes": "off",
917
+ "ts/semi": "off",
918
+ "ts/space-before-function-paren": "off",
919
+ "ts/type-annotation-spacing": "off",
920
+ "ts/ban-ts-comment": [
921
+ "error",
922
+ {
923
+ minimumDescriptionLength: 0
924
+ }
925
+ ],
926
+ "ts/ban-types": [
927
+ "error",
928
+ {
929
+ extendDefaults: false,
930
+ types: {
931
+ String: {
932
+ message: "Use `string` instead.",
933
+ fixWith: "string"
934
+ },
935
+ Number: {
936
+ message: "Use `number` instead.",
937
+ fixWith: "number"
938
+ },
939
+ Boolean: {
940
+ message: "Use `boolean` instead.",
941
+ fixWith: "boolean"
942
+ },
943
+ Symbol: {
944
+ message: "Use `symbol` instead.",
945
+ fixWith: "symbol"
946
+ },
947
+ BigInt: {
948
+ message: "Use `bigint` instead.",
949
+ fixWith: "bigint"
950
+ },
951
+ Object: {
952
+ 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",
953
+ fixWith: "Record<PropertyKey, unknown>"
954
+ },
955
+ object: {
956
+ message: "The `object` type is hard to use. Use `Record<PropertyKey, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
957
+ fixWith: "Record<PropertyKey, unknown>"
958
+ },
959
+ Function: {
960
+ message: "Use `(...args: any[]) => any` instead.",
961
+ fixWith: "(...args: any[]) => any"
962
+ }
963
+ }
964
+ }
965
+ ],
966
+ "ts/consistent-type-imports": [
967
+ "error",
968
+ { prefer: "type-imports", disallowTypeAnnotations: false }
969
+ ],
970
+ "ts/consistent-type-definitions": ["error", "interface"],
971
+ "ts/consistent-indexed-object-style": ["error", "record"],
972
+ "ts/prefer-ts-expect-error": "error",
973
+ "ts/no-require-imports": "error",
974
+ "ts/method-signature-style": ["error", "property"],
975
+ // Override JS
976
+ "no-useless-constructor": "off",
977
+ "no-invalid-this": "off",
978
+ "ts/no-invalid-this": "error",
979
+ "no-redeclare": "off",
980
+ "ts/no-redeclare": "error",
981
+ "no-use-before-define": "off",
982
+ "ts/no-use-before-define": [
983
+ "error",
984
+ { functions: false, classes: false, variables: true }
985
+ ],
986
+ "object-curly-spacing": "off",
987
+ "space-before-blocks": "off",
988
+ "ts/space-before-blocks": "off",
989
+ "space-before-function-paren": "off",
990
+ "no-dupe-class-members": "off",
991
+ "ts/no-dupe-class-members": "error",
992
+ "no-loss-of-precision": "off",
993
+ "ts/no-loss-of-precision": "error",
994
+ "lines-between-class-members": "off",
995
+ "ts/lines-between-class-members": [
996
+ "error",
997
+ "always",
998
+ { exceptAfterSingleLine: true }
999
+ ],
1000
+ // so1ve
1001
+ "so1ve/no-inline-type-import": "error",
1002
+ // off
1003
+ "ts/camelcase": "off",
1004
+ "ts/explicit-function-return-type": "off",
1005
+ "ts/explicit-member-accessibility": "off",
1006
+ "ts/no-explicit-any": "off",
1007
+ "ts/no-parameter-properties": "off",
1008
+ "ts/no-empty-interface": "off",
1009
+ "ts/ban-ts-ignore": "off",
1010
+ "ts/no-empty-function": "off",
1011
+ "ts/no-non-null-assertion": "off",
1012
+ "ts/explicit-module-boundary-types": "off",
1013
+ "ts/triple-slash-reference": "off",
1014
+ "ts/prefer-for-of": "error",
1015
+ "ts/no-duplicate-enum-values": "error",
1016
+ "ts/no-non-null-asserted-nullish-coalescing": "error",
1017
+ // handled by unused-imports/no-unused-imports
1018
+ "ts/no-unused-vars": "off",
1019
+ ...overrides
1020
+ }
1021
+ },
1022
+ {
1023
+ files: ["**/*.d.ts"],
1024
+ rules: {
1025
+ "eslint-comments/no-unlimited-disable": "off",
1026
+ "import/no-duplicates": "off",
1027
+ "unused-imports/no-unused-vars": "off"
1028
+ }
1029
+ },
1030
+ {
1031
+ files: ["**/*.js", "**/*.cjs"],
1032
+ rules: {
1033
+ "ts/no-require-imports": "off",
1034
+ "ts/no-var-requires": "off"
1035
+ }
1036
+ }
1037
+ ];
1038
+ const typescriptWithTypes = ({
1039
+ componentExts = [],
1040
+ tsconfigPath,
1041
+ tsconfigRootDir = process.cwd(),
1042
+ overrides = {}
1043
+ }) => [
1044
+ {
1045
+ files: [
1046
+ GLOB_TS,
1047
+ GLOB_TSX,
1048
+ ...componentExts.map((ext) => `**/*.${ext}`),
1049
+ `!${GLOB_MARKDOWN}/*.*`
1050
+ ],
1051
+ plugins: {
1052
+ etc: pluginEtc__default["default"]
1053
+ },
1054
+ languageOptions: {
1055
+ parser: parserTs__default["default"],
1056
+ parserOptions: {
1057
+ project: [tsconfigPath],
1058
+ tsconfigRootDir,
1059
+ EXPERIMENTAL_useProjectService: true
1060
+ }
1061
+ },
1062
+ rules: {
1063
+ "etc/no-assign-mutated-array": "error",
1064
+ "etc/no-deprecated": "warn",
1065
+ "etc/no-internal": "error",
1066
+ "no-throw-literal": "off",
1067
+ "ts/no-throw-literal": "error",
1068
+ "no-implied-eval": "off",
1069
+ "ts/no-implied-eval": "error",
1070
+ "dot-notation": "off",
1071
+ "ts/dot-notation": ["error", { allowKeywords: true }],
1072
+ "no-void": ["error", { allowAsStatement: true }],
1073
+ "ts/await-thenable": "error",
1074
+ "ts/no-for-in-array": "error",
1075
+ "ts/no-unnecessary-type-assertion": "error",
1076
+ "ts/restrict-template-expressions": [
1077
+ "error",
1078
+ {
1079
+ allowAny: true,
1080
+ allowNumber: true,
1081
+ allowBoolean: true
1082
+ }
1083
+ ],
1084
+ "ts/array-type": ["error", { default: "array", readonly: "array" }],
1085
+ "ts/consistent-generic-constructors": "error",
1086
+ "ts/consistent-type-exports": "error",
1087
+ "ts/consistent-type-assertions": [
1088
+ "error",
1089
+ { assertionStyle: "as", objectLiteralTypeAssertions: "allow" }
1090
+ ],
1091
+ "ts/prefer-nullish-coalescing": "error",
1092
+ "ts/prefer-optional-chain": "error",
1093
+ "ts/prefer-return-this-type": "error",
1094
+ "ts/no-unnecessary-type-arguments": "error",
1095
+ "ts/non-nullable-type-assertion-style": "error",
1096
+ ...overrides
1097
+ }
1098
+ }
1099
+ ];
1100
+
1101
+ const unicorn = () => [
1102
+ {
1103
+ plugins: {
1104
+ unicorn: pluginUnicorn__default["default"]
1105
+ },
1106
+ rules: {
1107
+ "unicorn/error-message": "error",
1108
+ "unicorn/escape-case": "error",
1109
+ "unicorn/no-instanceof-array": "error",
1110
+ "unicorn/no-new-buffer": "error",
1111
+ "unicorn/no-new-array": "error",
1112
+ "unicorn/no-unsafe-regex": "off",
1113
+ "unicorn/number-literal-case": "error",
1114
+ "unicorn/numeric-separators-style": "error",
1115
+ "unicorn/throw-new-error": "error",
1116
+ "unicorn/no-useless-spread": "error",
1117
+ "unicorn/relative-url-style": ["error", "always"],
1118
+ "unicorn/explicit-length-check": "error",
1119
+ "unicorn/new-for-builtins": "error",
1120
+ "unicorn/no-array-for-each": "error",
1121
+ "unicorn/no-array-method-this-argument": "error",
1122
+ "unicorn/no-for-loop": "error",
1123
+ "unicorn/no-lonely-if": "error",
1124
+ "unicorn/no-negated-condition": "error",
1125
+ "unicorn/switch-case-braces": "error",
1126
+ "unicorn/prefer-ternary": "error",
1127
+ "unicorn/prefer-query-selector": "error",
1128
+ "unicorn/prefer-modern-dom-apis": "error",
1129
+ "unicorn/prefer-modern-math-apis": "error",
1130
+ "unicorn/prefer-json-parse-buffer": "error",
1131
+ "unicorn/prefer-date-now": "error",
1132
+ "unicorn/prefer-array-some": "error",
1133
+ "unicorn/prefer-array-index-of": "error",
1134
+ "unicorn/prefer-array-flat": "error",
1135
+ "unicorn/prefer-array-find": "error",
1136
+ "unicorn/prefer-spread": "error",
1137
+ "unicorn/prefer-set-size": "error",
1138
+ "unicorn/prefer-string-slice": "error",
1139
+ "unicorn/prefer-includes": "error",
1140
+ "unicorn/prefer-string-starts-ends-with": "error",
1141
+ "unicorn/prefer-text-content": "error",
1142
+ "unicorn/prefer-type-error": "error",
1143
+ "unicorn/prefer-node-protocol": "error",
1144
+ "unicorn/prefer-regexp-test": "error",
1145
+ "unicorn/prefer-optional-catch-binding": "error"
1146
+ }
1147
+ }
1148
+ ];
1149
+
1150
+ const vue = ({
1151
+ overrides,
1152
+ typescript
1153
+ } = {}) => [
1154
+ {
1155
+ plugins: {
1156
+ vue: pluginVue__default["default"]
1157
+ }
1158
+ },
1159
+ {
1160
+ files: [GLOB_VUE],
1161
+ languageOptions: {
1162
+ parser: parserVue__default["default"],
1163
+ parserOptions: {
1164
+ ecmaFeatures: {
1165
+ jsx: true
1166
+ },
1167
+ extraFileExtensions: [".vue"],
1168
+ parser: typescript ? parserTs__default["default"] : null,
1169
+ sourceType: "module"
1170
+ }
1171
+ },
1172
+ processor: pluginVue__default["default"].processors[".vue"],
1173
+ rules: {
1174
+ ...pluginVue__default["default"].configs.base.rules,
1175
+ ...pluginVue__default["default"].configs["vue3-essential"].rules,
1176
+ ...pluginVue__default["default"].configs["vue3-strongly-recommended"].rules,
1177
+ ...pluginVue__default["default"].configs["vue3-recommended"].rules,
1178
+ "no-unused-vars": "off",
1179
+ "no-undef": "off",
1180
+ "@typescript-eslint/no-unused-vars": "off",
1181
+ "vue/no-v-html": "off",
1182
+ "vue/require-prop-types": "off",
1183
+ "vue/require-default-prop": "off",
1184
+ "vue/multi-word-component-names": "off",
1185
+ "vue/no-ref-object-reactivity-loss": "error",
1186
+ "vue/no-setup-props-reactivity-loss": "error",
1187
+ "vue/block-order": [
1188
+ "error",
1189
+ {
1190
+ order: ["script", "template", "style"]
1191
+ }
1192
+ ],
1193
+ "vue/component-api-style": ["error", ["script-setup", "composition"]],
1194
+ "vue/component-name-in-template-casing": [
1195
+ "error",
1196
+ "PascalCase",
1197
+ { registeredComponentsOnly: false }
1198
+ ],
1199
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1200
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1201
+ "vue/define-macros-order": [
1202
+ "error",
1203
+ {
1204
+ order: ["defineOptions", "defineEmits", "defineProps", "defineSlots"]
1205
+ }
1206
+ ],
1207
+ "vue/html-comment-content-spacing": [
1208
+ "error",
1209
+ "always",
1210
+ { exceptions: ["-"] }
1211
+ ],
1212
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1213
+ "vue/no-useless-v-bind": ["error", { ignoreIncludesComment: true }],
1214
+ "vue/no-unused-refs": "error",
1215
+ "vue/no-v-text-v-html-on-component": "error",
1216
+ "vue/padding-line-between-blocks": ["error", "always"],
1217
+ "vue/prefer-separate-static-class": "error",
1218
+ // extensions
1219
+ "vue/dot-location": ["error", "property"],
1220
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1221
+ "vue/eqeqeq": ["error", "smart"],
1222
+ "vue/no-constant-condition": "error",
1223
+ "vue/no-empty-pattern": "error",
1224
+ "vue/no-irregular-whitespace": "error",
1225
+ "vue/no-loss-of-precision": "error",
1226
+ "vue/no-restricted-syntax": [
1227
+ "error",
1228
+ "DebuggerStatement",
1229
+ "LabeledStatement",
1230
+ "WithStatement"
1231
+ ],
1232
+ "vue/no-sparse-arrays": "error",
1233
+ "vue/object-curly-newline": [
1234
+ "error",
1235
+ { multiline: true, consistent: true }
1236
+ ],
1237
+ "vue/object-property-newline": [
1238
+ "error",
1239
+ { allowMultiplePropertiesPerLine: true }
1240
+ ],
1241
+ "vue/object-shorthand": [
1242
+ "error",
1243
+ "always",
1244
+ { ignoreConstructors: false, avoidQuotes: true }
1245
+ ],
1246
+ "vue/prefer-template": "error",
1247
+ "vue/quote-props": ["error", "consistent-as-needed"],
1248
+ "vue/block-lang": [
1249
+ "error",
1250
+ {
1251
+ script: {
1252
+ lang: ["js", "ts"]
1253
+ },
1254
+ template: {
1255
+ lang: ["html", "jade", "pug", "ejs"]
1256
+ },
1257
+ style: {
1258
+ lang: ["css", "sass", "scss", "less", "stylus", "postcss"]
1259
+ }
1260
+ }
1261
+ ],
1262
+ "vue/require-macro-variable-name": [
1263
+ "error",
1264
+ {
1265
+ defineProps: "props",
1266
+ defineEmits: "emit",
1267
+ defineSlots: "slots",
1268
+ useSlots: "slots",
1269
+ useAttrs: "attrs"
1270
+ }
1271
+ ],
1272
+ "vue/require-typed-ref": "error",
1273
+ "vue/no-static-inline-styles": ["error", { allowBinding: true }],
1274
+ "vue/no-console": [
1275
+ "error",
1276
+ { allow: ["error", "warn", "table", "time"] }
1277
+ ],
1278
+ "vue/camelcase": "error",
1279
+ "vue/v-for-delimiter-style": ["error", "in"],
1280
+ "vue/attributes-order": [
1281
+ "error",
1282
+ {
1283
+ order: [
1284
+ "DEFINITION",
1285
+ "LIST_RENDERING",
1286
+ "CONDITIONALS",
1287
+ "RENDER_MODIFIERS",
1288
+ "TWO_WAY_BINDING",
1289
+ "OTHER_DIRECTIVES",
1290
+ ["UNIQUE", "SLOT"],
1291
+ "GLOBAL",
1292
+ "OTHER_ATTR",
1293
+ "EVENTS",
1294
+ "CONTENT"
1295
+ ],
1296
+ alphabetical: true
1297
+ }
1298
+ ],
1299
+ "vue/prefer-true-attribute-shorthand": "error",
1300
+ "vue/prefer-define-options": "error",
1301
+ "vue/html-comment-content-newline": [
1302
+ "error",
1303
+ { singleline: "ignore", multiline: "always" }
1304
+ ],
1305
+ "vue/html-comment-indent": ["error", "tab"],
1306
+ "vue/html-self-closing": [
1307
+ "error",
1308
+ {
1309
+ html: {
1310
+ void: "always",
1311
+ normal: "always",
1312
+ component: "always"
1313
+ },
1314
+ svg: "always",
1315
+ math: "always"
1316
+ }
1317
+ ],
1318
+ "vue/no-useless-concat": "error",
1319
+ // off
1320
+ "vue/no-multiple-template-root": "off",
1321
+ "vue/multiline-html-element-content-newline": "off",
1322
+ "vue/singleline-html-element-content-newline": "off",
1323
+ "vue/no-extra-parens": "off",
1324
+ "vue/array-bracket-spacing": "off",
1325
+ "vue/arrow-spacing": "off",
1326
+ "vue/block-spacing": "off",
1327
+ "vue/brace-style": "off",
1328
+ "vue/comma-dangle": "off",
1329
+ "vue/comma-spacing": "off",
1330
+ "vue/comma-style": "off",
1331
+ "vue/operator-linebreak": "off",
1332
+ "vue/template-curly-spacing": "off",
1333
+ "vue/key-spacing": "off",
1334
+ "vue/keyword-spacing": "off",
1335
+ "vue/html-quotes": "off",
1336
+ "vue/html-indent": "off",
1337
+ "vue/no-multi-spaces": "off",
1338
+ "vue/max-attributes-per-line": "off",
1339
+ "vue/html-closing-bracket-spacing": "off",
1340
+ ...overrides
1341
+ }
1342
+ }
1343
+ ];
1344
+
1345
+ const yaml = ({
1346
+ overrides
1347
+ } = {}) => [
1348
+ {
1349
+ plugins: {
1350
+ yaml: pluginYaml__default["default"]
1351
+ },
1352
+ languageOptions: {
1353
+ parser: parserYaml__default["default"]
1354
+ },
1355
+ files: [GLOB_YAML],
1356
+ rules: {
1357
+ ...renameRules(pluginYaml__default["default"].configs.prettier.rules, "yml/", "yaml/"),
1358
+ ...renameRules(pluginYaml__default["default"].configs.recommended.rules, "yml/", "yaml/"),
1359
+ "yaml/no-empty-document": "off",
1360
+ "spaced-comment": "off",
1361
+ ...overrides
1362
+ }
1363
+ }
1364
+ ];
1365
+
1366
+ const flatConfigProps = [
1367
+ "files",
1368
+ "ignores",
1369
+ "languageOptions",
1370
+ "linterOptions",
1371
+ "processor",
1372
+ "plugins",
1373
+ "rules",
1374
+ "settings"
1375
+ ];
1376
+ const VuePackages = ["vue", "nuxt", "vitepress", "@slidev/cli"];
1377
+ function so1ve(options = {}, ...userConfigs) {
1378
+ var _a, _b, _c, _d, _e;
1379
+ const {
1380
+ vue: enableVue = VuePackages.some((i) => localPkg.isPackageExists(i)),
1381
+ solid: enableSolid = localPkg.isPackageExists("solid-js"),
1382
+ typescript: enableTypeScript = localPkg.isPackageExists("typescript"),
1383
+ gitignore: enableGitignore = true,
1384
+ overrides = {}
1385
+ } = options;
1386
+ const configs = [];
1387
+ if (enableGitignore) {
1388
+ if (typeof enableGitignore === "boolean") {
1389
+ if (fs__default["default"].existsSync(".gitignore")) {
1390
+ configs.push([gitignore__default["default"]()]);
1391
+ }
1392
+ } else {
1393
+ configs.push([gitignore__default["default"](enableGitignore)]);
1394
+ }
1395
+ }
1396
+ configs.push(
1397
+ ignores(),
1398
+ javascript({
1399
+ overrides: overrides.javascript
1400
+ }),
1401
+ comments(),
1402
+ node(),
1403
+ onlyError(),
1404
+ promise(),
1405
+ // jsdoc(),
1406
+ sortImports(),
1407
+ imports(),
1408
+ jsdoc(),
1409
+ unicorn()
1410
+ );
1411
+ const componentExts = [];
1412
+ if (enableVue) {
1413
+ componentExts.push("vue");
1414
+ }
1415
+ if (enableTypeScript) {
1416
+ configs.push(
1417
+ typescript({
1418
+ componentExts,
1419
+ overrides: overrides.typescript
1420
+ })
1421
+ );
1422
+ if (typeof enableTypeScript !== "boolean") {
1423
+ configs.push(
1424
+ typescriptWithTypes({
1425
+ ...enableTypeScript,
1426
+ componentExts,
1427
+ overrides: overrides.typescriptWithTypes
1428
+ })
1429
+ );
1430
+ }
1431
+ }
1432
+ if ((_a = options.test) != null ? _a : true) {
1433
+ configs.push(
1434
+ test({
1435
+ overrides: overrides.test
1436
+ })
1437
+ );
1438
+ }
1439
+ if (enableVue) {
1440
+ configs.push(
1441
+ vue({
1442
+ overrides: overrides.vue,
1443
+ typescript: !!enableTypeScript
1444
+ })
1445
+ );
1446
+ }
1447
+ if (enableSolid) {
1448
+ configs.push(
1449
+ solid({
1450
+ overrides: overrides.solid,
1451
+ typescript: !!enableTypeScript
1452
+ })
1453
+ );
1454
+ }
1455
+ if ((_b = options.jsonc) != null ? _b : true) {
1456
+ configs.push(jsonc());
1457
+ }
1458
+ if ((_c = options.toml) != null ? _c : true) {
1459
+ configs.push(
1460
+ toml({
1461
+ overrides: overrides.toml
1462
+ })
1463
+ );
1464
+ }
1465
+ if ((_d = options.yaml) != null ? _d : true) {
1466
+ configs.push(
1467
+ yaml({
1468
+ overrides: overrides.yaml
1469
+ })
1470
+ );
1471
+ }
1472
+ if ((_e = options.mdx) != null ? _e : true) {
1473
+ configs.push(
1474
+ mdx({
1475
+ componentExts,
1476
+ overrides: overrides.mdx
1477
+ })
1478
+ );
1479
+ }
1480
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
1481
+ if (key in options) {
1482
+ acc[key] = options[key];
1483
+ }
1484
+ return acc;
1485
+ }, {});
1486
+ if (Object.keys(fusedConfig).length > 0) {
1487
+ configs.push([fusedConfig]);
1488
+ }
1489
+ const merged = combine(...configs, ...userConfigs);
1490
+ return merged;
1491
+ }
1492
+
1493
+ Object.defineProperty(exports, 'pluginComments', {
1494
+ enumerable: true,
1495
+ get: function () { return pluginComments__default["default"]; }
1496
+ });
1497
+ Object.defineProperty(exports, 'pluginHtml', {
1498
+ enumerable: true,
1499
+ get: function () { return pluginHtml__default["default"]; }
1500
+ });
1501
+ Object.defineProperty(exports, 'parserHtml', {
1502
+ enumerable: true,
1503
+ get: function () { return parserHtml__default["default"]; }
1504
+ });
1505
+ Object.defineProperty(exports, 'pluginSo1ve', {
1506
+ enumerable: true,
1507
+ get: function () { return pluginSo1ve__default["default"]; }
1508
+ });
1509
+ Object.defineProperty(exports, 'pluginSortImports', {
1510
+ enumerable: true,
1511
+ get: function () { return pluginSortImports__default["default"]; }
1512
+ });
1513
+ Object.defineProperty(exports, 'pluginTs', {
1514
+ enumerable: true,
1515
+ get: function () { return pluginTs__default["default"]; }
1516
+ });
1517
+ Object.defineProperty(exports, 'parserTs', {
1518
+ enumerable: true,
1519
+ get: function () { return parserTs__default["default"]; }
1520
+ });
1521
+ Object.defineProperty(exports, 'parserMdx', {
1522
+ enumerable: true,
1523
+ get: function () { return eslintMdx__default["default"]; }
1524
+ });
1525
+ Object.defineProperty(exports, 'pluginArrayFunc', {
1526
+ enumerable: true,
1527
+ get: function () { return pluginArrayFunc__default["default"]; }
1528
+ });
1529
+ Object.defineProperty(exports, 'pluginEtc', {
1530
+ enumerable: true,
1531
+ get: function () { return pluginEtc__default["default"]; }
1532
+ });
1533
+ Object.defineProperty(exports, 'pluginHtmlJsSupport', {
1534
+ enumerable: true,
1535
+ get: function () { return pluginHtmlJsSupport__default["default"]; }
1536
+ });
1537
+ Object.defineProperty(exports, 'pluginImport', {
1538
+ enumerable: true,
1539
+ get: function () { return pluginImport__default["default"]; }
1540
+ });
1541
+ Object.defineProperty(exports, 'pluginJestFormatting', {
1542
+ enumerable: true,
1543
+ get: function () { return pluginJestFormatting__default["default"]; }
1544
+ });
1545
+ Object.defineProperty(exports, 'pluginJsdoc', {
1546
+ enumerable: true,
1547
+ get: function () { return pluginJsdoc__default["default"]; }
1548
+ });
1549
+ Object.defineProperty(exports, 'pluginJsonSchemaValidator', {
1550
+ enumerable: true,
1551
+ get: function () { return pluginJsonSchemaValidator__default["default"]; }
1552
+ });
1553
+ Object.defineProperty(exports, 'pluginJsonc', {
1554
+ enumerable: true,
1555
+ get: function () { return pluginJsonc__default["default"]; }
1556
+ });
1557
+ Object.defineProperty(exports, 'pluginMdx', {
1558
+ enumerable: true,
1559
+ get: function () { return pluginMdx__default["default"]; }
1560
+ });
1561
+ Object.defineProperty(exports, 'pluginNode', {
1562
+ enumerable: true,
1563
+ get: function () { return pluginNode__default["default"]; }
1564
+ });
1565
+ Object.defineProperty(exports, 'pluginNoOnlyTests', {
1566
+ enumerable: true,
1567
+ get: function () { return pluginNoOnlyTests__default["default"]; }
1568
+ });
1569
+ Object.defineProperty(exports, 'pluginOnlyError', {
1570
+ enumerable: true,
1571
+ get: function () { return pluginOnlyError__default["default"]; }
1572
+ });
1573
+ Object.defineProperty(exports, 'pluginPromise', {
1574
+ enumerable: true,
1575
+ get: function () { return pluginPromise__default["default"]; }
1576
+ });
1577
+ Object.defineProperty(exports, 'pluginRegexp', {
1578
+ enumerable: true,
1579
+ get: function () { return pluginRegexp__default["default"]; }
1580
+ });
1581
+ Object.defineProperty(exports, 'pluginSolid', {
1582
+ enumerable: true,
1583
+ get: function () { return pluginSolid__default["default"]; }
1584
+ });
1585
+ Object.defineProperty(exports, 'pluginToml', {
1586
+ enumerable: true,
1587
+ get: function () { return pluginToml__default["default"]; }
1588
+ });
1589
+ Object.defineProperty(exports, 'pluginUnicorn', {
1590
+ enumerable: true,
1591
+ get: function () { return pluginUnicorn__default["default"]; }
1592
+ });
1593
+ Object.defineProperty(exports, 'pluginUnusedImports', {
1594
+ enumerable: true,
1595
+ get: function () { return pluginUnusedImports__default["default"]; }
1596
+ });
1597
+ Object.defineProperty(exports, 'pluginVitest', {
1598
+ enumerable: true,
1599
+ get: function () { return pluginVitest__default["default"]; }
1600
+ });
1601
+ Object.defineProperty(exports, 'pluginVue', {
1602
+ enumerable: true,
1603
+ get: function () { return pluginVue__default["default"]; }
1604
+ });
1605
+ Object.defineProperty(exports, 'pluginYaml', {
1606
+ enumerable: true,
1607
+ get: function () { return pluginYaml__default["default"]; }
1608
+ });
1609
+ Object.defineProperty(exports, 'parserJsonc', {
1610
+ enumerable: true,
1611
+ get: function () { return parserJsonc__default["default"]; }
1612
+ });
1613
+ Object.defineProperty(exports, 'parserToml', {
1614
+ enumerable: true,
1615
+ get: function () { return parserToml__default["default"]; }
1616
+ });
1617
+ Object.defineProperty(exports, 'parserVue', {
1618
+ enumerable: true,
1619
+ get: function () { return parserVue__default["default"]; }
1620
+ });
1621
+ Object.defineProperty(exports, 'parserYaml', {
1622
+ enumerable: true,
1623
+ get: function () { return parserYaml__default["default"]; }
1624
+ });
1625
+ exports.GLOB_ALL_SRC = GLOB_ALL_SRC;
1626
+ exports.GLOB_CSS = GLOB_CSS;
1627
+ exports.GLOB_DTS = GLOB_DTS;
1628
+ exports.GLOB_ESLINTRC = GLOB_ESLINTRC;
1629
+ exports.GLOB_EXCLUDE = GLOB_EXCLUDE;
1630
+ exports.GLOB_HTML = GLOB_HTML;
1631
+ exports.GLOB_JS = GLOB_JS;
1632
+ exports.GLOB_JSON = GLOB_JSON;
1633
+ exports.GLOB_JSON5 = GLOB_JSON5;
1634
+ exports.GLOB_JSONC = GLOB_JSONC;
1635
+ exports.GLOB_JSX = GLOB_JSX;
1636
+ exports.GLOB_LESS = GLOB_LESS;
1637
+ exports.GLOB_MARKDOWN = GLOB_MARKDOWN;
1638
+ exports.GLOB_MARKDOWN_CODE = GLOB_MARKDOWN_CODE;
1639
+ exports.GLOB_PACKAGEJSON = GLOB_PACKAGEJSON;
1640
+ exports.GLOB_SCSS = GLOB_SCSS;
1641
+ exports.GLOB_SRC = GLOB_SRC;
1642
+ exports.GLOB_SRC_EXT = GLOB_SRC_EXT;
1643
+ exports.GLOB_STYLE = GLOB_STYLE;
1644
+ exports.GLOB_TESTS = GLOB_TESTS;
1645
+ exports.GLOB_TOML = GLOB_TOML;
1646
+ exports.GLOB_TS = GLOB_TS;
1647
+ exports.GLOB_TSX = GLOB_TSX;
1648
+ exports.GLOB_VUE = GLOB_VUE;
1649
+ exports.GLOB_YAML = GLOB_YAML;
1650
+ exports.combine = combine;
1651
+ exports.comments = comments;
1652
+ exports.html = html;
1653
+ exports.ignores = ignores;
1654
+ exports.imports = imports;
1655
+ exports.javascript = javascript;
1656
+ exports.jsdoc = jsdoc;
1657
+ exports.jsonc = jsonc;
1658
+ exports.mdx = mdx;
1659
+ exports.node = node;
1660
+ exports.onlyError = onlyError;
1661
+ exports.promise = promise;
1662
+ exports.recordRulesState = recordRulesState;
1663
+ exports.recordRulesStateConfigs = recordRulesStateConfigs;
1664
+ exports.renameRules = renameRules;
1665
+ exports.so1ve = so1ve;
1666
+ exports.solid = solid;
1667
+ exports.sortImports = sortImports;
1668
+ exports.test = test;
1669
+ exports.toml = toml;
1670
+ exports.typescript = typescript;
1671
+ exports.typescriptWithTypes = typescriptWithTypes;
1672
+ exports.unicorn = unicorn;
1673
+ exports.vue = vue;
1674
+ exports.warnUnnecessaryOffRules = warnUnnecessaryOffRules;
1675
+ exports.yaml = yaml;