@fast-china/eslint-config 1.0.8 → 1.0.9

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.
@@ -0,0 +1,153 @@
1
+ import * as _typescript_eslint_utils_dist_ts_eslint from '@typescript-eslint/utils/dist/ts-eslint';
2
+ import { Linter } from 'eslint';
3
+
4
+ /**
5
+ * 公共配置
6
+ * @description 最佳实践
7
+ */
8
+ declare const commonConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
9
+
10
+ /**
11
+ * 忽略配置
12
+ */
13
+ declare const ignoresConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
14
+
15
+ /**
16
+ * 导入使用 lodash-unified 模块规则
17
+ */
18
+ declare const importUseLodashUnifiedRules: Linter.RulesRecord;
19
+ /**
20
+ * 导入使用 lodash 模块规则
21
+ */
22
+ declare const importUseLodashRules: Linter.RulesRecord;
23
+ /**
24
+ * import配置
25
+ */
26
+ declare const importConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
27
+
28
+ /**
29
+ * JavaScript配置
30
+ */
31
+ declare const javascriptConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
32
+
33
+ /**
34
+ * Json配置
35
+ */
36
+ declare const jsonConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
37
+
38
+ /**
39
+ * markdown配置
40
+ */
41
+ declare const markdownConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
42
+
43
+ /**
44
+ * prettier配置
45
+ */
46
+ declare const prettierConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
47
+
48
+ /**
49
+ * regexp配置
50
+ */
51
+ declare const regexpConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
52
+
53
+ /**
54
+ * package.json 属性排序
55
+ */
56
+ declare const packageJsonSortConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
57
+
58
+ /**
59
+ * tsconfig.json 属性排序
60
+ */
61
+ declare const tsconfigJsonSortConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
62
+
63
+ /**
64
+ * TypeScript 核心配置
65
+ */
66
+ declare const typescriptCoreConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
67
+ /**
68
+ * TypeScript配置
69
+ */
70
+ declare const typescriptConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
71
+
72
+ /**
73
+ * vue配置
74
+ */
75
+ declare const vueConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
76
+
77
+ /**
78
+ * JS
79
+ */
80
+ declare const CONST_JS = "**/*.?([cm])js";
81
+ /**
82
+ * JSX
83
+ */
84
+ declare const CONST_JSX = "**/*.?([cm])jsx";
85
+ /**
86
+ * TS
87
+ */
88
+ declare const CONST_TS = "**/*.?([cm])ts";
89
+ /**
90
+ * TSX
91
+ */
92
+ declare const CONST_TSX = "**/*.?([cm])tsx";
93
+ /**
94
+ * JSON
95
+ */
96
+ declare const CONST_JSON = "**/*.json";
97
+ /**
98
+ * JSONC
99
+ */
100
+ declare const CONST_JSONC = "**/*.jsonc";
101
+ /**
102
+ * JSON5
103
+ */
104
+ declare const CONST_JSON5 = "**/*.json5";
105
+ /**
106
+ * JSON6
107
+ */
108
+ declare const CONST_JSON6 = "**/*.json6";
109
+ /**
110
+ * MD
111
+ */
112
+ declare const CONST_MD = "**/*.md";
113
+ /**
114
+ * VUE
115
+ */
116
+ declare const CONST_VUE = "**/*.vue";
117
+ /**
118
+ * YAML
119
+ */
120
+ declare const CONST_YAML = "**/*.y?(a)ml";
121
+ /**
122
+ * node_modules
123
+ */
124
+ declare const CONST_NODE_MODULES = "**/node_modules";
125
+ /**
126
+ * 打包目录 dist
127
+ */
128
+ declare const CONST_DIST = "**/dist";
129
+ /**
130
+ * 包管理 lock 文件
131
+ */
132
+ declare const CONST_LOCKFILE: string[];
133
+ /**
134
+ * public
135
+ */
136
+ declare const CONST_PUBLIC = "**/public";
137
+ /**
138
+ * TS 配置文件
139
+ */
140
+ declare const CONST_TSCONFIG: string[];
141
+
142
+ /**
143
+ * 是否包含 vue
144
+ */
145
+ declare const hasVue: boolean;
146
+ /**
147
+ * 是否为 vue3 版本
148
+ */
149
+ declare const isVue3: boolean;
150
+
151
+ declare const _default: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.Config[];
152
+
153
+ export { CONST_DIST, CONST_JS, CONST_JSON, CONST_JSON5, CONST_JSON6, CONST_JSONC, CONST_JSX, CONST_LOCKFILE, CONST_MD, CONST_NODE_MODULES, CONST_PUBLIC, CONST_TS, CONST_TSCONFIG, CONST_TSX, CONST_VUE, CONST_YAML, commonConfigs, _default as default, hasVue, ignoresConfigs, importConfigs, importUseLodashRules, importUseLodashUnifiedRules, isVue3, javascriptConfigs, jsonConfigs, markdownConfigs, packageJsonSortConfigs, prettierConfigs, regexpConfigs, tsconfigJsonSortConfigs, typescriptConfigs, typescriptCoreConfigs, vueConfigs };
@@ -0,0 +1,972 @@
1
+ // src/configs/common.ts
2
+ import tseslint from "typescript-eslint";
3
+ var commonConfigs = tseslint.config([
4
+ {
5
+ name: "@fast-china/common",
6
+ rules: {
7
+ // 确保数组的回调函数(如 Array.prototype.map、Array.prototype.filter、Array.prototype.reduce 等)总是有一个返回值
8
+ "array-callback-return": "error",
9
+ // 强制使用块级作用域变量(let 或 const),避免使用函数作用域变量(var)
10
+ "block-scoped-var": "error",
11
+ // 禁止使用 alert、confirm 和 prompt 等浏览器弹出对话框
12
+ "no-alert": "warn",
13
+ // 禁止在 switch 语句的 case 或 default 子句中声明变量
14
+ "no-case-declarations": "error",
15
+ // 禁止使用多行字符串,即不允许使用反斜杠 \ 来连接多行字符串
16
+ "no-multi-str": "error",
17
+ // 禁止使用 with 语句
18
+ "no-with": "error",
19
+ // 禁止使用 void 操作符
20
+ "no-void": "error",
21
+ // 禁止多个空行
22
+ "no-multiple-empty-lines": [
23
+ "error",
24
+ {
25
+ // 最多允许1行
26
+ max: 1
27
+ }
28
+ ],
29
+ // import 排序
30
+ "sort-imports": [
31
+ "warn",
32
+ {
33
+ // 不忽略导入语句中模块名的大小写
34
+ ignoreCase: false,
35
+ // 忽略导入声明的排序
36
+ ignoreDeclarationSort: true,
37
+ // 不忽略导入成员的排序
38
+ ignoreMemberSort: false,
39
+ // 成员语法排序顺序
40
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
41
+ // 不允许分组导入
42
+ allowSeparatedGroups: false
43
+ }
44
+ ],
45
+ // 强制在数学运算中使用 ** 运算符代替 Math.pow()
46
+ "prefer-exponentiation-operator": "error"
47
+ }
48
+ }
49
+ ]);
50
+
51
+ // src/configs/ignores.ts
52
+ import tseslint2 from "typescript-eslint";
53
+
54
+ // src/constants/index.ts
55
+ var CONST_JS = "**/*.?([cm])js";
56
+ var CONST_JSX = "**/*.?([cm])jsx";
57
+ var CONST_TS = "**/*.?([cm])ts";
58
+ var CONST_TSX = "**/*.?([cm])tsx";
59
+ var CONST_JSON = "**/*.json";
60
+ var CONST_JSONC = "**/*.jsonc";
61
+ var CONST_JSON5 = "**/*.json5";
62
+ var CONST_JSON6 = "**/*.json6";
63
+ var CONST_MD = "**/*.md";
64
+ var CONST_VUE = "**/*.vue";
65
+ var CONST_YAML = "**/*.y?(a)ml";
66
+ var CONST_NODE_MODULES = "**/node_modules";
67
+ var CONST_DIST = "**/dist";
68
+ var CONST_LOCKFILE = [
69
+ "**/package-lock.json",
70
+ "**/yarn.lock",
71
+ "**/pnpm-lock.yaml",
72
+ "**/bun.lockb"
73
+ ];
74
+ var CONST_PUBLIC = "**/public";
75
+ var CONST_TSCONFIG = ["**/tsconfig.json", "**/tsconfig.*.json"];
76
+
77
+ // src/configs/ignores.ts
78
+ import eslintConfigFlatGitignore from "eslint-config-flat-gitignore";
79
+ var ignoresConfigs = tseslint2.config([
80
+ {
81
+ name: "@fast-china/ignores/global",
82
+ ignores: [
83
+ CONST_NODE_MODULES,
84
+ CONST_DIST,
85
+ CONST_PUBLIC,
86
+ ...CONST_LOCKFILE,
87
+ "**/output",
88
+ "**/coverage",
89
+ "**/temp",
90
+ "**/fixtures",
91
+ "**/.vitepress/cache",
92
+ "**/.nuxt",
93
+ "**/.vercel",
94
+ "**/.changeset",
95
+ "**/.idea",
96
+ "**/.output",
97
+ "**/.vite-inspect",
98
+ "**/.nitro",
99
+ "**/CHANGELOG*.md",
100
+ "**/*.min.*",
101
+ "**/LICENSE*",
102
+ "**/__snapshots__",
103
+ "**/auto-import?(s).d.ts",
104
+ "**/components.d.ts"
105
+ ]
106
+ },
107
+ {
108
+ name: "@fast-china/ignores/git",
109
+ ...eslintConfigFlatGitignore({ strict: false })
110
+ }
111
+ ]);
112
+
113
+ // src/configs/import.ts
114
+ import tseslint3 from "typescript-eslint";
115
+ import eslintPluginImport from "eslint-plugin-import";
116
+ var importUseLodashUnifiedRules = {
117
+ // 限制某些模块导入
118
+ "no-restricted-imports": [
119
+ "error",
120
+ {
121
+ paths: [
122
+ { name: "lodash", message: "Use lodash-unified instead." },
123
+ { name: "lodash-es", message: "Use lodash-unified instead." }
124
+ ],
125
+ patterns: [
126
+ {
127
+ group: ["lodash/*", "lodash-es/*"],
128
+ message: "Use lodash-unified instead."
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ };
134
+ var importUseLodashRules = {
135
+ // 限制某些模块导入
136
+ "no-restricted-imports": [
137
+ "error",
138
+ {
139
+ paths: [
140
+ { name: "lodash-es", message: "Use lodash instead." },
141
+ { name: "lodash-unified", message: "Use lodash instead." }
142
+ ],
143
+ patterns: [
144
+ {
145
+ group: ["lodash-es/*", "lodash-unified/*"],
146
+ message: "Use lodash instead."
147
+ }
148
+ ]
149
+ }
150
+ ]
151
+ };
152
+ var importConfigs = tseslint3.config([
153
+ {
154
+ name: "@fast-china/import",
155
+ // 继承某些已有的规则
156
+ extends: [eslintPluginImport.flatConfigs.recommended],
157
+ settings: {
158
+ // 确保 ESLint 和 eslint-plugin-import 能够正确解析项目中的所有相关文件类型
159
+ "import/resolver": {
160
+ node: {
161
+ extensions: [CONST_JS, CONST_JSX, CONST_TS, CONST_TSX, ".d.ts"]
162
+ }
163
+ }
164
+ },
165
+ rules: {
166
+ // 确保所有的 import 语句位于文件的顶部,紧接在文件的开头部分,且在任何其他代码之前
167
+ "import/first": "error",
168
+ // 禁止在同一文件中出现重复的 import 语句
169
+ "import/no-duplicates": "error",
170
+ // 导入模块排序风格
171
+ "import/order": [
172
+ "error",
173
+ {
174
+ // 导入模块分组
175
+ groups: [
176
+ // Node.js 内置模块
177
+ "builtin",
178
+ // 第三方模块
179
+ "external",
180
+ // 项目内部模块
181
+ "internal",
182
+ // 父级目录中的模块
183
+ "parent",
184
+ // 具有相同父级的模块
185
+ "sibling",
186
+ // 当前目录的 index.js 或 index.ts 文件
187
+ "index",
188
+ "object",
189
+ "type",
190
+ "unknown"
191
+ ],
192
+ pathGroups: [
193
+ {
194
+ pattern: "vue",
195
+ group: "external",
196
+ position: "before"
197
+ },
198
+ {
199
+ pattern: "@vue/**",
200
+ group: "external",
201
+ position: "before"
202
+ },
203
+ {
204
+ pattern: "element-plus",
205
+ group: "external",
206
+ position: "before"
207
+ },
208
+ {
209
+ pattern: "@element-plus/**",
210
+ group: "external",
211
+ position: "before"
212
+ },
213
+ {
214
+ pattern: "fast-element-plus",
215
+ group: "external",
216
+ position: "before"
217
+ },
218
+ {
219
+ pattern: "@fast-element-plus/**",
220
+ group: "external",
221
+ position: "before"
222
+ },
223
+ {
224
+ pattern: "@fast-china/**",
225
+ group: "external",
226
+ position: "before"
227
+ }
228
+ ],
229
+ pathGroupsExcludedImportTypes: ["type"],
230
+ // 禁止不同组之间进行换行
231
+ "newlines-between": "never",
232
+ //根据字母顺序对每个组内的顺序进行排序
233
+ alphabetize: {
234
+ order: "asc",
235
+ caseInsensitive: true
236
+ }
237
+ }
238
+ ],
239
+ // 关闭 - 禁用对无法解析的模块导入的检查
240
+ "import/no-unresolved": "off",
241
+ // 关闭 - 禁用对命名空间导入(例如,import * as)的检查
242
+ "import/namespace": "off",
243
+ // 关闭 - 禁用对默认导入的检查
244
+ "import/default": "off",
245
+ // 关闭 - 禁用对以默认导出方式作为命名导入的检查
246
+ "import/no-named-as-default": "off",
247
+ // 关闭 - 禁用对将默认导出成员当作命名导入的检查
248
+ "import/no-named-as-default-member": "off",
249
+ // 关闭 - 禁用对命名导入(即从模块中导入特定命名的内容)的检查
250
+ "import/named": "off",
251
+ ...importUseLodashUnifiedRules
252
+ }
253
+ }
254
+ ]);
255
+
256
+ // src/configs/javascript.ts
257
+ import tseslint4 from "typescript-eslint";
258
+ import globals from "globals";
259
+ import eslint from "@eslint/js";
260
+ var javascriptConfigs = tseslint4.config([
261
+ {
262
+ name: "@fast-china/javascript",
263
+ // 继承某些已有的规则
264
+ extends: [eslint.configs.recommended],
265
+ languageOptions: {
266
+ // 允许使用最新的 ECMAScript 语法特性
267
+ ecmaVersion: "latest",
268
+ globals: {
269
+ ...globals.browser,
270
+ ...globals.es2022,
271
+ ...globals.node
272
+ },
273
+ parserOptions: {
274
+ // 允许使用 JSX 语法,适用于 Vue 组件中的 JSX 代码。
275
+ ecmaFeatures: {
276
+ jsx: true
277
+ },
278
+ sourceType: "module"
279
+ }
280
+ },
281
+ rules: {
282
+ // JS/TS (http://eslint.cn/docs/rules)
283
+ // 强制使用 camelCase 命名风格
284
+ camelcase: [
285
+ "error",
286
+ {
287
+ // 允许对象属性使用非 camelCase 风格
288
+ properties: "never"
289
+ }
290
+ ],
291
+ // 禁止使用控制台
292
+ "no-console": [
293
+ "warn",
294
+ {
295
+ // 允许除 warn/error 之外的其他 console.xx 方法
296
+ allow: ["warn", "error"]
297
+ }
298
+ ],
299
+ // 禁止使用 debugger
300
+ "no-debugger": "warn",
301
+ // 禁止在条件语句中使用常量条件
302
+ "no-constant-condition": [
303
+ "error",
304
+ {
305
+ // 允许在循环语句中使用常量条件
306
+ checkLoops: false
307
+ }
308
+ ],
309
+ // 禁止使用某些特定的语法
310
+ "no-restricted-syntax": [
311
+ "error",
312
+ // 禁止使用标记语句(labeled statements)
313
+ "LabeledStatement",
314
+ // 禁止使用 with 语句
315
+ "WithStatement"
316
+ ],
317
+ // 禁止在 return 语句中使用 await
318
+ "no-return-await": "error",
319
+ // 禁止使用 var 关键字,强制使用 let 或 const
320
+ "no-var": "error",
321
+ // 禁止使用空的块语句
322
+ "no-empty": [
323
+ "error",
324
+ {
325
+ // 允许空的 catch 块
326
+ allowEmptyCatch: true
327
+ }
328
+ ],
329
+ // 该规则禁止使用不规则或不标准的空白字符
330
+ "no-irregular-whitespace": "error",
331
+ // 禁止在函数或变量定义之前使用它们
332
+ "no-use-before-define": "warn",
333
+ // 强制使用 const 声明不被修改的变量
334
+ "prefer-const": [
335
+ "warn",
336
+ {
337
+ // 在解构赋值时也推荐使用 const
338
+ destructuring: "all",
339
+ // 允许在变量首次赋值前读取变量的值
340
+ ignoreReadBeforeAssign: true
341
+ }
342
+ ],
343
+ // 强制使用箭头函数而非普通函数
344
+ "prefer-arrow-callback": [
345
+ "error",
346
+ {
347
+ // 不允许使用命名函数作为回调函数
348
+ allowNamedFunctions: false,
349
+ // 允许在箭头函数中使用 this 绑定的上下文
350
+ allowUnboundThis: true
351
+ }
352
+ ],
353
+ // 强制使用对象字面量的方法和属性简写语法
354
+ "object-shorthand": [
355
+ "error",
356
+ "always",
357
+ {
358
+ // 不忽略构造函数中的属性简写
359
+ ignoreConstructors: false,
360
+ // 强制避免在属性名中使用引号
361
+ avoidQuotes: true
362
+ }
363
+ ],
364
+ // 强制使用 rest 参数代替 arguments 对象
365
+ "prefer-rest-params": "error",
366
+ // 强制使用展开运算符(...)代替 Function.prototype.apply
367
+ "prefer-spread": "error",
368
+ // 强制使用模板字面量代替字符串连接
369
+ "prefer-template": "error",
370
+ // 禁止在同一作用域中重新声明变量
371
+ "no-redeclare": "error"
372
+ }
373
+ },
374
+ {
375
+ name: "@fast-china/javascript/jsx",
376
+ files: [CONST_JSX],
377
+ rules: {
378
+ // 关闭 - 禁止使用未声明的变量,除非/*global *\/注释中提到
379
+ "no-undef": "off"
380
+ }
381
+ },
382
+ {
383
+ name: "@fast-china/javascript/md/js",
384
+ files: ["**/*.md/*.js"],
385
+ rules: {
386
+ // 使用使用控制台
387
+ "no-console": "off",
388
+ // 关闭 - 禁用对无法解析的模块导入的检查
389
+ "import/no-unresolved": "off"
390
+ }
391
+ },
392
+ {
393
+ name: "@fast-china/javascript/script",
394
+ files: ["**/scripts/*", "**/cli.*"],
395
+ rules: {
396
+ // 使用使用控制台
397
+ "no-console": "off"
398
+ }
399
+ }
400
+ ]);
401
+
402
+ // src/configs/json.ts
403
+ import tseslint5 from "typescript-eslint";
404
+ import eslintPluginJsonc from "eslint-plugin-jsonc";
405
+ import jsoncEslintParser from "jsonc-eslint-parser";
406
+ var jsonConfigs = tseslint5.config([
407
+ {
408
+ name: "@fast-china/json",
409
+ files: [CONST_JSON, CONST_JSONC, CONST_JSON5, CONST_JSON6],
410
+ // 继承某些已有的规则
411
+ extends: [...eslintPluginJsonc.configs["flat/recommended-with-jsonc"]],
412
+ languageOptions: {
413
+ parser: jsoncEslintParser
414
+ },
415
+ plugins: {
416
+ jsonc: eslintPluginJsonc
417
+ },
418
+ rules: {}
419
+ }
420
+ ]);
421
+
422
+ // src/configs/markdown.ts
423
+ import tseslint6 from "typescript-eslint";
424
+ import eslintPluginMarkdown from "eslint-plugin-markdown";
425
+ var markdownConfigs = tseslint6.config([
426
+ {
427
+ name: "@fast-china/markdown",
428
+ files: [CONST_MD],
429
+ rules: {}
430
+ },
431
+ ...eslintPluginMarkdown.configs.recommended.map((config) => ({
432
+ ...config,
433
+ name: `@fast-china/${config.name || "markdown/anonymous"}`
434
+ }))
435
+ ]);
436
+
437
+ // src/configs/prettier.ts
438
+ import tseslint7 from "typescript-eslint";
439
+ import eslintConfigPrettier from "eslint-config-prettier";
440
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
441
+ var prettierConfigs = tseslint7.config([
442
+ {
443
+ name: "@fast-china/prettier",
444
+ // 继承某些已有的规则
445
+ extends: [eslintPluginPrettierRecommended],
446
+ plugins: {
447
+ prettier: eslintConfigPrettier
448
+ },
449
+ rules: {
450
+ // 确保 Prettier 错误被 ESLint 捕获
451
+ "prettier/prettier": "error"
452
+ }
453
+ }
454
+ ]);
455
+
456
+ // src/configs/regexp.ts
457
+ import tseslint8 from "typescript-eslint";
458
+ import eslintPluginRegexp from "eslint-plugin-regexp";
459
+ var regexpConfigs = tseslint8.config([
460
+ {
461
+ name: "@fast-china/regexp",
462
+ ...eslintPluginRegexp.configs["flat/recommended"]
463
+ }
464
+ ]);
465
+
466
+ // src/configs/sort-package.ts
467
+ import tseslint9 from "typescript-eslint";
468
+ var packageJsonSortConfigs = tseslint9.config([
469
+ {
470
+ name: "@fast-china/sort/package",
471
+ files: ["**/package.json"],
472
+ rules: {
473
+ "jsonc/sort-array-values": [
474
+ "error",
475
+ {
476
+ order: { type: "asc" },
477
+ pathPattern: "^files$"
478
+ }
479
+ ],
480
+ "jsonc/sort-keys": [
481
+ "error",
482
+ {
483
+ order: [
484
+ "name",
485
+ "version",
486
+ "private",
487
+ "packageManager",
488
+ "description",
489
+ "type",
490
+ "keywords",
491
+ "license",
492
+ "homepage",
493
+ "bugs",
494
+ "repository",
495
+ "author",
496
+ "contributors",
497
+ "funding",
498
+ "files",
499
+ "main",
500
+ "module",
501
+ "types",
502
+ "exports",
503
+ "typesVersions",
504
+ "sideEffects",
505
+ "unpkg",
506
+ "jsdelivr",
507
+ "browser",
508
+ "bin",
509
+ "man",
510
+ "directories",
511
+ "publishConfig",
512
+ "scripts",
513
+ "peerDependencies",
514
+ "peerDependenciesMeta",
515
+ "optionalDependencies",
516
+ "dependencies",
517
+ "devDependencies",
518
+ "engines",
519
+ "config",
520
+ "overrides",
521
+ "pnpm",
522
+ "husky",
523
+ "lint-staged",
524
+ "eslintConfig",
525
+ "prettier"
526
+ ],
527
+ pathPattern: "^$"
528
+ },
529
+ {
530
+ order: { type: "asc" },
531
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
532
+ },
533
+ {
534
+ order: ["types", "require", "import", "default"],
535
+ pathPattern: "^exports.*$"
536
+ },
537
+ {
538
+ order: { type: "asc" },
539
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
540
+ }
541
+ ]
542
+ }
543
+ }
544
+ ]);
545
+
546
+ // src/configs/sort-tsconfig.ts
547
+ import tseslint10 from "typescript-eslint";
548
+ var tsconfigJsonSortConfigs = tseslint10.config([
549
+ {
550
+ name: "@fast-china/sort/tsconfig",
551
+ files: [CONST_TSCONFIG],
552
+ rules: {
553
+ "jsonc/sort-keys": [
554
+ "error",
555
+ {
556
+ order: [
557
+ "extends",
558
+ "compilerOptions",
559
+ "references",
560
+ "files",
561
+ "include",
562
+ "exclude"
563
+ ],
564
+ pathPattern: "^$"
565
+ },
566
+ {
567
+ order: [
568
+ /* Projects */
569
+ "incremental",
570
+ "composite",
571
+ "tsBuildInfoFile",
572
+ "disableSourceOfProjectReferenceRedirect",
573
+ "disableSolutionSearching",
574
+ "disableReferencedProjectLoad",
575
+ /* Language and Environment */
576
+ "target",
577
+ "jsx",
578
+ "jsxFactory",
579
+ "jsxFragmentFactory",
580
+ "jsxImportSource",
581
+ "lib",
582
+ "moduleDetection",
583
+ "noLib",
584
+ "reactNamespace",
585
+ "useDefineForClassFields",
586
+ "emitDecoratorMetadata",
587
+ "experimentalDecorators",
588
+ /* Modules */
589
+ "baseUrl",
590
+ "rootDir",
591
+ "rootDirs",
592
+ "customConditions",
593
+ "module",
594
+ "moduleResolution",
595
+ "moduleSuffixes",
596
+ "noResolve",
597
+ "paths",
598
+ "resolveJsonModule",
599
+ "resolvePackageJsonExports",
600
+ "resolvePackageJsonImports",
601
+ "typeRoots",
602
+ "types",
603
+ "allowArbitraryExtensions",
604
+ "allowImportingTsExtensions",
605
+ "allowUmdGlobalAccess",
606
+ /* JavaScript Support */
607
+ "allowJs",
608
+ "checkJs",
609
+ "maxNodeModuleJsDepth",
610
+ /* Type Checking */
611
+ "strict",
612
+ "strictBindCallApply",
613
+ "strictFunctionTypes",
614
+ "strictNullChecks",
615
+ "strictPropertyInitialization",
616
+ "allowUnreachableCode",
617
+ "allowUnusedLabels",
618
+ "alwaysStrict",
619
+ "exactOptionalPropertyTypes",
620
+ "noFallthroughCasesInSwitch",
621
+ "noImplicitAny",
622
+ "noImplicitOverride",
623
+ "noImplicitReturns",
624
+ "noImplicitThis",
625
+ "noPropertyAccessFromIndexSignature",
626
+ "noUncheckedIndexedAccess",
627
+ "noUnusedLocals",
628
+ "noUnusedParameters",
629
+ "useUnknownInCatchVariables",
630
+ /* Emit */
631
+ "declaration",
632
+ "declarationDir",
633
+ "declarationMap",
634
+ "downlevelIteration",
635
+ "emitBOM",
636
+ "emitDeclarationOnly",
637
+ "importHelpers",
638
+ "importsNotUsedAsValues",
639
+ "inlineSourceMap",
640
+ "inlineSources",
641
+ "isolatedDeclarations",
642
+ "mapRoot",
643
+ "newLine",
644
+ "noEmit",
645
+ "noEmitHelpers",
646
+ "noEmitOnError",
647
+ "outDir",
648
+ "outFile",
649
+ "preserveConstEnums",
650
+ "preserveValueImports",
651
+ "removeComments",
652
+ "sourceMap",
653
+ "sourceRoot",
654
+ "stripInternal",
655
+ /* Interop Constraints */
656
+ "allowSyntheticDefaultImports",
657
+ "esModuleInterop",
658
+ "forceConsistentCasingInFileNames",
659
+ "isolatedModules",
660
+ "preserveSymlinks",
661
+ "verbatimModuleSyntax",
662
+ /* Completeness */
663
+ "skipDefaultLibCheck",
664
+ "skipLibCheck"
665
+ ],
666
+ pathPattern: "^compilerOptions$"
667
+ }
668
+ ]
669
+ }
670
+ }
671
+ ]);
672
+
673
+ // src/configs/typescript.ts
674
+ import tseslint11 from "typescript-eslint";
675
+ var typescriptCoreConfigs = tseslint11.config([
676
+ {
677
+ name: "@fast-china/typescript",
678
+ files: [CONST_TS, CONST_TSX],
679
+ // 继承某些已有的规则
680
+ extends: [tseslint11.configs.recommended],
681
+ languageOptions: {
682
+ // 允许使用最新的 ECMAScript 语法特性
683
+ ecmaVersion: "latest",
684
+ parser: tseslint11.parser,
685
+ parserOptions: {
686
+ // 允许使用 TSX 语法,适用于 Vue 组件中的 TSX 代码。
687
+ ecmaFeatures: {
688
+ tsx: true
689
+ },
690
+ sourceType: "module"
691
+ }
692
+ },
693
+ rules: {
694
+ // TS (https://typescript-eslint.io/rules)
695
+ // 要求在导出函数和类的公共方法上显式声明返回类型
696
+ "@typescript-eslint/explicit-module-boundary-types": "off",
697
+ // 要求在 TypeScript 函数和方法中显式地指定返回类型
698
+ "@typescript-eslint/explicit-function-return-type": "error",
699
+ // 禁止在同一作用域中重新声明 TypeScript 变量
700
+ "@typescript-eslint/no-redeclare": "error",
701
+ // 允许定义未使用的变量
702
+ "@typescript-eslint/no-unused-vars": "off",
703
+ // 允许使用自定义TypeScript模块和命名空间
704
+ "@typescript-eslint/no-namespace": "off",
705
+ // 允许使用 any 类型
706
+ "@typescript-eslint/no-explicit-any": "off",
707
+ // 禁止在 TypeScript 文件中使用 require 函数进行模块导入
708
+ "@typescript-eslint/no-var-requires": "error",
709
+ // 禁止定义空函数
710
+ "@typescript-eslint/no-empty-function": "error",
711
+ // 禁止无用的表达式
712
+ "@typescript-eslint/no-unused-expressions": [
713
+ "error",
714
+ {
715
+ // 允许短路操作符(&& 和 ||)中的无副作用表达式
716
+ allowShortCircuit: true,
717
+ // 允许三元操作符中的无副作用表达式
718
+ allowTernary: true
719
+ }
720
+ ],
721
+ // 禁止在 TypeScript 代码中对类型已经可以被推断的变量或参数进行显式的类型注解
722
+ "@typescript-eslint/no-inferrable-types": "error",
723
+ // 禁止使用后缀运算符的非空断言(!)
724
+ "@typescript-eslint/no-non-null-assertion": "error",
725
+ // 禁止在可选链(?)后使用非空断言(!)
726
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
727
+ // 禁止在代码中使用 @ts-ignore 注释
728
+ "@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": false }],
729
+ // 一致地使用 TypeScript 类型导入
730
+ "@typescript-eslint/consistent-type-imports": [
731
+ "error",
732
+ {
733
+ // 允许使用类型注解
734
+ disallowTypeAnnotations: false
735
+ }
736
+ ]
737
+ }
738
+ }
739
+ ]);
740
+ var typescriptConfigs = tseslint11.config([
741
+ ...typescriptCoreConfigs,
742
+ {
743
+ name: "@fast-china/typescript/dts",
744
+ files: ["**/*.d.ts"],
745
+ rules: {
746
+ // 关闭 - 禁止在文件中重复导入相同的模块
747
+ "import/no-duplicates": "off",
748
+ // 关闭 - 一致地使用 TypeScript 类型导入
749
+ "@typescript-eslint/consistent-type-imports": "off"
750
+ }
751
+ },
752
+ {
753
+ name: "@fast-china/typescript/tsx",
754
+ files: [CONST_TSX],
755
+ rules: {
756
+ // 关闭 - 要求在 TypeScript 函数和方法中显式地指定返回类型
757
+ // "@typescript-eslint/explicit-function-return-type": "off",
758
+ }
759
+ },
760
+ {
761
+ name: "@fast-china/typescript/cjs",
762
+ files: [CONST_JS],
763
+ rules: {
764
+ // 关闭 - 不允许使用 require 语句
765
+ "@typescript-eslint/no-var-requires": "off",
766
+ "@typescript-eslint/no-require-imports": "off"
767
+ }
768
+ },
769
+ {
770
+ name: "@fast-china/typescript/md/js",
771
+ files: ["**/*.md/*.ts"],
772
+ rules: {
773
+ // 允许定义未使用的变量
774
+ "@typescript-eslint/no-unused-vars": "off"
775
+ }
776
+ }
777
+ ]);
778
+
779
+ // src/configs/vue.ts
780
+ import tseslint12 from "typescript-eslint";
781
+ import eslintPluginVue from "eslint-plugin-vue";
782
+ import vueEslintParser from "vue-eslint-parser";
783
+
784
+ // src/env/index.ts
785
+ import process from "node:process";
786
+ import { getPackageInfoSync } from "local-pkg";
787
+ import { isPackageExists } from "local-pkg";
788
+ var getVueVersion = () => {
789
+ const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
790
+ if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
791
+ return +pkg.version[0];
792
+ }
793
+ return 3;
794
+ };
795
+ var hasVue = isPackageExists("vue") || isPackageExists("nuxt");
796
+ var isVue3 = getVueVersion() === 3;
797
+
798
+ // src/configs/vue.ts
799
+ var vueConfigs = tseslint12.config([
800
+ {
801
+ name: "@fast-china/vue",
802
+ files: [CONST_VUE],
803
+ // 继承某些已有的规则
804
+ extends: [
805
+ ...isVue3 ? eslintPluginVue.configs["flat/recommended"] : eslintPluginVue.configs["flat/vue2-recommended"]
806
+ ],
807
+ languageOptions: {
808
+ parser: vueEslintParser,
809
+ parserOptions: {
810
+ // 允许在 Vue 文件中的脚本部分使用 TypeScript 语法
811
+ parser: "@typescript-eslint/parser",
812
+ // 指定额外的文件扩展名,告诉解析器 .vue 文件也需要处理
813
+ extraFileExtensions: [".vue"],
814
+ // 允许使用最新的 ECMAScript 语法特性
815
+ ecmaVersion: "latest",
816
+ // 允许使用 JSX/TSX 语法,适用于 Vue 组件中的 JSX/TSX 代码。
817
+ ecmaFeatures: {
818
+ jsx: true,
819
+ tsx: true
820
+ },
821
+ sourceType: "module"
822
+ }
823
+ },
824
+ plugins: {
825
+ "@typescript-eslint": tseslint12.plugin,
826
+ vue: vueEslintParser
827
+ },
828
+ processor: eslintPluginVue.processors[".vue"],
829
+ rules: {
830
+ // vue (https://eslint.vuejs.org/rules)
831
+ // 关闭 - 禁止使用未声明的变量,以避免在 .vue 文件中出现关于未定义变量的警告,这在 Vue 单文件组件中可能不适用或会导致不必要的警告
832
+ "no-undef": "off",
833
+ // 允许使用 v-html
834
+ "vue/no-v-html": "off",
835
+ // 禁用所有 props 必填时,必须提供默认值
836
+ "vue/require-default-prop": "off",
837
+ // 强制组件中必须使用 emits 选项声明事件
838
+ "vue/require-explicit-emits": "error",
839
+ // 禁用组件名称必须是多单词
840
+ "vue/multi-word-component-names": "off",
841
+ // 关闭 - 强制从 vue 中导入 Vue相关 API
842
+ "vue/prefer-import-from-vue": "off",
843
+ // 强制 HTML 属性使用 camelCase 风格
844
+ "vue/attribute-hyphenation": [
845
+ "error",
846
+ "always",
847
+ {
848
+ ignore: [
849
+ // 忽略 Element-Plus 加载文案"element-loading-text"
850
+ ]
851
+ }
852
+ ],
853
+ // 禁止重复的字段名
854
+ "vue/no-dupe-keys": "error",
855
+ // 禁止直接修改 props 的值
856
+ "vue/no-mutating-props": "error",
857
+ // 禁止使用 Vue.js 内置的保留组件名称(如 transition、keep-alive 等)作为自定义组件名称
858
+ "vue/no-reserved-component-names": "error",
859
+ // 禁止在自定义组件上使用 v-text 或 v-html 指令
860
+ "vue/no-v-text-v-html-on-component": "off",
861
+ // 防止<script setup>使用的变量<template>被标记为未使用,此规则仅在启用该no-unused-vars规则时有效。
862
+ // "vue/script-setup-uses-vars": "error",
863
+ // 强制自定义事件名称使用 camelCase 风格命名
864
+ "vue/custom-event-name-casing": ["error", "camelCase"],
865
+ // 强制每个 Vue 文件中只包含一个 Vue 组件
866
+ "vue/one-component-per-file": "off",
867
+ // 闭合标签换行风格
868
+ "vue/html-closing-bracket-newline": [
869
+ "error",
870
+ {
871
+ // 强制要求当 HTML 元素跨多行时,闭合标签必须出现在新的一行上
872
+ multiline: "always",
873
+ // 强制要求当 HTML 元素只有一行时,闭合标签应与开始标签在同一行上
874
+ singleline: "never"
875
+ }
876
+ ],
877
+ // 强制 Vue 模板中 HTML 元素的属性按照指定的顺序排列
878
+ "vue/attributes-order": [
879
+ "error",
880
+ {
881
+ order: [
882
+ "DEFINITION",
883
+ "LIST_RENDERING",
884
+ "CONDITIONALS",
885
+ "RENDER_MODIFIERS",
886
+ "GLOBAL",
887
+ "UNIQUE",
888
+ "OTHER_ATTR",
889
+ "EVENTS",
890
+ "CONTENT"
891
+ ]
892
+ }
893
+ ]
894
+ }
895
+ },
896
+ {
897
+ name: "@fast-china/vue/ts",
898
+ files: [CONST_VUE],
899
+ // 继承某些已有的规则
900
+ extends: [...typescriptCoreConfigs]
901
+ },
902
+ {
903
+ name: "@fast-china/reactivity",
904
+ languageOptions: {
905
+ globals: {
906
+ $: "readonly",
907
+ $$: "readonly",
908
+ $computed: "readonly",
909
+ $customRef: "readonly",
910
+ $ref: "readonly",
911
+ $shallowRef: "readonly",
912
+ $toRef: "readonly"
913
+ }
914
+ },
915
+ plugins: {
916
+ vue: eslintPluginVue
917
+ }
918
+ }
919
+ ]);
920
+
921
+ // src/flat/index.ts
922
+ var index_default = [
923
+ ...ignoresConfigs,
924
+ ...commonConfigs,
925
+ ...regexpConfigs,
926
+ ...javascriptConfigs,
927
+ ...typescriptConfigs,
928
+ ...importConfigs,
929
+ ...prettierConfigs,
930
+ ...packageJsonSortConfigs,
931
+ ...tsconfigJsonSortConfigs,
932
+ ...vueConfigs,
933
+ ...jsonConfigs,
934
+ ...markdownConfigs
935
+ ];
936
+ export {
937
+ CONST_DIST,
938
+ CONST_JS,
939
+ CONST_JSON,
940
+ CONST_JSON5,
941
+ CONST_JSON6,
942
+ CONST_JSONC,
943
+ CONST_JSX,
944
+ CONST_LOCKFILE,
945
+ CONST_MD,
946
+ CONST_NODE_MODULES,
947
+ CONST_PUBLIC,
948
+ CONST_TS,
949
+ CONST_TSCONFIG,
950
+ CONST_TSX,
951
+ CONST_VUE,
952
+ CONST_YAML,
953
+ commonConfigs,
954
+ index_default as default,
955
+ hasVue,
956
+ ignoresConfigs,
957
+ importConfigs,
958
+ importUseLodashRules,
959
+ importUseLodashUnifiedRules,
960
+ isVue3,
961
+ javascriptConfigs,
962
+ jsonConfigs,
963
+ markdownConfigs,
964
+ packageJsonSortConfigs,
965
+ prettierConfigs,
966
+ regexpConfigs,
967
+ tsconfigJsonSortConfigs,
968
+ typescriptConfigs,
969
+ typescriptCoreConfigs,
970
+ vueConfigs
971
+ };
972
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/configs/common.ts","../../src/configs/ignores.ts","../../src/constants/index.ts","../../src/configs/import.ts","../../src/configs/javascript.ts","../../src/configs/json.ts","../../src/configs/markdown.ts","../../src/configs/prettier.ts","../../src/configs/regexp.ts","../../src/configs/sort-package.ts","../../src/configs/sort-tsconfig.ts","../../src/configs/typescript.ts","../../src/configs/vue.ts","../../src/env/index.ts","../../src/flat/index.ts"],"sourcesContent":["import tseslint from \"typescript-eslint\";\n\n/**\n * 公共配置\n * @description 最佳实践\n */\nexport const commonConfigs = tseslint.config([\n {\n name: \"@fast-china/common\",\n rules: {\n // 确保数组的回调函数(如 Array.prototype.map、Array.prototype.filter、Array.prototype.reduce 等)总是有一个返回值\n \"array-callback-return\": \"error\",\n // 强制使用块级作用域变量(let 或 const),避免使用函数作用域变量(var)\n \"block-scoped-var\": \"error\",\n // 禁止使用 alert、confirm 和 prompt 等浏览器弹出对话框\n \"no-alert\": \"warn\",\n // 禁止在 switch 语句的 case 或 default 子句中声明变量\n \"no-case-declarations\": \"error\",\n // 禁止使用多行字符串,即不允许使用反斜杠 \\ 来连接多行字符串\n \"no-multi-str\": \"error\",\n // 禁止使用 with 语句\n \"no-with\": \"error\",\n // 禁止使用 void 操作符\n \"no-void\": \"error\",\n // 禁止多个空行\n \"no-multiple-empty-lines\": [\n \"error\",\n {\n // 最多允许1行\n max: 1,\n },\n ],\n\n // import 排序\n \"sort-imports\": [\n \"warn\",\n {\n // 不忽略导入语句中模块名的大小写\n ignoreCase: false,\n // 忽略导入声明的排序\n ignoreDeclarationSort: true,\n // 不忽略导入成员的排序\n ignoreMemberSort: false,\n // 成员语法排序顺序\n memberSyntaxSortOrder: [\"none\", \"all\", \"multiple\", \"single\"],\n // 不允许分组导入\n allowSeparatedGroups: false,\n },\n ],\n\n // 强制在数学运算中使用 ** 运算符代替 Math.pow()\n \"prefer-exponentiation-operator\": \"error\",\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport {\n CONST_DIST,\n CONST_LOCKFILE,\n CONST_NODE_MODULES,\n CONST_PUBLIC,\n} from \"../constants\";\nimport eslintConfigFlatGitignore from \"eslint-config-flat-gitignore\";\n\n/**\n * 忽略配置\n */\nexport const ignoresConfigs = tseslint.config([\n {\n name: \"@fast-china/ignores/global\",\n ignores: [\n CONST_NODE_MODULES,\n CONST_DIST,\n CONST_PUBLIC,\n ...CONST_LOCKFILE,\n\n \"**/output\",\n \"**/coverage\",\n \"**/temp\",\n \"**/fixtures\",\n \"**/.vitepress/cache\",\n \"**/.nuxt\",\n \"**/.vercel\",\n \"**/.changeset\",\n \"**/.idea\",\n \"**/.output\",\n \"**/.vite-inspect\",\n \"**/.nitro\",\n\n \"**/CHANGELOG*.md\",\n \"**/*.min.*\",\n \"**/LICENSE*\",\n \"**/__snapshots__\",\n \"**/auto-import?(s).d.ts\",\n \"**/components.d.ts\",\n ],\n },\n {\n name: \"@fast-china/ignores/git\",\n ...eslintConfigFlatGitignore({ strict: false }),\n },\n]);\n","/**\n * JS\n */\nexport const CONST_JS = \"**/*.?([cm])js\";\n\n/**\n * JSX\n */\nexport const CONST_JSX = \"**/*.?([cm])jsx\";\n\n/**\n * TS\n */\nexport const CONST_TS = \"**/*.?([cm])ts\";\n\n/**\n * TSX\n */\nexport const CONST_TSX = \"**/*.?([cm])tsx\";\n\n/**\n * JSON\n */\nexport const CONST_JSON = \"**/*.json\";\n\n/**\n * JSONC\n */\nexport const CONST_JSONC = \"**/*.jsonc\";\n\n/**\n * JSON5\n */\nexport const CONST_JSON5 = \"**/*.json5\";\n\n/**\n * JSON6\n */\nexport const CONST_JSON6 = \"**/*.json6\";\n\n/**\n * MD\n */\nexport const CONST_MD = \"**/*.md\";\n\n/**\n * VUE\n */\nexport const CONST_VUE = \"**/*.vue\";\n\n/**\n * YAML\n */\nexport const CONST_YAML = \"**/*.y?(a)ml\";\n\n/**\n * node_modules\n */\nexport const CONST_NODE_MODULES = \"**/node_modules\";\n\n/**\n * 打包目录 dist\n */\nexport const CONST_DIST = \"**/dist\";\n\n/**\n * 包管理 lock 文件\n */\nexport const CONST_LOCKFILE = [\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lockb\",\n];\n\n/**\n * public\n */\nexport const CONST_PUBLIC = \"**/public\";\n\n/**\n * TS 配置文件\n */\nexport const CONST_TSCONFIG = [\"**/tsconfig.json\", \"**/tsconfig.*.json\"];\n","// @ts-nocheck\nimport tseslint from \"typescript-eslint\";\nimport eslintPluginImport from \"eslint-plugin-import\";\nimport { CONST_JS, CONST_JSX, CONST_TS, CONST_TSX } from \"../constants\";\nimport { Linter } from \"eslint\";\n\n/**\n * 导入使用 lodash-unified 模块规则\n */\nexport const importUseLodashUnifiedRules: Linter.RulesRecord = {\n\t// 限制某些模块导入\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{ name: \"lodash\", message: \"Use lodash-unified instead.\" },\n\t\t\t\t{ name: \"lodash-es\", message: \"Use lodash-unified instead.\" },\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash/*\", \"lodash-es/*\"],\n\t\t\t\t\tmessage: \"Use lodash-unified instead.\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\n/**\n * 导入使用 lodash 模块规则\n */\nexport const importUseLodashRules: Linter.RulesRecord = {\n\t// 限制某些模块导入\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{ name: \"lodash-es\", message: \"Use lodash instead.\" },\n\t\t\t\t{ name: \"lodash-unified\", message: \"Use lodash instead.\" },\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash-es/*\", \"lodash-unified/*\"],\n\t\t\t\t\tmessage: \"Use lodash instead.\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\n/**\n * import配置\n */\nexport const importConfigs = tseslint.config([\n\t{\n\t\tname: \"@fast-china/import\",\n\t\t// 继承某些已有的规则\n\t\textends: [eslintPluginImport.flatConfigs.recommended],\n\t\tsettings: {\n\t\t\t// 确保 ESLint 和 eslint-plugin-import 能够正确解析项目中的所有相关文件类型\n\t\t\t\"import/resolver\": {\n\t\t\t\tnode: {\n\t\t\t\t\textensions: [CONST_JS, CONST_JSX, CONST_TS, CONST_TSX, \".d.ts\"],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t// 确保所有的 import 语句位于文件的顶部,紧接在文件的开头部分,且在任何其他代码之前\n\t\t\t\"import/first\": \"error\",\n\t\t\t// 禁止在同一文件中出现重复的 import 语句\n\t\t\t\"import/no-duplicates\": \"error\",\n\t\t\t// 导入模块排序风格\n\t\t\t\"import/order\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\t// 导入模块分组\n\t\t\t\t\tgroups: [\n\t\t\t\t\t\t// Node.js 内置模块\n\t\t\t\t\t\t\"builtin\",\n\t\t\t\t\t\t// 第三方模块\n\t\t\t\t\t\t\"external\",\n\t\t\t\t\t\t// 项目内部模块\n\t\t\t\t\t\t\"internal\",\n\t\t\t\t\t\t// 父级目录中的模块\n\t\t\t\t\t\t\"parent\",\n\t\t\t\t\t\t// 具有相同父级的模块\n\t\t\t\t\t\t\"sibling\",\n\t\t\t\t\t\t// 当前目录的 index.js 或 index.ts 文件\n\t\t\t\t\t\t\"index\",\n\t\t\t\t\t\t\"object\",\n\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\"unknown\",\n\t\t\t\t\t],\n\t\t\t\t\tpathGroups: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"vue\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"@vue/**\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"element-plus\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"@element-plus/**\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"fast-element-plus\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"@fast-element-plus/**\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: \"@fast-china/**\",\n\t\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tpathGroupsExcludedImportTypes: [\"type\"],\n\t\t\t\t\t// 禁止不同组之间进行换行\n\t\t\t\t\t\"newlines-between\": \"never\",\n\t\t\t\t\t//根据字母顺序对每个组内的顺序进行排序\n\t\t\t\t\talphabetize: {\n\t\t\t\t\t\torder: \"asc\",\n\t\t\t\t\t\tcaseInsensitive: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t// 关闭 - 禁用对无法解析的模块导入的检查\n\t\t\t\"import/no-unresolved\": \"off\",\n\t\t\t// 关闭 - 禁用对命名空间导入(例如,import * as)的检查\n\t\t\t\"import/namespace\": \"off\",\n\t\t\t// 关闭 - 禁用对默认导入的检查\n\t\t\t\"import/default\": \"off\",\n\t\t\t// 关闭 - 禁用对以默认导出方式作为命名导入的检查\n\t\t\t\"import/no-named-as-default\": \"off\",\n\t\t\t// 关闭 - 禁用对将默认导出成员当作命名导入的检查\n\t\t\t\"import/no-named-as-default-member\": \"off\",\n\t\t\t// 关闭 - 禁用对命名导入(即从模块中导入特定命名的内容)的检查\n\t\t\t\"import/named\": \"off\",\n\n\t\t\t...importUseLodashUnifiedRules,\n\t\t},\n\t},\n]);\n","import tseslint from \"typescript-eslint\";\nimport globals from \"globals\";\nimport eslint from \"@eslint/js\";\nimport { CONST_JSX } from \"../constants\";\n\n/**\n * JavaScript配置\n */\nexport const javascriptConfigs = tseslint.config([\n {\n name: \"@fast-china/javascript\",\n // 继承某些已有的规则\n extends: [eslint.configs.recommended],\n languageOptions: {\n // 允许使用最新的 ECMAScript 语法特性\n ecmaVersion: \"latest\",\n globals: {\n ...globals.browser,\n ...globals.es2022,\n ...globals.node,\n },\n parserOptions: {\n // 允许使用 JSX 语法,适用于 Vue 组件中的 JSX 代码。\n ecmaFeatures: {\n jsx: true,\n },\n sourceType: \"module\",\n },\n },\n rules: {\n // JS/TS (http://eslint.cn/docs/rules)\n\n // 强制使用 camelCase 命名风格\n camelcase: [\n \"error\",\n {\n // 允许对象属性使用非 camelCase 风格\n properties: \"never\",\n },\n ],\n // 禁止使用控制台\n \"no-console\": [\n \"warn\",\n {\n // 允许除 warn/error 之外的其他 console.xx 方法\n allow: [\"warn\", \"error\"],\n },\n ],\n // 禁止使用 debugger\n \"no-debugger\": \"warn\",\n // 禁止在条件语句中使用常量条件\n \"no-constant-condition\": [\n \"error\",\n {\n // 允许在循环语句中使用常量条件\n checkLoops: false,\n },\n ],\n // 禁止使用某些特定的语法\n \"no-restricted-syntax\": [\n \"error\",\n // 禁止使用标记语句(labeled statements)\n \"LabeledStatement\",\n // 禁止使用 with 语句\n \"WithStatement\",\n ],\n // 禁止在 return 语句中使用 await\n \"no-return-await\": \"error\",\n // 禁止使用 var 关键字,强制使用 let 或 const\n \"no-var\": \"error\",\n // 禁止使用空的块语句\n \"no-empty\": [\n \"error\",\n {\n // 允许空的 catch 块\n allowEmptyCatch: true,\n },\n ],\n // 该规则禁止使用不规则或不标准的空白字符\n \"no-irregular-whitespace\": \"error\",\n // 禁止在函数或变量定义之前使用它们\n \"no-use-before-define\": \"warn\",\n // 强制使用 const 声明不被修改的变量\n \"prefer-const\": [\n \"warn\",\n {\n // 在解构赋值时也推荐使用 const\n destructuring: \"all\",\n // 允许在变量首次赋值前读取变量的值\n ignoreReadBeforeAssign: true,\n },\n ],\n // 强制使用箭头函数而非普通函数\n \"prefer-arrow-callback\": [\n \"error\",\n {\n // 不允许使用命名函数作为回调函数\n allowNamedFunctions: false,\n // 允许在箭头函数中使用 this 绑定的上下文\n allowUnboundThis: true,\n },\n ],\n // 强制使用对象字面量的方法和属性简写语法\n \"object-shorthand\": [\n \"error\",\n \"always\",\n {\n // 不忽略构造函数中的属性简写\n ignoreConstructors: false,\n // 强制避免在属性名中使用引号\n avoidQuotes: true,\n },\n ],\n // 强制使用 rest 参数代替 arguments 对象\n \"prefer-rest-params\": \"error\",\n // 强制使用展开运算符(...)代替 Function.prototype.apply\n \"prefer-spread\": \"error\",\n // 强制使用模板字面量代替字符串连接\n \"prefer-template\": \"error\",\n // 禁止在同一作用域中重新声明变量\n \"no-redeclare\": \"error\",\n },\n },\n {\n name: \"@fast-china/javascript/jsx\",\n files: [CONST_JSX],\n rules: {\n // 关闭 - 禁止使用未声明的变量,除非/*global *\\/注释中提到\n \"no-undef\": \"off\",\n },\n },\n {\n name: \"@fast-china/javascript/md/js\",\n files: [\"**/*.md/*.js\"],\n rules: {\n // 使用使用控制台\n \"no-console\": \"off\",\n // 关闭 - 禁用对无法解析的模块导入的检查\n \"import/no-unresolved\": \"off\",\n },\n },\n {\n name: \"@fast-china/javascript/script\",\n files: [\"**/scripts/*\", \"**/cli.*\"],\n rules: {\n // 使用使用控制台\n \"no-console\": \"off\",\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport eslintPluginJsonc from \"eslint-plugin-jsonc\";\nimport {\n CONST_JSON,\n CONST_JSON5,\n CONST_JSON6,\n CONST_JSONC,\n} from \"../constants\";\nimport jsoncEslintParser from \"jsonc-eslint-parser\";\n\n/**\n * Json配置\n */\nexport const jsonConfigs = tseslint.config([\n {\n name: \"@fast-china/json\",\n files: [CONST_JSON, CONST_JSONC, CONST_JSON5, CONST_JSON6],\n // 继承某些已有的规则\n extends: [...eslintPluginJsonc.configs[\"flat/recommended-with-jsonc\"]],\n languageOptions: {\n parser: jsoncEslintParser,\n },\n plugins: {\n jsonc: eslintPluginJsonc,\n },\n rules: {},\n },\n]);\n","// @ts-nocheck\nimport tseslint from \"typescript-eslint\";\nimport eslintPluginMarkdown from \"eslint-plugin-markdown\";\nimport { CONST_MD } from \"../constants\";\n\n/**\n * markdown配置\n */\nexport const markdownConfigs = tseslint.config([\n\t{\n\t\tname: \"@fast-china/markdown\",\n\t\tfiles: [CONST_MD],\n\t\trules: {},\n\t},\n\t...eslintPluginMarkdown.configs.recommended.map((config) => ({\n\t\t...config,\n\t\tname: `@fast-china/${config.name || \"markdown/anonymous\"}`,\n\t})),\n]);\n","import tseslint from \"typescript-eslint\";\nimport eslintConfigPrettier from \"eslint-config-prettier\";\nimport eslintPluginPrettierRecommended from \"eslint-plugin-prettier/recommended\";\n\n/**\n * prettier配置\n */\nexport const prettierConfigs = tseslint.config([\n {\n name: \"@fast-china/prettier\",\n // 继承某些已有的规则\n extends: [eslintPluginPrettierRecommended],\n plugins: {\n prettier: eslintConfigPrettier as any,\n },\n rules: {\n // 确保 Prettier 错误被 ESLint 捕获\n \"prettier/prettier\": \"error\",\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport eslintPluginRegexp from \"eslint-plugin-regexp\";\n\n/**\n * regexp配置\n */\nexport const regexpConfigs = tseslint.config([\n {\n name: \"@fast-china/regexp\",\n ...eslintPluginRegexp.configs[\"flat/recommended\"],\n },\n]);\n","import tseslint from \"typescript-eslint\";\n\n/**\n * package.json 属性排序\n */\nexport const packageJsonSortConfigs = tseslint.config([\n {\n name: \"@fast-china/sort/package\",\n files: [\"**/package.json\"],\n rules: {\n \"jsonc/sort-array-values\": [\n \"error\",\n {\n order: { type: \"asc\" },\n pathPattern: \"^files$\",\n },\n ],\n \"jsonc/sort-keys\": [\n \"error\",\n {\n order: [\n \"name\",\n \"version\",\n \"private\",\n \"packageManager\",\n \"description\",\n \"type\",\n \"keywords\",\n \"license\",\n \"homepage\",\n \"bugs\",\n \"repository\",\n \"author\",\n \"contributors\",\n \"funding\",\n \"files\",\n \"main\",\n \"module\",\n \"types\",\n \"exports\",\n \"typesVersions\",\n \"sideEffects\",\n \"unpkg\",\n \"jsdelivr\",\n \"browser\",\n \"bin\",\n \"man\",\n \"directories\",\n \"publishConfig\",\n \"scripts\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"optionalDependencies\",\n \"dependencies\",\n \"devDependencies\",\n \"engines\",\n \"config\",\n \"overrides\",\n \"pnpm\",\n \"husky\",\n \"lint-staged\",\n \"eslintConfig\",\n \"prettier\",\n ],\n pathPattern: \"^$\",\n },\n {\n order: { type: \"asc\" },\n pathPattern: \"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$\",\n },\n {\n order: [\"types\", \"require\", \"import\", \"default\"],\n pathPattern: \"^exports.*$\",\n },\n {\n order: { type: \"asc\" },\n pathPattern: \"^(?:resolutions|overrides|pnpm.overrides)$\",\n },\n ],\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport { CONST_TSCONFIG } from \"../constants\";\n\n/**\n * tsconfig.json 属性排序\n */\nexport const tsconfigJsonSortConfigs = tseslint.config([\n {\n name: \"@fast-china/sort/tsconfig\",\n files: [CONST_TSCONFIG],\n rules: {\n \"jsonc/sort-keys\": [\n \"error\",\n {\n order: [\n \"extends\",\n \"compilerOptions\",\n \"references\",\n \"files\",\n \"include\",\n \"exclude\",\n ],\n pathPattern: \"^$\",\n },\n {\n order: [\n /* Projects */\n \"incremental\",\n \"composite\",\n \"tsBuildInfoFile\",\n \"disableSourceOfProjectReferenceRedirect\",\n \"disableSolutionSearching\",\n \"disableReferencedProjectLoad\",\n /* Language and Environment */\n \"target\",\n \"jsx\",\n \"jsxFactory\",\n \"jsxFragmentFactory\",\n \"jsxImportSource\",\n \"lib\",\n \"moduleDetection\",\n \"noLib\",\n \"reactNamespace\",\n \"useDefineForClassFields\",\n \"emitDecoratorMetadata\",\n \"experimentalDecorators\",\n /* Modules */\n \"baseUrl\",\n \"rootDir\",\n \"rootDirs\",\n \"customConditions\",\n \"module\",\n \"moduleResolution\",\n \"moduleSuffixes\",\n \"noResolve\",\n \"paths\",\n \"resolveJsonModule\",\n \"resolvePackageJsonExports\",\n \"resolvePackageJsonImports\",\n \"typeRoots\",\n \"types\",\n \"allowArbitraryExtensions\",\n \"allowImportingTsExtensions\",\n \"allowUmdGlobalAccess\",\n /* JavaScript Support */\n \"allowJs\",\n \"checkJs\",\n \"maxNodeModuleJsDepth\",\n /* Type Checking */\n \"strict\",\n \"strictBindCallApply\",\n \"strictFunctionTypes\",\n \"strictNullChecks\",\n \"strictPropertyInitialization\",\n \"allowUnreachableCode\",\n \"allowUnusedLabels\",\n \"alwaysStrict\",\n \"exactOptionalPropertyTypes\",\n \"noFallthroughCasesInSwitch\",\n \"noImplicitAny\",\n \"noImplicitOverride\",\n \"noImplicitReturns\",\n \"noImplicitThis\",\n \"noPropertyAccessFromIndexSignature\",\n \"noUncheckedIndexedAccess\",\n \"noUnusedLocals\",\n \"noUnusedParameters\",\n \"useUnknownInCatchVariables\",\n /* Emit */\n \"declaration\",\n \"declarationDir\",\n \"declarationMap\",\n \"downlevelIteration\",\n \"emitBOM\",\n \"emitDeclarationOnly\",\n \"importHelpers\",\n \"importsNotUsedAsValues\",\n \"inlineSourceMap\",\n \"inlineSources\",\n \"isolatedDeclarations\",\n \"mapRoot\",\n \"newLine\",\n \"noEmit\",\n \"noEmitHelpers\",\n \"noEmitOnError\",\n \"outDir\",\n \"outFile\",\n \"preserveConstEnums\",\n \"preserveValueImports\",\n \"removeComments\",\n \"sourceMap\",\n \"sourceRoot\",\n \"stripInternal\",\n /* Interop Constraints */\n \"allowSyntheticDefaultImports\",\n \"esModuleInterop\",\n \"forceConsistentCasingInFileNames\",\n \"isolatedModules\",\n \"preserveSymlinks\",\n \"verbatimModuleSyntax\",\n /* Completeness */\n \"skipDefaultLibCheck\",\n \"skipLibCheck\",\n ],\n pathPattern: \"^compilerOptions$\",\n },\n ],\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport { CONST_JS, CONST_TS, CONST_TSX } from \"../constants\";\n\n/**\n * TypeScript 核心配置\n */\nexport const typescriptCoreConfigs = tseslint.config([\n {\n name: \"@fast-china/typescript\",\n files: [CONST_TS, CONST_TSX],\n // 继承某些已有的规则\n extends: [tseslint.configs.recommended],\n languageOptions: {\n // 允许使用最新的 ECMAScript 语法特性\n ecmaVersion: \"latest\",\n parser: tseslint.parser,\n parserOptions: {\n // 允许使用 TSX 语法,适用于 Vue 组件中的 TSX 代码。\n ecmaFeatures: {\n tsx: true,\n },\n sourceType: \"module\",\n },\n },\n rules: {\n // TS (https://typescript-eslint.io/rules)\n\n // 要求在导出函数和类的公共方法上显式声明返回类型\n \"@typescript-eslint/explicit-module-boundary-types\": \"off\",\n // 要求在 TypeScript 函数和方法中显式地指定返回类型\n \"@typescript-eslint/explicit-function-return-type\": \"error\",\n // 禁止在同一作用域中重新声明 TypeScript 变量\n \"@typescript-eslint/no-redeclare\": \"error\",\n // 允许定义未使用的变量\n \"@typescript-eslint/no-unused-vars\": \"off\",\n // 允许使用自定义TypeScript模块和命名空间\n \"@typescript-eslint/no-namespace\": \"off\",\n // 允许使用 any 类型\n \"@typescript-eslint/no-explicit-any\": \"off\",\n // 禁止在 TypeScript 文件中使用 require 函数进行模块导入\n \"@typescript-eslint/no-var-requires\": \"error\",\n // 禁止定义空函数\n \"@typescript-eslint/no-empty-function\": \"error\",\n // 禁止无用的表达式\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n // 允许短路操作符(&& 和 ||)中的无副作用表达式\n allowShortCircuit: true,\n // 允许三元操作符中的无副作用表达式\n allowTernary: true,\n },\n ],\n // 禁止在 TypeScript 代码中对类型已经可以被推断的变量或参数进行显式的类型注解\n \"@typescript-eslint/no-inferrable-types\": \"error\",\n // 禁止使用后缀运算符的非空断言(!)\n \"@typescript-eslint/no-non-null-assertion\": \"error\",\n // 禁止在可选链(?)后使用非空断言(!)\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"error\",\n // 禁止在代码中使用 @ts-ignore 注释\n \"@typescript-eslint/ban-ts-comment\": [\"error\", { \"ts-ignore\": false }],\n // 一致地使用 TypeScript 类型导入\n \"@typescript-eslint/consistent-type-imports\": [\n \"error\",\n {\n // 允许使用类型注解\n disallowTypeAnnotations: false,\n },\n ],\n },\n },\n]);\n\n/**\n * TypeScript配置\n */\nexport const typescriptConfigs = tseslint.config([\n ...typescriptCoreConfigs,\n {\n name: \"@fast-china/typescript/dts\",\n files: [\"**/*.d.ts\"],\n rules: {\n // 关闭 - 禁止在文件中重复导入相同的模块\n \"import/no-duplicates\": \"off\",\n // 关闭 - 一致地使用 TypeScript 类型导入\n \"@typescript-eslint/consistent-type-imports\": \"off\",\n },\n },\n {\n name: \"@fast-china/typescript/tsx\",\n files: [CONST_TSX],\n rules: {\n // 关闭 - 要求在 TypeScript 函数和方法中显式地指定返回类型\n // \"@typescript-eslint/explicit-function-return-type\": \"off\",\n },\n },\n {\n name: \"@fast-china/typescript/cjs\",\n files: [CONST_JS],\n rules: {\n // 关闭 - 不允许使用 require 语句\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n },\n },\n {\n name: \"@fast-china/typescript/md/js\",\n files: [\"**/*.md/*.ts\"],\n rules: {\n // 允许定义未使用的变量\n \"@typescript-eslint/no-unused-vars\": \"off\",\n },\n },\n]);\n","import tseslint from \"typescript-eslint\";\nimport eslintPluginVue from \"eslint-plugin-vue\";\nimport vueEslintParser from \"vue-eslint-parser\";\nimport { CONST_VUE } from \"../constants\";\nimport { typescriptCoreConfigs } from \"./typescript\";\nimport { isVue3 } from \"../env\";\n\n/**\n * vue配置\n */\nexport const vueConfigs = tseslint.config([\n {\n name: \"@fast-china/vue\",\n files: [CONST_VUE],\n // 继承某些已有的规则\n extends: [\n ...(isVue3\n ? eslintPluginVue.configs[\"flat/recommended\"]\n : eslintPluginVue.configs[\"flat/vue2-recommended\"]),\n ],\n languageOptions: {\n parser: vueEslintParser,\n parserOptions: {\n // 允许在 Vue 文件中的脚本部分使用 TypeScript 语法\n parser: \"@typescript-eslint/parser\",\n // 指定额外的文件扩展名,告诉解析器 .vue 文件也需要处理\n extraFileExtensions: [\".vue\"],\n // 允许使用最新的 ECMAScript 语法特性\n ecmaVersion: \"latest\",\n // 允许使用 JSX/TSX 语法,适用于 Vue 组件中的 JSX/TSX 代码。\n ecmaFeatures: {\n jsx: true,\n tsx: true,\n },\n sourceType: \"module\",\n },\n },\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n vue: vueEslintParser,\n },\n processor: eslintPluginVue.processors[\".vue\"],\n rules: {\n // vue (https://eslint.vuejs.org/rules)\n\n // 关闭 - 禁止使用未声明的变量,以避免在 .vue 文件中出现关于未定义变量的警告,这在 Vue 单文件组件中可能不适用或会导致不必要的警告\n \"no-undef\": \"off\",\n\n // 允许使用 v-html\n \"vue/no-v-html\": \"off\",\n // 禁用所有 props 必填时,必须提供默认值\n \"vue/require-default-prop\": \"off\",\n // 强制组件中必须使用 emits 选项声明事件\n \"vue/require-explicit-emits\": \"error\",\n // 禁用组件名称必须是多单词\n \"vue/multi-word-component-names\": \"off\",\n // 关闭 - 强制从 vue 中导入 Vue相关 API\n \"vue/prefer-import-from-vue\": \"off\",\n // 强制 HTML 属性使用 camelCase 风格\n \"vue/attribute-hyphenation\": [\n \"error\",\n \"always\",\n {\n ignore: [\n // 忽略 Element-Plus 加载文案\"element-loading-text\"\n ],\n },\n ],\n\n // 禁止重复的字段名\n \"vue/no-dupe-keys\": \"error\",\n // 禁止直接修改 props 的值\n \"vue/no-mutating-props\": \"error\",\n // 禁止使用 Vue.js 内置的保留组件名称(如 transition、keep-alive 等)作为自定义组件名称\n \"vue/no-reserved-component-names\": \"error\",\n // 禁止在自定义组件上使用 v-text 或 v-html 指令\n \"vue/no-v-text-v-html-on-component\": \"off\",\n // 防止<script setup>使用的变量<template>被标记为未使用,此规则仅在启用该no-unused-vars规则时有效。\n // \"vue/script-setup-uses-vars\": \"error\",\n // 强制自定义事件名称使用 camelCase 风格命名\n \"vue/custom-event-name-casing\": [\"error\", \"camelCase\"],\n // 强制每个 Vue 文件中只包含一个 Vue 组件\n \"vue/one-component-per-file\": \"off\",\n // 闭合标签换行风格\n \"vue/html-closing-bracket-newline\": [\n \"error\",\n {\n // 强制要求当 HTML 元素跨多行时,闭合标签必须出现在新的一行上\n multiline: \"always\",\n // 强制要求当 HTML 元素只有一行时,闭合标签应与开始标签在同一行上\n singleline: \"never\",\n },\n ],\n // 强制 Vue 模板中 HTML 元素的属性按照指定的顺序排列\n \"vue/attributes-order\": [\n \"error\",\n {\n order: [\n \"DEFINITION\",\n \"LIST_RENDERING\",\n \"CONDITIONALS\",\n \"RENDER_MODIFIERS\",\n \"GLOBAL\",\n \"UNIQUE\",\n \"OTHER_ATTR\",\n \"EVENTS\",\n \"CONTENT\",\n ],\n },\n ],\n },\n },\n {\n name: \"@fast-china/vue/ts\",\n files: [CONST_VUE],\n // 继承某些已有的规则\n extends: [...typescriptCoreConfigs],\n },\n {\n name: \"@fast-china/reactivity\",\n languageOptions: {\n globals: {\n $: \"readonly\",\n $$: \"readonly\",\n $computed: \"readonly\",\n $customRef: \"readonly\",\n $ref: \"readonly\",\n $shallowRef: \"readonly\",\n $toRef: \"readonly\",\n },\n },\n plugins: {\n vue: eslintPluginVue,\n },\n },\n]);\n","import process from \"node:process\";\nimport { getPackageInfoSync } from \"local-pkg\";\nimport { isPackageExists } from \"local-pkg\";\n\nconst getVueVersion = () => {\n\tconst pkg = getPackageInfoSync(\"vue\", { paths: [process.cwd()] });\n\tif (pkg && typeof pkg.version === \"string\" && !Number.isNaN(+pkg.version[0])) {\n\t\treturn +pkg.version[0];\n\t}\n\treturn 3;\n};\n\n/**\n * 是否包含 vue\n */\nexport const hasVue = isPackageExists(\"vue\") || isPackageExists(\"nuxt\");\n\n/**\n * 是否为 vue3 版本\n */\nexport const isVue3 = getVueVersion() === 3;\n","import { commonConfigs } from \"../configs/common\";\nimport { ignoresConfigs } from \"../configs/ignores\";\nimport { importConfigs } from \"../configs/import\";\nimport { javascriptConfigs } from \"../configs/javascript\";\nimport { jsonConfigs } from \"../configs/json\";\nimport { markdownConfigs } from \"../configs/markdown\";\nimport { prettierConfigs } from \"../configs/prettier\";\nimport { regexpConfigs } from \"../configs/regexp\";\nimport { packageJsonSortConfigs } from \"../configs/sort-package\";\nimport { tsconfigJsonSortConfigs } from \"../configs/sort-tsconfig\";\nimport { typescriptConfigs } from \"../configs/typescript\";\nimport { vueConfigs } from \"../configs/vue\";\n\nexport * from \"../configs/common\";\nexport * from \"../configs/ignores\";\nexport * from \"../configs/import\";\nexport * from \"../configs/javascript\";\nexport * from \"../configs/json\";\nexport * from \"../configs/markdown\";\nexport * from \"../configs/prettier\";\nexport * from \"../configs/regexp\";\nexport * from \"../configs/sort-package\";\nexport * from \"../configs/sort-tsconfig\";\nexport * from \"../configs/typescript\";\nexport * from \"../configs/vue\";\n\nexport * from \"../constants\";\nexport * from \"../env\";\n\nexport default [\n\t...ignoresConfigs,\n\t...commonConfigs,\n\t...regexpConfigs,\n\t...javascriptConfigs,\n\t...typescriptConfigs,\n\t...importConfigs,\n\t...prettierConfigs,\n\t...packageJsonSortConfigs,\n\t...tsconfigJsonSortConfigs,\n\t...vueConfigs,\n\t...jsonConfigs,\n\t...markdownConfigs,\n];\n"],"mappings":";AAAA,OAAO,cAAc;AAMd,IAAM,gBAAgB,SAAS,OAAO;AAAA,EAC3C;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,MAEL,yBAAy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AA,MAIrC,gCAAgC,CAAC,SAAS,WAAW;AAAA;AAAA,MAErD,8BAA8B;AAAA;AAAA,MAE9B,oCAAoC;AAAA,QAClC;AAAA,QACA;AAAA;AAAA,UAEE,WAAW;AAAA;AAAA,UAEX,YAAY;AAAA,QACd;AAAA,MACF;AAAA;AAAA,MAEA,wBAAwB;AAAA,QACtB;AAAA,QACA;AAAA,UACE,OAAO;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,SAAS;AAAA;AAAA,IAEjB,SAAS,CAAC,GAAG,qBAAqB;AAAA,EACpC;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,iBAAiB;AAAA,MACf,SAAS;AAAA,QACP,GAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW;AAAA,QACX,YAAY;AAAA,QACZ,MAAM;AAAA,QACN,aAAa;AAAA,QACb,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF,CAAC;;;AE1GD,IAAO,gBAAQ;AAAA,EACd,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACJ;","names":["tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint"]}
@@ -0,0 +1,5 @@
1
+ import * as eslint_define_config from 'eslint-define-config';
2
+
3
+ declare const _default: eslint_define_config.ESLintConfig;
4
+
5
+ export { _default as default };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { defineConfig } from \"eslint-define-config\";\n\nexport default defineConfig({\n\tenv: {\n\t\tes6: true,\n\t\tbrowser: true,\n\t\tnode: true,\n\t},\n\tplugins: [\"@typescript-eslint\", \"prettier\"],\n\t// 继承某些已有的规则\n\textends: [\n\t\t\"eslint:recommended\",\n\t\t\"plugin:import/recommended\",\n\t\t\"plugin:jsonc/recommended-with-jsonc\",\n\t\t\"plugin:markdown/recommended-legacy\",\n\t\t\"plugin:vue/vue3-recommended\",\n\t\t\"plugin:@typescript-eslint/recommended\",\n\t\t\"prettier\",\n\t],\n\tsettings: {\n\t\t// 确保 ESLint 和 eslint-plugin-import 能够正确解析项目中的所有相关文件类型\n\t\t\"import/resolver\": {\n\t\t\tnode: {\n\t\t\t\textensions: [\".js\", \".mjs\", \".cjs\", \".jsx\", \".ts\", \".mts\", \".tsx\", \".d.ts\"],\n\t\t\t},\n\t\t},\n\t},\n\toverrides: [\n\t\t{\n\t\t\tfiles: [\"*.ts\", \"*.vue\", \"*.tsx\"],\n\t\t\trules: {\n\t\t\t\t// 关闭 - 禁止使用未声明的变量,除非/*global *\\/注释中提到\n\t\t\t\t\"no-undef\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.d.ts\"],\n\t\t\trules: {\n\t\t\t\t// 关闭 - 禁止在文件中重复导入相同的模块\n\t\t\t\t\"import/no-duplicates\": \"off\",\n\t\t\t\t// 关闭 - 一致地使用 TypeScript 类型导入\n\t\t\t\t\"@typescript-eslint/consistent-type-imports\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.js\"],\n\t\t\trules: {\n\t\t\t\t// 关闭 - 不允许使用 require 语句\n\t\t\t\t\"@typescript-eslint/no-var-requires\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.cjs\"],\n\t\t\trules: {\n\t\t\t\t// 关闭 - 不允许使用 require 语句\n\t\t\t\t\"@typescript-eslint/no-var-requires\": \"off\",\n\t\t\t\t\"@typescript-eslint/no-require-imports\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.tsx\"],\n\t\t\trules: {\n\t\t\t\t// 关闭 - 要求在 TypeScript 函数和方法中显式地指定返回类型\n\t\t\t\t// \"@typescript-eslint/explicit-function-return-type\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"**/*.md/*.js\", \"**/*.md/*.ts\"],\n\t\t\trules: {\n\t\t\t\t// 使用使用控制台\n\t\t\t\t\"no-console\": \"off\",\n\t\t\t\t// 关闭 - 禁用对无法解析的模块导入的检查\n\t\t\t\t\"import/no-unresolved\": \"off\",\n\t\t\t\t// 允许定义未使用的变量\n\t\t\t\t\"@typescript-eslint/no-unused-vars\": \"off\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.json\", \"*.json5\", \"*.jsonc\"],\n\t\t\t// 允许 ESLint 处理 JSON 文件中的模板和脚本\n\t\t\tparser: \"jsonc-eslint-parser\",\n\t\t},\n\t\t{\n\t\t\tfiles: [\"*.vue\"],\n\t\t\t// 允许 ESLint 处理 Vue 文件中的模板和脚本\n\t\t\tparser: \"vue-eslint-parser\",\n\t\t\tparserOptions: {\n\t\t\t\t// 允许在 Vue 文件中的脚本部分使用 TypeScript 语法\n\t\t\t\tparser: \"@typescript-eslint/parser\",\n\t\t\t\t// 指定额外的文件扩展名,告诉解析器 .vue 文件也需要处理\n\t\t\t\textraFileExtensions: [\".vue\"],\n\t\t\t\t// 允许使用最新的 ECMAScript 语法特性\n\t\t\t\tecmaVersion: \"latest\",\n\t\t\t\t// 允许使用 JSX/TSX 语法,适用于 Vue 组件中的 JSX/TSX 代码。\n\t\t\t\tecmaFeatures: {\n\t\t\t\t\tjsx: true,\n\t\t\t\t\ttsx: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t// 关闭 - 禁止使用未声明的变量,以避免在 .vue 文件中出现关于未定义变量的警告,这在 Vue 单文件组件中可能不适用或会导致不必要的警告\n\t\t\t\t\"no-undef\": \"off\",\n\t\t\t},\n\t\t},\n\t],\n\t/**\n\t * \"off\" 或 0 ==> 关闭规则\n\t * \"warn\" 或 1 ==> 打开的规则作为警告(不影响代码执行)\n\t * \"error\" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错)\n\t */\n\trules: {\n\t\t// JS/TS (http://eslint.cn/docs/rules)\n\n\t\t// 强制使用 camelCase 命名风格\n\t\tcamelcase: [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 允许对象属性使用非 camelCase 风格\n\t\t\t\tproperties: \"never\",\n\t\t\t},\n\t\t],\n\t\t// 禁止使用控制台\n\t\t\"no-console\": [\n\t\t\t\"warn\",\n\t\t\t{\n\t\t\t\t// 允许除 warn/error 之外的其他 console.xx 方法\n\t\t\t\tallow: [\"warn\", \"error\"],\n\t\t\t},\n\t\t],\n\t\t// 禁止使用 debugger\n\t\t\"no-debugger\": \"warn\",\n\t\t// 禁止在条件语句中使用常量条件\n\t\t\"no-constant-condition\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 允许在循环语句中使用常量条件\n\t\t\t\tcheckLoops: false,\n\t\t\t},\n\t\t],\n\t\t// 禁止使用某些特定的语法\n\t\t\"no-restricted-syntax\": [\n\t\t\t\"error\",\n\t\t\t// 禁止使用标记语句(labeled statements)\n\t\t\t\"LabeledStatement\",\n\t\t\t// 禁止使用 with 语句\n\t\t\t\"WithStatement\",\n\t\t],\n\t\t// 禁止在 return 语句中使用 await\n\t\t\"no-return-await\": \"error\",\n\t\t// 禁止使用 var 关键字,强制使用 let 或 const\n\t\t\"no-var\": \"error\",\n\t\t// 禁止使用空的块语句\n\t\t\"no-empty\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 允许空的 catch 块\n\t\t\t\tallowEmptyCatch: true,\n\t\t\t},\n\t\t],\n\t\t// 该规则禁止使用不规则或不标准的空白字符\n\t\t\"no-irregular-whitespace\": \"error\",\n\t\t// 禁止在函数或变量定义之前使用它们\n\t\t\"no-use-before-define\": \"warn\",\n\t\t// 强制使用 const 声明不被修改的变量\n\t\t\"prefer-const\": [\n\t\t\t\"warn\",\n\t\t\t{\n\t\t\t\t// 在解构赋值时也推荐使用 const\n\t\t\t\tdestructuring: \"all\",\n\t\t\t\t// 允许在变量首次赋值前读取变量的值\n\t\t\t\tignoreReadBeforeAssign: true,\n\t\t\t},\n\t\t],\n\t\t// 强制使用箭头函数而非普通函数\n\t\t\"prefer-arrow-callback\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 不允许使用命名函数作为回调函数\n\t\t\t\tallowNamedFunctions: false,\n\t\t\t\t// 允许在箭头函数中使用 this 绑定的上下文\n\t\t\t\tallowUnboundThis: true,\n\t\t\t},\n\t\t],\n\t\t// 强制使用对象字面量的方法和属性简写语法\n\t\t\"object-shorthand\": [\n\t\t\t\"error\",\n\t\t\t\"always\",\n\t\t\t{\n\t\t\t\t// 不忽略构造函数中的属性简写\n\t\t\t\tignoreConstructors: false,\n\t\t\t\t// 强制避免在属性名中使用引号\n\t\t\t\tavoidQuotes: true,\n\t\t\t},\n\t\t],\n\t\t// 强制使用 rest 参数代替 arguments 对象\n\t\t\"prefer-rest-params\": \"error\",\n\t\t// 强制使用展开运算符(...)代替 Function.prototype.apply\n\t\t\"prefer-spread\": \"error\",\n\t\t// 强制使用模板字面量代替字符串连接\n\t\t\"prefer-template\": \"error\",\n\t\t// 禁止在同一作用域中重新声明变量\n\t\t\"no-redeclare\": \"error\",\n\n\t\t// TS (https://typescript-eslint.io/rules)\n\n\t\t// 要求在导出函数和类的公共方法上显式声明返回类型\n\t\t\"@typescript-eslint/explicit-module-boundary-types\": \"off\",\n\t\t// 要求在 TypeScript 函数和方法中显式地指定返回类型\n\t\t\"@typescript-eslint/explicit-function-return-type\": \"error\",\n\t\t// 禁止在同一作用域中重新声明 TypeScript 变量\n\t\t\"@typescript-eslint/no-redeclare\": \"error\",\n\t\t// 允许定义未使用的变量\n\t\t\"@typescript-eslint/no-unused-vars\": \"off\",\n\t\t// 允许使用自定义TypeScript模块和命名空间\n\t\t\"@typescript-eslint/no-namespace\": \"off\",\n\t\t// 允许使用 any 类型\n\t\t\"@typescript-eslint/no-explicit-any\": \"off\",\n\t\t// 禁止在 TypeScript 文件中使用 require 函数进行模块导入\n\t\t\"@typescript-eslint/no-var-requires\": \"error\",\n\t\t// 禁止定义空函数\n\t\t\"@typescript-eslint/no-empty-function\": \"error\",\n\t\t// 禁止无用的表达式\n\t\t\"@typescript-eslint/no-unused-expressions\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 允许短路操作符(&& 和 ||)中的无副作用表达式\n\t\t\t\tallowShortCircuit: true,\n\t\t\t\t// 允许三元操作符中的无副作用表达式\n\t\t\t\tallowTernary: true,\n\t\t\t},\n\t\t],\n\t\t// 禁止在 TypeScript 代码中对类型已经可以被推断的变量或参数进行显式的类型注解\n\t\t\"@typescript-eslint/no-inferrable-types\": \"error\",\n\t\t// 禁止使用后缀运算符的非空断言(!)\n\t\t\"@typescript-eslint/no-non-null-assertion\": \"error\",\n\t\t// 禁止在可选链(?)后使用非空断言(!)\n\t\t\"@typescript-eslint/no-non-null-asserted-optional-chain\": \"error\",\n\t\t// 禁止在代码中使用 @ts-ignore 注释\n\t\t\"@typescript-eslint/ban-ts-comment\": [\"error\", { \"ts-ignore\": false }],\n\t\t// 一致地使用 TypeScript 类型导入\n\t\t\"@typescript-eslint/consistent-type-imports\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 允许使用类型注解\n\t\t\t\tdisallowTypeAnnotations: false,\n\t\t\t},\n\t\t],\n\n\t\t// 最佳实践\n\t\t// 确保数组的回调函数(如 Array.prototype.map、Array.prototype.filter、Array.prototype.reduce 等)总是有一个返回值\n\t\t\"array-callback-return\": \"error\",\n\t\t// 强制使用块级作用域变量(let 或 const),避免使用函数作用域变量(var)\n\t\t\"block-scoped-var\": \"error\",\n\t\t// 禁止使用 alert、confirm 和 prompt 等浏览器弹出对话框\n\t\t\"no-alert\": \"warn\",\n\t\t// 禁止在 switch 语句的 case 或 default 子句中声明变量\n\t\t\"no-case-declarations\": \"error\",\n\t\t// 禁止使用多行字符串,即不允许使用反斜杠 \\ 来连接多行字符串\n\t\t\"no-multi-str\": \"error\",\n\t\t// 禁止使用 with 语句\n\t\t\"no-with\": \"error\",\n\t\t// 禁止使用 void 操作符\n\t\t\"no-void\": \"error\",\n\t\t// 禁止多个空行\n\t\t\"no-multiple-empty-lines\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 最多允许1行\n\t\t\t\tmax: 1,\n\t\t\t},\n\t\t],\n\n\t\t// import 排序\n\t\t\"sort-imports\": [\n\t\t\t\"warn\",\n\t\t\t{\n\t\t\t\t// 不忽略导入语句中模块名的大小写\n\t\t\t\tignoreCase: false,\n\t\t\t\t// 忽略导入声明的排序\n\t\t\t\tignoreDeclarationSort: true,\n\t\t\t\t// 不忽略导入成员的排序\n\t\t\t\tignoreMemberSort: false,\n\t\t\t\t// 成员语法排序顺序\n\t\t\t\tmemberSyntaxSortOrder: [\"none\", \"all\", \"multiple\", \"single\"],\n\t\t\t\t// 不允许分组导入\n\t\t\t\tallowSeparatedGroups: false,\n\t\t\t},\n\t\t],\n\n\t\t// 强制在数学运算中使用 ** 运算符代替 Math.pow()\n\t\t\"prefer-exponentiation-operator\": \"error\",\n\n\t\t// 确保 Prettier 错误被 ESLint 捕获\n\t\t\"prettier/prettier\": \"error\",\n\n\t\t// vue (https://eslint.vuejs.org/rules)\n\n\t\t// 允许使用 v-html\n\t\t\"vue/no-v-html\": \"off\",\n\t\t// 禁用所有 props 必填时,必须提供默认值\n\t\t\"vue/require-default-prop\": \"off\",\n\t\t// 强制组件中必须使用 emits 选项声明事件\n\t\t\"vue/require-explicit-emits\": \"error\",\n\t\t// 禁用组件名称必须是多单词\n\t\t\"vue/multi-word-component-names\": \"off\",\n\t\t// 关闭 - 强制从 vue 中导入 Vue相关 API\n\t\t\"vue/prefer-import-from-vue\": \"off\",\n\t\t// 强制 HTML 属性使用 camelCase 风格\n\t\t\"vue/attribute-hyphenation\": [\n\t\t\t\"error\",\n\t\t\t\"always\",\n\t\t\t{\n\t\t\t\tignore: [\n\t\t\t\t\t// 忽略 Element-Plus 加载文案\"element-loading-text\"\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\n\t\t// 禁止重复的字段名\n\t\t\"vue/no-dupe-keys\": \"error\",\n\t\t// 禁止直接修改 props 的值\n\t\t\"vue/no-mutating-props\": \"error\",\n\t\t// 禁止使用 Vue.js 内置的保留组件名称(如 transition、keep-alive 等)作为自定义组件名称\n\t\t\"vue/no-reserved-component-names\": \"error\",\n\t\t// 禁止在自定义组件上使用 v-text 或 v-html 指令\n\t\t\"vue/no-v-text-v-html-on-component\": \"off\",\n\t\t// 防止<script setup>使用的变量<template>被标记为未使用,此规则仅在启用该no-unused-vars规则时有效。\n\t\t// \"vue/script-setup-uses-vars\": \"error\",\n\t\t// 强制自定义事件名称使用 camelCase 风格命名\n\t\t\"vue/custom-event-name-casing\": [\"error\", \"camelCase\"],\n\t\t// 强制每个 Vue 文件中只包含一个 Vue 组件\n\t\t\"vue/one-component-per-file\": \"off\",\n\t\t// 闭合标签换行风格\n\t\t\"vue/html-closing-bracket-newline\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 强制要求当 HTML 元素跨多行时,闭合标签必须出现在新的一行上\n\t\t\t\tmultiline: \"always\",\n\t\t\t\t// 强制要求当 HTML 元素只有一行时,闭合标签应与开始标签在同一行上\n\t\t\t\tsingleline: \"never\",\n\t\t\t},\n\t\t],\n\t\t// 强制 Vue 模板中 HTML 元素的属性按照指定的顺序排列\n\t\t\"vue/attributes-order\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\torder: [\"DEFINITION\", \"LIST_RENDERING\", \"CONDITIONALS\", \"RENDER_MODIFIERS\", \"GLOBAL\", \"UNIQUE\", \"OTHER_ATTR\", \"EVENTS\", \"CONTENT\"],\n\t\t\t},\n\t\t],\n\n\t\t// import\n\n\t\t// 确保所有的 import 语句位于文件的顶部,紧接在文件的开头部分,且在任何其他代码之前\n\t\t\"import/first\": \"error\",\n\t\t// 禁止在同一文件中出现重复的 import 语句\n\t\t\"import/no-duplicates\": \"error\",\n\t\t// 导入模块排序风格\n\t\t\"import/order\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\t// 导入模块分组\n\t\t\t\tgroups: [\n\t\t\t\t\t// Node.js 内置模块\n\t\t\t\t\t\"builtin\",\n\t\t\t\t\t// 第三方模块\n\t\t\t\t\t\"external\",\n\t\t\t\t\t// 项目内部模块\n\t\t\t\t\t\"internal\",\n\t\t\t\t\t// 父级目录中的模块\n\t\t\t\t\t\"parent\",\n\t\t\t\t\t// 具有相同父级的模块\n\t\t\t\t\t\"sibling\",\n\t\t\t\t\t// 当前目录的 index.js 或 index.ts 文件\n\t\t\t\t\t\"index\",\n\t\t\t\t\t\"object\",\n\t\t\t\t\t\"type\",\n\t\t\t\t\t\"unknown\",\n\t\t\t\t],\n\t\t\t\tpathGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"vue\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"@vue/**\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"element-plus\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"@element-plus/**\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"fast-element-plus\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tpattern: \"@fast-china/**\",\n\t\t\t\t\t\tgroup: \"external\",\n\t\t\t\t\t\tposition: \"before\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tpathGroupsExcludedImportTypes: [\"type\"],\n\t\t\t\t// 禁止不同组之间进行换行\n\t\t\t\t\"newlines-between\": \"never\",\n\t\t\t\t//根据字母顺序对每个组内的顺序进行排序\n\t\t\t\talphabetize: {\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tcaseInsensitive: true,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t// 关闭 - 禁用对无法解析的模块导入的检查\n\t\t\"import/no-unresolved\": \"off\",\n\t\t// 关闭 - 禁用对命名空间导入(例如,import * as)的检查\n\t\t\"import/namespace\": \"off\",\n\t\t// 关闭 - 禁用对默认导入的检查\n\t\t\"import/default\": \"off\",\n\t\t// 关闭 - 禁用对以默认导出方式作为命名导入的检查\n\t\t\"import/no-named-as-default\": \"off\",\n\t\t// 关闭 - 禁用对将默认导出成员当作命名导入的检查\n\t\t\"import/no-named-as-default-member\": \"off\",\n\t\t// 关闭 - 禁用对命名导入(即从模块中导入特定命名的内容)的检查\n\t\t\"import/named\": \"off\",\n\n\t\t// 限制某些模块导入\n\t\t\"no-restricted-imports\": [\n\t\t\t\"error\",\n\t\t\t{\n\t\t\t\tpaths: [\n\t\t\t\t\t{ name: \"lodash\", message: \"Use lodash-unified instead.\" },\n\t\t\t\t\t{ name: \"lodash-es\", message: \"Use lodash-unified instead.\" },\n\t\t\t\t],\n\t\t\t\tpatterns: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroup: [\"lodash/*\", \"lodash-es/*\"],\n\t\t\t\t\t\tmessage: \"Use lodash-unified instead.\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\n\t\t// // 限制某些模块导入\n\t\t// \"no-restricted-imports\": [\n\t\t// \"error\",\n\t\t// {\n\t\t// paths: [\n\t\t// { name: \"lodash-es\", message: \"Use lodash instead.\" },\n\t\t// { name: \"lodash-unified\", message: \"Use lodash instead.\" },\n\t\t// ],\n\t\t// patterns: [\n\t\t// {\n\t\t// group: [\"lodash-es/*\", \"lodash-unified/*\"],\n\t\t// message: \"Use lodash instead.\",\n\t\t// },\n\t\t// ],\n\t\t// },\n\t\t// ],\n\t},\n});\n"],"mappings":";AAAA,SAAS,oBAAoB;AAE7B,IAAO,gBAAQ,aAAa;AAAA,EAC3B,KAAK;AAAA,IACJ,KAAK;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,SAAS,CAAC,sBAAsB,UAAU;AAAA;AAAA,EAE1C,SAAS;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA,UAAU;AAAA;AAAA,IAET,mBAAmB;AAAA,MAClB,MAAM;AAAA,QACL,YAAY,CAAC,OAAO,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,OAAO;AAAA,MAC3E;AAAA,IACD;AAAA,EACD;AAAA,EACA,WAAW;AAAA,IACV;AAAA,MACC,OAAO,CAAC,QAAQ,SAAS,OAAO;AAAA,MAChC,OAAO;AAAA;AAAA,QAEN,YAAY;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,MACC,OAAO,CAAC,QAAQ;AAAA,MAChB,OAAO;AAAA;AAAA,QAEN,wBAAwB;AAAA;AAAA,QAExB,8CAA8C;AAAA,MAC/C;AAAA,IACD;AAAA,IACA;AAAA,MACC,OAAO,CAAC,MAAM;AAAA,MACd,OAAO;AAAA;AAAA,QAEN,sCAAsC;AAAA,MACvC;AAAA,IACD;AAAA,IACA;AAAA,MACC,OAAO,CAAC,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MACA;AAAA,QACC,OAAO;AAAA,UACN,EAAE,MAAM,UAAU,SAAS,8BAA8B;AAAA,UACzD,EAAE,MAAM,aAAa,SAAS,8BAA8B;AAAA,QAC7D;AAAA,QACA,UAAU;AAAA,UACT;AAAA,YACC,OAAO,CAAC,YAAY,aAAa;AAAA,YACjC,SAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBD;AACD,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fast-china/eslint-config",
3
3
  "author": "小方",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "description": "Fast ESLint 规则库.",
6
6
  "type": "module",
7
7
  "keywords": [
@@ -48,7 +48,8 @@
48
48
  "./Fast.png",
49
49
  "./LICENSE",
50
50
  "./README.md",
51
- "./README.zh.md"
51
+ "./README.zh.md",
52
+ "./dist"
52
53
  ],
53
54
  "peerDependencies": {
54
55
  "eslint": "^8 || ^9",