@frabbit/eslint-config 1.5.15 → 7.4.6

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 DELETED
@@ -1,1409 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all2) => {
9
- for (var name in all2)
10
- __defProp(target, name, { get: all2[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- GLOB_ALL_SRC: () => GLOB_ALL_SRC,
34
- GLOB_CSS: () => GLOB_CSS,
35
- GLOB_DIST: () => GLOB_DIST,
36
- GLOB_EXCLUDE: () => GLOB_EXCLUDE,
37
- GLOB_HTML: () => GLOB_HTML,
38
- GLOB_JS: () => GLOB_JS,
39
- GLOB_JSON: () => GLOB_JSON,
40
- GLOB_JSON5: () => GLOB_JSON5,
41
- GLOB_JSONC: () => GLOB_JSONC,
42
- GLOB_JSX: () => GLOB_JSX,
43
- GLOB_LESS: () => GLOB_LESS,
44
- GLOB_LOCKFILE: () => GLOB_LOCKFILE,
45
- GLOB_MARKDOWN: () => GLOB_MARKDOWN,
46
- GLOB_NODE_MODULES: () => GLOB_NODE_MODULES,
47
- GLOB_NUXT_LAYOUTS: () => GLOB_NUXT_LAYOUTS,
48
- GLOB_NUXT_PAGE: () => GLOB_NUXT_PAGE,
49
- GLOB_SCSS: () => GLOB_SCSS,
50
- GLOB_SRC: () => GLOB_SRC,
51
- GLOB_SRC_EXT: () => GLOB_SRC_EXT,
52
- GLOB_STYLE: () => GLOB_STYLE,
53
- GLOB_TS: () => GLOB_TS,
54
- GLOB_TSX: () => GLOB_TSX,
55
- GLOB_VUE: () => GLOB_VUE,
56
- GLOB_YAML: () => GLOB_YAML,
57
- all: () => all,
58
- basic: () => basic,
59
- comments: () => comments,
60
- configPrettier: () => configPrettier,
61
- frabbit: () => frabbit,
62
- getVueVersion: () => getVueVersion,
63
- hasTypeScript: () => hasTypeScript,
64
- hasVue: () => hasVue,
65
- ignores: () => ignores,
66
- imports: () => imports,
67
- isInEditor: () => isInEditor,
68
- javascript: () => javascript,
69
- jsonc: () => jsonc,
70
- markdown: () => markdown,
71
- parserJsonc: () => parserJsonc,
72
- parserTypeScript: () => parserTypeScript,
73
- parserVue: () => parserVue,
74
- parserYml: () => parserYml,
75
- pluginAntfu: () => pluginAntfu,
76
- pluginComments: () => pluginComments,
77
- pluginImport: () => pluginImport,
78
- pluginJsonc: () => pluginJsonc,
79
- pluginMarkdown: () => pluginMarkdown,
80
- pluginPrettier: () => pluginPrettier,
81
- pluginSecurity: () => pluginSecurity,
82
- pluginSonar: () => pluginSonar,
83
- pluginTypeScript: () => pluginTypeScript,
84
- pluginUnicorn: () => pluginUnicorn,
85
- pluginUnocss: () => pluginUnocss,
86
- pluginUnusedImports: () => pluginUnusedImports,
87
- pluginVue: () => pluginVue,
88
- pluginYml: () => pluginYml,
89
- presetBasic: () => basic,
90
- presetJavaScript: () => presetJavaScript,
91
- presetLangsExtensions: () => presetLangsExtensions,
92
- prettier: () => prettier,
93
- reactivityTransform: () => reactivityTransform,
94
- security: () => security,
95
- sonarjs: () => sonarjs,
96
- sortPackageJson: () => sortPackageJson,
97
- sortTsconfig: () => sortTsconfig,
98
- typescript: () => typescript,
99
- unicorn: () => unicorn,
100
- unocss: () => unocss,
101
- vue: () => vue,
102
- yml: () => yml
103
- });
104
- module.exports = __toCommonJS(src_exports);
105
-
106
- // src/plugins.ts
107
- var _pluginAntfu = __toESM(require("eslint-plugin-antfu"), 1);
108
- var _pluginComments = __toESM(require("eslint-plugin-eslint-comments"), 1);
109
- var _pluginMarkdown = __toESM(require("eslint-plugin-markdown"), 1);
110
- var _pluginTypeScript = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
111
- var _pluginUnicorn = __toESM(require("eslint-plugin-unicorn"), 1);
112
- var _pluginVue = __toESM(require("eslint-plugin-vue"), 1);
113
- var _pluginUnocss = __toESM(require("@unocss/eslint-plugin"), 1);
114
- var _pluginPrettier = __toESM(require("eslint-plugin-prettier"), 1);
115
- var _configPrettier = __toESM(require("eslint-config-prettier"), 1);
116
- var pluginSonar = __toESM(require("eslint-plugin-sonarjs"), 1);
117
- var _pluginSecurity = __toESM(require("eslint-plugin-security"), 1);
118
- var pluginImport = __toESM(require("eslint-plugin-i"), 1);
119
- var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
120
- var pluginUnusedImports = __toESM(require("eslint-plugin-unused-imports"), 1);
121
- var pluginYml = __toESM(require("eslint-plugin-yml"), 1);
122
- var parserTypeScript = __toESM(require("@typescript-eslint/parser"), 1);
123
- var parserVue = __toESM(require("vue-eslint-parser"), 1);
124
- var parserYml = __toESM(require("yaml-eslint-parser"), 1);
125
- var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
126
- // @__NO_SIDE_EFFECTS__
127
- function interopDefault(m) {
128
- return m.default || m;
129
- }
130
- var pluginAntfu = /* @__PURE__ */ interopDefault(_pluginAntfu);
131
- var pluginComments = /* @__PURE__ */ interopDefault(_pluginComments);
132
- var pluginMarkdown = /* @__PURE__ */ interopDefault(_pluginMarkdown);
133
- var pluginTypeScript = /* @__PURE__ */ interopDefault(_pluginTypeScript);
134
- var pluginUnicorn = /* @__PURE__ */ interopDefault(_pluginUnicorn);
135
- var pluginVue = /* @__PURE__ */ interopDefault(_pluginVue);
136
- var pluginUnocss = /* @__PURE__ */ interopDefault(_pluginUnocss);
137
- var pluginPrettier = /* @__PURE__ */ interopDefault(_pluginPrettier);
138
- var configPrettier = /* @__PURE__ */ interopDefault(_configPrettier);
139
- var pluginSecurity = /* @__PURE__ */ interopDefault(_pluginSecurity);
140
-
141
- // src/configs/comments.ts
142
- var comments = [
143
- {
144
- plugins: {
145
- "eslint-comments": pluginComments
146
- },
147
- rules: {
148
- ...pluginComments.configs.recommended.rules,
149
- "eslint-comments/disable-enable-pair": [
150
- "error",
151
- { allowWholeFile: true }
152
- ]
153
- }
154
- }
155
- ];
156
-
157
- // src/globs.ts
158
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
159
- var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
160
- var GLOB_JS = "**/*.?([cm])js";
161
- var GLOB_JSX = "**/*.?([cm])jsx";
162
- var GLOB_TS = "**/*.?([cm])ts";
163
- var GLOB_TSX = "**/*.?([cm])tsx";
164
- var GLOB_STYLE = "**/*.{c,le,sc}ss";
165
- var GLOB_CSS = "**/*.css";
166
- var GLOB_LESS = "**/*.less";
167
- var GLOB_SCSS = "**/*.scss";
168
- var GLOB_JSON = "**/*.json";
169
- var GLOB_JSON5 = "**/*.json5";
170
- var GLOB_JSONC = "**/*.jsonc";
171
- var GLOB_MARKDOWN = "**/*.md";
172
- var GLOB_VUE = "**/*.vue";
173
- var GLOB_NUXT_PAGE = "pages/**/*.vue";
174
- var GLOB_NUXT_LAYOUTS = "layouts/**/*.vue";
175
- var GLOB_YAML = "**/*.y?(a)ml";
176
- var GLOB_HTML = "**/*.htm?(l)";
177
- var GLOB_ALL_SRC = [
178
- GLOB_SRC,
179
- GLOB_STYLE,
180
- GLOB_JSON,
181
- GLOB_JSON5,
182
- GLOB_MARKDOWN,
183
- GLOB_VUE,
184
- GLOB_NUXT_PAGE,
185
- GLOB_NUXT_LAYOUTS,
186
- GLOB_YAML,
187
- GLOB_HTML
188
- ];
189
- var GLOB_NODE_MODULES = "**/node_modules";
190
- var GLOB_DIST = "**/dist";
191
- var GLOB_LOCKFILE = [
192
- "**/package-lock.json",
193
- "**/yarn.lock",
194
- "**/pnpm-lock.yaml"
195
- ];
196
- var GLOB_EXCLUDE = [
197
- GLOB_NODE_MODULES,
198
- GLOB_DIST,
199
- ...GLOB_LOCKFILE,
200
- "**/output",
201
- "**/coverage",
202
- "**/temp",
203
- "**/fixtures",
204
- "**/.vitepress/cache",
205
- "**/.nuxt",
206
- "**/.vercel",
207
- "**/.changeset",
208
- "**/.idea",
209
- "**/.output",
210
- "**/.vite-inspect",
211
- "**/CHANGELOG*.md",
212
- "**/*.min.*",
213
- "**/LICENSE*",
214
- "**/__snapshots__",
215
- "**/auto-import?(s).d.ts",
216
- "**/components.d.ts"
217
- ];
218
-
219
- // src/configs/ignores.ts
220
- var ignores = [{ ignores: GLOB_EXCLUDE }];
221
-
222
- // src/configs/imports.ts
223
- var imports = [
224
- {
225
- plugins: {
226
- antfu: pluginAntfu,
227
- import: pluginImport
228
- },
229
- rules: {
230
- "antfu/import-dedupe": "error",
231
- "import/first": "error",
232
- "import/newline-after-import": ["error", { count: 1 }],
233
- "import/no-default-export": "error",
234
- "import/no-duplicates": "error",
235
- "import/no-mutable-exports": "error",
236
- "import/no-named-default": "error",
237
- "import/no-self-import": "error",
238
- "import/no-webpack-loader-syntax": "error",
239
- "import/order": [
240
- "error",
241
- {
242
- alphabetize: { caseInsensitive: true, order: "asc" },
243
- groups: [
244
- "builtin",
245
- "external",
246
- "internal",
247
- "parent",
248
- "sibling",
249
- "index",
250
- "object",
251
- "type"
252
- ],
253
- "newlines-between": "always",
254
- pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
255
- pathGroupsExcludedImportTypes: ["type"]
256
- }
257
- ]
258
- }
259
- },
260
- {
261
- files: [
262
- `**/*config*.${GLOB_SRC_EXT}`,
263
- `**/views/${GLOB_SRC}`,
264
- `**/pages/${GLOB_SRC}`,
265
- `**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
266
- "**/*.d.ts",
267
- `${GLOB_MARKDOWN}/**`
268
- ],
269
- plugins: {
270
- import: pluginImport
271
- },
272
- rules: {
273
- "import/no-default-export": "off"
274
- }
275
- }
276
- ];
277
-
278
- // src/configs/javascript.ts
279
- var import_globals = __toESM(require("globals"), 1);
280
-
281
- // src/env.ts
282
- var import_node_process = __toESM(require("process"), 1);
283
- var import_local_pkg = require("local-pkg");
284
- var isInEditor = (import_node_process.default.env.VSCODE_PID || import_node_process.default.env.JETBRAINS_IDE) && !import_node_process.default.env.CI;
285
- var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
286
- var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli");
287
-
288
- // src/configs/javascript.ts
289
- var javascript = [
290
- {
291
- languageOptions: {
292
- globals: {
293
- ...import_globals.default.browser,
294
- ...import_globals.default.es2021,
295
- ...import_globals.default.node
296
- },
297
- parserOptions: {
298
- ecmaFeatures: {
299
- jsx: true
300
- },
301
- sourceType: "module"
302
- },
303
- sourceType: "module"
304
- },
305
- plugins: {
306
- "unused-imports": pluginUnusedImports
307
- },
308
- rules: {
309
- "array-callback-return": "error",
310
- "block-scoped-var": "error",
311
- camelcase: [
312
- "error",
313
- {
314
- ignoreDestructuring: true,
315
- ignoreImports: true,
316
- properties: "always"
317
- }
318
- ],
319
- "class-methods-use-this": "error",
320
- "constructor-super": "error",
321
- "dot-notation": "warn",
322
- eqeqeq: ["error", "smart"],
323
- "for-direction": "error",
324
- "getter-return": "error",
325
- "no-alert": "warn",
326
- "no-async-promise-executor": "error",
327
- "no-await-in-loop": "error",
328
- "no-case-declarations": "error",
329
- "no-class-assign": "error",
330
- "no-compare-neg-zero": "error",
331
- "no-cond-assign": "error",
332
- "no-console": ["warn", { allow: ["warn", "error"] }],
333
- "no-const-assign": "error",
334
- "no-constant-condition": "error",
335
- "no-control-regex": "error",
336
- "no-debugger": "warn",
337
- "no-delete-var": "error",
338
- "no-dupe-args": "error",
339
- "no-dupe-class-members": "error",
340
- "no-dupe-else-if": "error",
341
- "no-dupe-keys": "error",
342
- "no-duplicate-case": "error",
343
- "no-duplicate-imports": "error",
344
- "no-else-return": "error",
345
- "no-empty": ["error", { allowEmptyCatch: true }],
346
- "no-empty-character-class": "error",
347
- "no-empty-pattern": "error",
348
- "no-ex-assign": "error",
349
- "no-extend-native": "error",
350
- "no-extra-bind": "error",
351
- "no-extra-boolean-cast": "error",
352
- "no-extra-label": "error",
353
- "no-fallthrough": ["warn", { commentPattern: "break[\\s\\w]*omitted" }],
354
- "no-func-assign": "error",
355
- "no-global-assign": "error",
356
- "no-import-assign": "error",
357
- "no-inner-declarations": "error",
358
- "no-invalid-regexp": "error",
359
- "no-irregular-whitespace": "error",
360
- "no-lonely-if": "error",
361
- "no-loop-func": "error",
362
- "no-loss-of-precision": "error",
363
- "no-misleading-character-class": "error",
364
- "no-mixed-spaces-and-tabs": "error",
365
- "no-multi-str": "error",
366
- "no-new-symbol": "error",
367
- "no-nonoctal-decimal-escape": "error",
368
- "no-obj-calls": "error",
369
- "no-octal": "error",
370
- "no-octal-escape": "error",
371
- "no-param-reassign": "error",
372
- "no-proto": "error",
373
- "no-prototype-builtins": "error",
374
- "no-redeclare": "error",
375
- "no-regex-spaces": "error",
376
- "no-restricted-syntax": [
377
- "error",
378
- "ForInStatement",
379
- "LabeledStatement",
380
- "WithStatement"
381
- ],
382
- "no-return-await": "warn",
383
- "no-self-assign": "error",
384
- "no-setter-return": "error",
385
- "no-shadow-restricted-names": "error",
386
- "no-sparse-arrays": "error",
387
- "no-this-before-super": "error",
388
- "no-undef": "error",
389
- "no-undef-init": "error",
390
- "no-unexpected-multiline": "error",
391
- "no-unneeded-ternary": "error",
392
- "no-unreachable": "error",
393
- "no-unsafe-finally": "error",
394
- "no-unsafe-negation": "error",
395
- "no-unsafe-optional-chaining": "error",
396
- "no-unused-expressions": [
397
- "error",
398
- {
399
- allowShortCircuit: true,
400
- allowTaggedTemplates: true,
401
- allowTernary: true
402
- }
403
- ],
404
- "no-unused-labels": "error",
405
- "no-unused-vars": "off",
406
- "no-useless-backreference": "error",
407
- "no-useless-call": "error",
408
- "no-useless-catch": "error",
409
- "no-useless-escape": "error",
410
- "no-useless-return": "error",
411
- "no-void": "error",
412
- "no-with": "error",
413
- "object-shorthand": [
414
- "error",
415
- "always",
416
- { avoidQuotes: true, ignoreConstructors: false }
417
- ],
418
- "prefer-arrow-callback": [
419
- "error",
420
- { allowNamedFunctions: false, allowUnboundThis: true }
421
- ],
422
- "prefer-const": [
423
- "warn",
424
- { destructuring: "all", ignoreReadBeforeAssign: true }
425
- ],
426
- "prefer-exponentiation-operator": "error",
427
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
428
- "prefer-rest-params": "error",
429
- "prefer-spread": "error",
430
- "prefer-template": "error",
431
- "require-atomic-updates": "error",
432
- "require-await": "error",
433
- "require-yield": "error",
434
- "sort-imports": [
435
- "error",
436
- {
437
- allowSeparatedGroups: false,
438
- ignoreCase: false,
439
- ignoreDeclarationSort: true,
440
- ignoreMemberSort: false,
441
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
442
- }
443
- ],
444
- "unicode-bom": ["error", "never"],
445
- "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
446
- "unused-imports/no-unused-vars": [
447
- "error",
448
- { args: "after-used", ignoreRestSiblings: true }
449
- ],
450
- "use-isnan": [
451
- "error",
452
- { enforceForIndexOf: true, enforceForSwitchCase: true }
453
- ],
454
- "valid-typeof": ["error", { requireStringLiterals: true }],
455
- "vars-on-top": "error",
456
- "wrap-iife": ["error", "any", { functionPrototypeMethods: true }]
457
- }
458
- },
459
- {
460
- files: ["**/scripts/*", "**/cli.*"],
461
- rules: {
462
- "no-console": "off"
463
- }
464
- },
465
- {
466
- files: ["**/*.{test,spec}.js?(x)"],
467
- rules: {
468
- "no-unused-expressions": "off"
469
- }
470
- }
471
- ];
472
-
473
- // src/configs/jsonc.ts
474
- var jsonc = [
475
- {
476
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
477
- languageOptions: {
478
- parser: parserJsonc
479
- },
480
- plugins: {
481
- jsonc: pluginJsonc
482
- },
483
- rules: {
484
- ...pluginJsonc.configs["recommended-with-jsonc"].rules,
485
- "jsonc/quote-props": "off",
486
- "jsonc/quotes": "off"
487
- }
488
- }
489
- ];
490
-
491
- // src/configs/markdown.ts
492
- var markdown = [
493
- {
494
- files: [GLOB_MARKDOWN],
495
- plugins: {
496
- markdown: pluginMarkdown
497
- },
498
- processor: "markdown/markdown"
499
- },
500
- {
501
- files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
502
- languageOptions: {
503
- parserOptions: {
504
- ecmaFeatures: {
505
- impliedStrict: true
506
- }
507
- }
508
- },
509
- rules: {
510
- ...pluginMarkdown.configs.recommended.overrides[1].rules,
511
- "@typescript-eslint/comma-dangle": "off",
512
- "@typescript-eslint/consistent-type-imports": "off",
513
- "@typescript-eslint/no-extraneous-class": "off",
514
- "@typescript-eslint/no-namespace": "off",
515
- "@typescript-eslint/no-redeclare": "off",
516
- "@typescript-eslint/no-require-imports": "off",
517
- "@typescript-eslint/no-unused-vars": "off",
518
- "@typescript-eslint/no-use-before-define": "off",
519
- "@typescript-eslint/no-var-requires": "off",
520
- "no-alert": "off",
521
- "no-console": "off",
522
- "no-restricted-imports": "off",
523
- "no-undef": "off",
524
- "no-unused-expressions": "off",
525
- "no-unused-vars": "off",
526
- "unused-imports/no-unused-imports": "off",
527
- "unused-imports/no-unused-vars": "off"
528
- }
529
- }
530
- ];
531
-
532
- // src/configs/prettier.ts
533
- var prettierConflictRules = { ...configPrettier.rules };
534
- delete prettierConflictRules["vue/html-self-closing"];
535
- var prettier = [
536
- {
537
- plugins: {
538
- prettier: pluginPrettier
539
- },
540
- rules: {
541
- ...prettierConflictRules,
542
- ...pluginPrettier.configs.recommended.rules,
543
- "prettier/prettier": "warn"
544
- }
545
- }
546
- ];
547
-
548
- // src/configs/security.ts
549
- var security = [
550
- {
551
- plugins: {
552
- security: pluginSecurity
553
- },
554
- rules: {
555
- "security/detect-bidi-characters": "warn",
556
- "security/detect-buffer-noassert": "warn",
557
- "security/detect-child-process": "warn",
558
- "security/detect-disable-mustache-escape": "warn",
559
- "security/detect-eval-with-expression": "warn",
560
- "security/detect-new-buffer": "warn",
561
- "security/detect-no-csrf-before-method-override": "warn",
562
- "security/detect-non-literal-fs-filename": "warn",
563
- "security/detect-non-literal-regexp": "warn",
564
- "security/detect-non-literal-require": "warn",
565
- "security/detect-object-injection": "warn",
566
- "security/detect-possible-timing-attacks": "warn",
567
- "security/detect-pseudoRandomBytes": "warn",
568
- "security/detect-unsafe-regex": "warn"
569
- }
570
- }
571
- ];
572
-
573
- // src/configs/sonarjs.ts
574
- var sonarjs = [
575
- {
576
- plugins: {
577
- sonarjs: pluginSonar
578
- },
579
- rules: {
580
- "sonarjs/cognitive-complexity": "error",
581
- "sonarjs/elseif-without-else": "off",
582
- "sonarjs/max-switch-cases": "error",
583
- "sonarjs/no-all-duplicated-branches": "error",
584
- "sonarjs/no-collapsible-if": "error",
585
- "sonarjs/no-collection-size-mischeck": "error",
586
- "sonarjs/no-duplicate-string": "error",
587
- "sonarjs/no-duplicated-branches": "error",
588
- "sonarjs/no-element-overwrite": "error",
589
- "sonarjs/no-empty-collection": "error",
590
- "sonarjs/no-extra-arguments": "error",
591
- "sonarjs/no-gratuitous-expressions": "error",
592
- "sonarjs/no-identical-conditions": "error",
593
- "sonarjs/no-identical-expressions": "error",
594
- "sonarjs/no-identical-functions": "error",
595
- "sonarjs/no-ignored-return": "error",
596
- "sonarjs/no-inverted-boolean-check": "off",
597
- "sonarjs/no-nested-switch": "error",
598
- "sonarjs/no-nested-template-literals": "error",
599
- "sonarjs/no-one-iteration-loop": "error",
600
- "sonarjs/no-redundant-boolean": "error",
601
- "sonarjs/no-redundant-jump": "error",
602
- "sonarjs/no-same-line-conditional": "error",
603
- "sonarjs/no-small-switch": "error",
604
- "sonarjs/no-unused-collection": "error",
605
- "sonarjs/no-use-of-empty-return-value": "error",
606
- "sonarjs/no-useless-catch": "error",
607
- "sonarjs/non-existent-operator": "error",
608
- "sonarjs/prefer-immediate-return": "error",
609
- "sonarjs/prefer-object-literal": "error",
610
- "sonarjs/prefer-single-boolean-return": "error",
611
- "sonarjs/prefer-while": "error"
612
- }
613
- }
614
- ];
615
-
616
- // src/configs/sort.ts
617
- var sortPackageJson = [
618
- {
619
- files: ["**/package.json"],
620
- rules: {
621
- "jsonc/sort-array-values": [
622
- "error",
623
- {
624
- order: { type: "asc" },
625
- pathPattern: "^files$"
626
- }
627
- ],
628
- "jsonc/sort-keys": [
629
- "error",
630
- {
631
- order: [
632
- "name",
633
- "version",
634
- "private",
635
- "packageManager",
636
- "description",
637
- "type",
638
- "keywords",
639
- "license",
640
- "homepage",
641
- "bugs",
642
- "repository",
643
- "author",
644
- "contributors",
645
- "funding",
646
- "files",
647
- "main",
648
- "module",
649
- "types",
650
- "exports",
651
- "typesVersions",
652
- "sideEffects",
653
- "unpkg",
654
- "jsdelivr",
655
- "browser",
656
- "bin",
657
- "man",
658
- "directories",
659
- "publishConfig",
660
- "scripts",
661
- "peerDependencies",
662
- "peerDependenciesMeta",
663
- "optionalDependencies",
664
- "dependencies",
665
- "devDependencies",
666
- "engines",
667
- "config",
668
- "overrides",
669
- "pnpm",
670
- "husky",
671
- "lint-staged",
672
- "eslintConfig",
673
- "prettier"
674
- ],
675
- pathPattern: "^$"
676
- },
677
- {
678
- order: { type: "asc" },
679
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
680
- },
681
- {
682
- order: ["types", "require", "import", "default"],
683
- pathPattern: "^exports.*$"
684
- },
685
- {
686
- order: { type: "asc" },
687
- pathPattern: "^resolutions$"
688
- },
689
- {
690
- order: { type: "asc" },
691
- pathPattern: "^pnpm.overrides$"
692
- }
693
- ]
694
- }
695
- }
696
- ];
697
- var sortTsconfig = [
698
- {
699
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
700
- rules: {
701
- "jsonc/sort-keys": [
702
- "error",
703
- {
704
- order: [
705
- "extends",
706
- "compilerOptions",
707
- "references",
708
- "files",
709
- "include",
710
- "exclude"
711
- ],
712
- pathPattern: "^$"
713
- },
714
- {
715
- order: [
716
- /* Projects */
717
- "incremental",
718
- "composite",
719
- "tsBuildInfoFile",
720
- "disableSourceOfProjectReferenceRedirect",
721
- "disableSolutionSearching",
722
- "disableReferencedProjectLoad",
723
- /* Language and Environment */
724
- "target",
725
- "lib",
726
- "jsx",
727
- "experimentalDecorators",
728
- "emitDecoratorMetadata",
729
- "jsxFactory",
730
- "jsxFragmentFactory",
731
- "jsxImportSource",
732
- "reactNamespace",
733
- "noLib",
734
- "useDefineForClassFields",
735
- "moduleDetection",
736
- /* Modules */
737
- "module",
738
- "rootDir",
739
- "moduleResolution",
740
- "baseUrl",
741
- "paths",
742
- "rootDirs",
743
- "typeRoots",
744
- "types",
745
- "allowUmdGlobalAccess",
746
- "moduleSuffixes",
747
- "allowImportingTsExtensions",
748
- "resolvePackageJsonExports",
749
- "resolvePackageJsonImports",
750
- "customConditions",
751
- "resolveJsonModule",
752
- "allowArbitraryExtensions",
753
- "noResolve",
754
- /* JavaScript Support */
755
- "allowJs",
756
- "checkJs",
757
- "maxNodeModuleJsDepth",
758
- /* Emit */
759
- "declaration",
760
- "declarationMap",
761
- "emitDeclarationOnly",
762
- "sourceMap",
763
- "inlineSourceMap",
764
- "outFile",
765
- "outDir",
766
- "removeComments",
767
- "noEmit",
768
- "importHelpers",
769
- "importsNotUsedAsValues",
770
- "downlevelIteration",
771
- "sourceRoot",
772
- "mapRoot",
773
- "inlineSources",
774
- "emitBOM",
775
- "newLine",
776
- "stripInternal",
777
- "noEmitHelpers",
778
- "noEmitOnError",
779
- "preserveConstEnums",
780
- "declarationDir",
781
- "preserveValueImports",
782
- /* Interop Constraints */
783
- "isolatedModules",
784
- "verbatimModuleSyntax",
785
- "allowSyntheticDefaultImports",
786
- "esModuleInterop",
787
- "preserveSymlinks",
788
- "forceConsistentCasingInFileNames",
789
- /* Type Checking */
790
- "strict",
791
- "strictBindCallApply",
792
- "strictFunctionTypes",
793
- "strictNullChecks",
794
- "strictPropertyInitialization",
795
- "allowUnreachableCode",
796
- "allowUnusedLabels",
797
- "alwaysStrict",
798
- "exactOptionalPropertyTypes",
799
- "noFallthroughCasesInSwitch",
800
- "noImplicitAny",
801
- "noImplicitOverride",
802
- "noImplicitReturns",
803
- "noImplicitThis",
804
- "noPropertyAccessFromIndexSignature",
805
- "noUncheckedIndexedAccess",
806
- "noUnusedLocals",
807
- "noUnusedParameters",
808
- "useUnknownInCatchVariables",
809
- /* Completeness */
810
- "skipDefaultLibCheck",
811
- "skipLibCheck"
812
- ],
813
- pathPattern: "^compilerOptions$"
814
- }
815
- ]
816
- }
817
- }
818
- ];
819
-
820
- // src/configs/typescript.ts
821
- var typescript = [
822
- {
823
- files: [GLOB_TS, GLOB_TSX],
824
- languageOptions: {
825
- parser: parserTypeScript,
826
- parserOptions: {
827
- sourceType: "module"
828
- }
829
- },
830
- plugins: {
831
- "@typescript-eslint": pluginTypeScript,
832
- antfu: pluginAntfu
833
- },
834
- rules: {
835
- ...pluginTypeScript.configs["eslint-recommended"].overrides[0].rules,
836
- ...pluginTypeScript.configs.strict.rules,
837
- "@typescript-eslint/ban-ts-comment": "off",
838
- "@typescript-eslint/ban-types": "off",
839
- "@typescript-eslint/consistent-type-assertions": [
840
- "error",
841
- {
842
- assertionStyle: "as",
843
- objectLiteralTypeAssertions: "allow-as-parameter"
844
- }
845
- ],
846
- "@typescript-eslint/consistent-type-imports": [
847
- "error",
848
- { disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
849
- ],
850
- "@typescript-eslint/no-explicit-any": "off",
851
- "@typescript-eslint/no-non-null-assertion": "off",
852
- "@typescript-eslint/no-redeclare": "error",
853
- // handled by unused-imports/no-unused-imports
854
- "@typescript-eslint/no-unused-vars": "off",
855
- "@typescript-eslint/prefer-as-const": "warn",
856
- "no-restricted-syntax": ["error", "TSEnumDeclaration[const=true]"]
857
- }
858
- },
859
- {
860
- files: ["**/*.d.ts"],
861
- rules: {
862
- "eslint-comments/no-unlimited-disable": "off",
863
- "import/no-duplicates": "off",
864
- "unused-imports/no-unused-vars": "off"
865
- }
866
- },
867
- {
868
- files: ["**/*.{test,spec}.ts?(x)"],
869
- rules: {
870
- "no-unused-expressions": "off"
871
- }
872
- },
873
- {
874
- files: ["**/*.js", "**/*.cjs"],
875
- rules: {
876
- "@typescript-eslint/no-require-imports": "off",
877
- "@typescript-eslint/no-var-requires": "off"
878
- }
879
- }
880
- ];
881
-
882
- // src/configs/unicorn.ts
883
- var unicorn = [
884
- {
885
- plugins: {
886
- unicorn: pluginUnicorn
887
- },
888
- rules: {
889
- "unicorn/better-regex": "error",
890
- "unicorn/catch-error-name": "error",
891
- "unicorn/consistent-function-scoping": "off",
892
- "unicorn/custom-error-definition": "off",
893
- // 'unicorn/custom-error-definition': 'error',
894
- "unicorn/error-message": "error",
895
- "unicorn/escape-case": "error",
896
- "unicorn/expiring-todo-comments": "error",
897
- "unicorn/explicit-length-check": "error",
898
- "unicorn/filename-case": [
899
- "error",
900
- {
901
- case: "kebabCase",
902
- ignore: [/^[A-Z]+\..*$/]
903
- }
904
- ],
905
- "unicorn/import-index": "warn",
906
- "unicorn/new-for-builtins": "off",
907
- // 'unicorn/new-for-builtins': 'error',
908
- "unicorn/no-abusive-eslint-disable": "error",
909
- "unicorn/no-array-callback-reference": "error",
910
- "unicorn/no-array-method-this-argument": "error",
911
- "unicorn/no-array-push-push": "error",
912
- "unicorn/no-console-spaces": "error",
913
- "unicorn/no-fn-reference-in-iterator": "off",
914
- "unicorn/no-for-loop": "warn",
915
- // 'unicorn/no-for-loop': 'error',
916
- "unicorn/no-hex-escape": "warn",
917
- // 'unicorn/no-hex-escape': 'error',
918
- "unicorn/no-instanceof-array": "error",
919
- "unicorn/no-invalid-remove-event-listener": "error",
920
- "unicorn/no-keyword-prefix": "warn",
921
- "unicorn/no-lonely-if": "error",
922
- "unicorn/no-nested-ternary": "warn",
923
- "unicorn/no-new-array": "error",
924
- "unicorn/no-new-buffer": "error",
925
- "unicorn/no-null": "warn",
926
- "unicorn/no-object-as-default-parameter": "warn",
927
- "unicorn/no-process-exit": "error",
928
- "unicorn/no-reduce": "off",
929
- "unicorn/no-static-only-class": "error",
930
- "unicorn/no-unnecessary-await": "error",
931
- "unicorn/no-unreadable-array-destructuring": "off",
932
- "unicorn/no-unsafe-regex": "warn",
933
- "unicorn/no-unused-properties": "off",
934
- "unicorn/no-useless-undefined": "warn",
935
- "unicorn/no-zero-fractions": "warn",
936
- // 'unicorn/no-zero-fractions': `error`,
937
- "unicorn/number-literal-case": "error",
938
- "unicorn/prefer-add-event-listener": "warn",
939
- // 'unicorn/prefer-add-event-listener': 'error',
940
- "unicorn/prefer-array-find": "error",
941
- // 'unicorn/prefer-array-find': 'error',
942
- "unicorn/prefer-array-flat-map": "error",
943
- "unicorn/prefer-array-index-of": "error",
944
- "unicorn/prefer-array-some": "error",
945
- "unicorn/prefer-at": "error",
946
- "unicorn/prefer-blob-reading-methods": "error",
947
- "unicorn/prefer-dataset": "warn",
948
- "unicorn/prefer-date-now": "error",
949
- "unicorn/prefer-dom-node-append": "error",
950
- "unicorn/prefer-dom-node-dataset": "error",
951
- "unicorn/prefer-dom-node-remove": "error",
952
- "unicorn/prefer-dom-node-text-content": "error",
953
- "unicorn/prefer-event-key": "off",
954
- "unicorn/prefer-flat-map": "error",
955
- "unicorn/prefer-includes": "error",
956
- "unicorn/prefer-keyboard-event-key": "error",
957
- "unicorn/prefer-math-trunc": "error",
958
- "unicorn/prefer-modern-dom-apis": "warn",
959
- // 'unicorn/prefer-modern-dom-apis': 'error',
960
- "unicorn/prefer-modern-math-apis": "error",
961
- "unicorn/prefer-negative-index": "error",
962
- "unicorn/prefer-node-append": "warn",
963
- "unicorn/prefer-node-protocol": "error",
964
- "unicorn/prefer-node-remove": "warn",
965
- "unicorn/prefer-number-properties": "error",
966
- "unicorn/prefer-optional-catch-binding": "warn",
967
- // 'unicorn/prefer-optional-catch-binding': 'error',
968
- "unicorn/prefer-prototype-methods": "error",
969
- "unicorn/prefer-query-selector": "warn",
970
- // 'unicorn/prefer-query-selector': 'error',
971
- "unicorn/prefer-reflect-apply": "error",
972
- "unicorn/prefer-regexp-test": "error",
973
- "unicorn/prefer-replace-all": "warn",
974
- "unicorn/prefer-set-has": "warn",
975
- "unicorn/prefer-spread": "error",
976
- "unicorn/prefer-starts-ends-with": "error",
977
- "unicorn/prefer-string-replace-all": "error",
978
- "unicorn/prefer-string-slice": "warn",
979
- // 'unicorn/prefer-string-slice': 'error',
980
- "unicorn/prefer-string-starts-ends-with": "error",
981
- "unicorn/prefer-string-trim-start-end": "error",
982
- "unicorn/prefer-top-level-await": "error",
983
- "unicorn/prefer-trim-start-end": "error",
984
- "unicorn/prefer-type-error": "error",
985
- "unicorn/prevent-abbreviations": "off",
986
- "unicorn/string-content": "off",
987
- "unicorn/throw-new-error": "warn"
988
- // 'unicorn/throw-new-error': 'error',
989
- // 'unicorn/catch-error-name': 0,
990
- }
991
- }
992
- ];
993
-
994
- // src/configs/unocss.ts
995
- var unocss = [
996
- {
997
- plugins: {
998
- "@unocss": pluginUnocss
999
- },
1000
- rules: {
1001
- ...pluginUnocss.configs.recommended.rules
1002
- }
1003
- }
1004
- ];
1005
-
1006
- // src/configs/vue.ts
1007
- var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
1008
- var import_local_pkg2 = require("local-pkg");
1009
- function getVueVersion() {
1010
- const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [process.cwd()] });
1011
- if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
1012
- return +pkg.version[0];
1013
- }
1014
- return 3;
1015
- }
1016
- var isVue3 = getVueVersion() === 3;
1017
- var reactivityTransform = [
1018
- {
1019
- languageOptions: {
1020
- globals: {
1021
- $: "readonly",
1022
- $$: "readonly",
1023
- $computed: "readonly",
1024
- $customRef: "readonly",
1025
- $ref: "readonly",
1026
- $shallowRef: "readonly",
1027
- $toRef: "readonly"
1028
- }
1029
- },
1030
- plugins: {
1031
- vue: pluginVue
1032
- },
1033
- rules: {
1034
- "vue/no-setup-props-reactivity-loss": "off"
1035
- }
1036
- }
1037
- ];
1038
- var vueCustomRules = {
1039
- "vue/attributes-order": [
1040
- "warn",
1041
- {
1042
- alphabetical: false,
1043
- order: [
1044
- "DEFINITION",
1045
- "LIST_RENDERING",
1046
- "CONDITIONALS",
1047
- "RENDER_MODIFIERS",
1048
- "GLOBAL",
1049
- "UNIQUE",
1050
- "TWO_WAY_BINDING",
1051
- "OTHER_DIRECTIVES",
1052
- "OTHER_ATTR",
1053
- "EVENTS",
1054
- "CONTENT"
1055
- ]
1056
- }
1057
- ],
1058
- "vue/block-order": [
1059
- "error",
1060
- {
1061
- order: [
1062
- "docs",
1063
- "script[setup]",
1064
- "template",
1065
- "script:not([setup])",
1066
- "style"
1067
- ]
1068
- }
1069
- ],
1070
- "vue/component-definition-name-casing": ["error", "kebab-case"],
1071
- "vue/component-name-in-template-casing": [
1072
- "error",
1073
- "kebab-case",
1074
- {
1075
- ignores: [],
1076
- registeredComponentsOnly: false
1077
- }
1078
- ],
1079
- "vue/component-options-name-casing": ["error", "PascalCase"],
1080
- "vue/component-tags-order": "off",
1081
- "vue/custom-event-name-casing": ["error", "camelCase"],
1082
- "vue/eqeqeq": ["error", "smart"],
1083
- "vue/html-self-closing": [
1084
- "error",
1085
- {
1086
- html: {
1087
- component: "always",
1088
- normal: "always",
1089
- void: "always"
1090
- },
1091
- math: "always",
1092
- svg: "always"
1093
- }
1094
- ],
1095
- "vue/match-component-file-name": [
1096
- "error",
1097
- {
1098
- extensions: ["vue"],
1099
- shouldMatchCase: false
1100
- }
1101
- ],
1102
- "vue/match-component-import-name": "warn",
1103
- "vue/max-attributes-per-line": "off",
1104
- "vue/multi-word-component-names": "error",
1105
- "vue/no-boolean-default": ["error", "default-false"],
1106
- "vue/no-constant-condition": "warn",
1107
- "vue/no-duplicate-attr-inheritance": "warn",
1108
- "vue/no-empty-pattern": "error",
1109
- "vue/no-irregular-whitespace": "error",
1110
- "vue/no-loss-of-precision": "error",
1111
- "vue/no-multiple-objects-in-class": "error",
1112
- "vue/no-potential-component-option-typo": [
1113
- "error",
1114
- {
1115
- presets: ["vue", "nuxt"],
1116
- threshold: 5
1117
- }
1118
- ],
1119
- "vue/no-reserved-component-names": "error",
1120
- "vue/no-static-inline-styles": [
1121
- "error",
1122
- {
1123
- allowBinding: false
1124
- }
1125
- ],
1126
- "vue/no-this-in-before-route-enter": "error",
1127
- // 'vue/no-restricted-static-attribute': [
1128
- // 'error',
1129
- // {
1130
- // key: 'stlye',
1131
- // message: 'Using "stlye" is not allowed. Use "style" instead.',
1132
- // },
1133
- // ],
1134
- // 'vue/no-template-target-blank': [
1135
- // 'error',
1136
- // {
1137
- // allowReferrer: true,
1138
- // enforceDynamicLinks: 'always',
1139
- // },
1140
- // ],
1141
- "vue/no-undef-components": [
1142
- "error",
1143
- {
1144
- ignorePatterns: ["lazy-hydrate", "no-ssr", "client-only"]
1145
- }
1146
- ],
1147
- "vue/no-unsupported-features": [
1148
- "error",
1149
- {
1150
- ignores: [],
1151
- version: "^2.7.14"
1152
- }
1153
- ],
1154
- "vue/no-unused-properties": [
1155
- "error",
1156
- {
1157
- groups: ["props", "data", "computed", "methods", "setup"],
1158
- ignorePublicMembers: true
1159
- }
1160
- ],
1161
- "vue/no-unused-refs": "error",
1162
- "vue/no-useless-concat": "warn",
1163
- "vue/no-useless-mustaches": [
1164
- "warn",
1165
- {
1166
- ignoreIncludesComment: true,
1167
- ignoreStringEscape: true
1168
- }
1169
- ],
1170
- "vue/no-useless-v-bind": [
1171
- "warn",
1172
- {
1173
- ignoreIncludesComment: true,
1174
- ignoreStringEscape: true
1175
- }
1176
- ],
1177
- "vue/no-v-html": "off",
1178
- "vue/object-curly-spacing": "error",
1179
- "vue/object-shorthand": [
1180
- "error",
1181
- "always",
1182
- {
1183
- avoidQuotes: true,
1184
- ignoreConstructors: false
1185
- }
1186
- ],
1187
- "vue/padding-line-between-blocks": ["error", "always"],
1188
- "vue/prefer-prop-type-boolean-first": "error",
1189
- "vue/prefer-separate-static-class": "error",
1190
- "vue/prefer-template": "error",
1191
- "vue/prefer-true-attribute-shorthand": "warn",
1192
- "vue/prop-name-casing": ["error", "camelCase"],
1193
- "vue/require-default-prop": "error",
1194
- "vue/require-prop-types": "error",
1195
- // TODO: отступы в <script>
1196
- "vue/script-indent": [
1197
- "error",
1198
- 2,
1199
- {
1200
- baseIndent: 1,
1201
- ignores: [],
1202
- switchCase: 1
1203
- }
1204
- ],
1205
- "vue/space-in-parens": "error",
1206
- "vue/static-class-names-order": "off",
1207
- "vue/v-on-handler-style": [
1208
- "error",
1209
- ["method", "inline-function"],
1210
- // ["method", "inline-function"] | ["method", "inline"] | "inline-function" | "inline"
1211
- {
1212
- ignoreIncludesComment: true
1213
- }
1214
- ],
1215
- "vue/valid-v-bind-sync": "error",
1216
- "vue/valid-v-slot": "error"
1217
- };
1218
- var vue3Rules = {
1219
- ...pluginVue.configs.base.rules,
1220
- ...pluginVue.configs["vue3-essential"].rules,
1221
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
1222
- ...pluginVue.configs["vue3-recommended"].rules
1223
- };
1224
- var vue2Rules = {
1225
- ...pluginVue.configs.base.rules,
1226
- ...pluginVue.configs.essential.rules,
1227
- ...pluginVue.configs["strongly-recommended"].rules,
1228
- ...pluginVue.configs.recommended.rules
1229
- };
1230
- var vue = [
1231
- {
1232
- files: [GLOB_VUE],
1233
- languageOptions: {
1234
- parser: parserVue,
1235
- parserOptions: {
1236
- ecmaFeatures: {
1237
- jsx: true
1238
- },
1239
- extraFileExtensions: [".vue"],
1240
- parser: "@typescript-eslint/parser",
1241
- sourceType: "module"
1242
- }
1243
- },
1244
- plugins: {
1245
- "@typescript-eslint": import_eslint_plugin.default,
1246
- vue: pluginVue
1247
- },
1248
- processor: pluginVue.processors[".vue"],
1249
- rules: {
1250
- ...typescript[0].rules
1251
- }
1252
- },
1253
- {
1254
- plugins: {
1255
- vue: pluginVue
1256
- },
1257
- rules: {
1258
- ...isVue3 ? vue3Rules : vue2Rules,
1259
- ...vueCustomRules
1260
- }
1261
- },
1262
- ...reactivityTransform,
1263
- {
1264
- files: [GLOB_NUXT_PAGE, GLOB_NUXT_LAYOUTS, "app.vue"],
1265
- rules: {
1266
- "vue/multi-word-component-names": "off"
1267
- }
1268
- }
1269
- ];
1270
-
1271
- // src/configs/yml.ts
1272
- var yml = [
1273
- {
1274
- files: [GLOB_YAML],
1275
- languageOptions: {
1276
- parser: parserYml
1277
- },
1278
- plugins: {
1279
- yml: pluginYml
1280
- },
1281
- rules: {
1282
- ...pluginYml.configs.standard.rules,
1283
- ...pluginYml.configs.prettier.rules,
1284
- "yml/no-empty-mapping-value": "off"
1285
- }
1286
- }
1287
- ];
1288
-
1289
- // src/presets.ts
1290
- var presetJavaScript = [
1291
- ...ignores,
1292
- ...javascript,
1293
- ...comments,
1294
- ...imports,
1295
- ...unicorn,
1296
- ...security,
1297
- ...sonarjs
1298
- ];
1299
- var presetLangsExtensions = [
1300
- ...markdown,
1301
- ...yml,
1302
- ...jsonc,
1303
- ...sortPackageJson,
1304
- ...sortTsconfig
1305
- ];
1306
- var basic = [
1307
- ...presetJavaScript,
1308
- ...typescript,
1309
- ...presetLangsExtensions
1310
- ];
1311
- var all = [...basic, ...vue, ...unocss, ...prettier];
1312
- function frabbit(config = [], {
1313
- vue: enableVue = true,
1314
- prettier: enablePrettier = true,
1315
- markdown: enableMarkdown = true,
1316
- unocss: enableUnocss = false
1317
- } = {}) {
1318
- const configs = [];
1319
- configs.push(...basic);
1320
- if (enableVue) {
1321
- configs.push(...vue);
1322
- }
1323
- if (enableMarkdown) {
1324
- configs.push(...markdown);
1325
- }
1326
- if (enableUnocss) {
1327
- configs.push(...unocss);
1328
- }
1329
- if (enablePrettier) {
1330
- configs.push(...prettier);
1331
- }
1332
- if (Object.keys(config).length > 0) {
1333
- configs.push(...Array.isArray(config) ? config : [config]);
1334
- }
1335
- return configs;
1336
- }
1337
- // Annotate the CommonJS export names for ESM import in node:
1338
- 0 && (module.exports = {
1339
- GLOB_ALL_SRC,
1340
- GLOB_CSS,
1341
- GLOB_DIST,
1342
- GLOB_EXCLUDE,
1343
- GLOB_HTML,
1344
- GLOB_JS,
1345
- GLOB_JSON,
1346
- GLOB_JSON5,
1347
- GLOB_JSONC,
1348
- GLOB_JSX,
1349
- GLOB_LESS,
1350
- GLOB_LOCKFILE,
1351
- GLOB_MARKDOWN,
1352
- GLOB_NODE_MODULES,
1353
- GLOB_NUXT_LAYOUTS,
1354
- GLOB_NUXT_PAGE,
1355
- GLOB_SCSS,
1356
- GLOB_SRC,
1357
- GLOB_SRC_EXT,
1358
- GLOB_STYLE,
1359
- GLOB_TS,
1360
- GLOB_TSX,
1361
- GLOB_VUE,
1362
- GLOB_YAML,
1363
- all,
1364
- basic,
1365
- comments,
1366
- configPrettier,
1367
- frabbit,
1368
- getVueVersion,
1369
- hasTypeScript,
1370
- hasVue,
1371
- ignores,
1372
- imports,
1373
- isInEditor,
1374
- javascript,
1375
- jsonc,
1376
- markdown,
1377
- parserJsonc,
1378
- parserTypeScript,
1379
- parserVue,
1380
- parserYml,
1381
- pluginAntfu,
1382
- pluginComments,
1383
- pluginImport,
1384
- pluginJsonc,
1385
- pluginMarkdown,
1386
- pluginPrettier,
1387
- pluginSecurity,
1388
- pluginSonar,
1389
- pluginTypeScript,
1390
- pluginUnicorn,
1391
- pluginUnocss,
1392
- pluginUnusedImports,
1393
- pluginVue,
1394
- pluginYml,
1395
- presetBasic,
1396
- presetJavaScript,
1397
- presetLangsExtensions,
1398
- prettier,
1399
- reactivityTransform,
1400
- security,
1401
- sonarjs,
1402
- sortPackageJson,
1403
- sortTsconfig,
1404
- typescript,
1405
- unicorn,
1406
- unocss,
1407
- vue,
1408
- yml
1409
- });