@fast-china/eslint-config 2.0.9 → 2.0.10

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/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 2.0.10 - 2026-08-19
10
+
11
+ ### Changed
12
+
13
+ - Changed the default export to a ready-to-use Flat Config array that can be exported directly or spread into another configuration; configurable usage remains available through the named `fastConfig()` export.
14
+ - Enabled Markdown, `package.json` sorting, and `tsconfig*.json` sorting by default while keeping React and Angular disabled by default.
15
+
9
16
  ## 2.0.9 - 2026-08-10
10
17
 
11
18
  ### Changed
package/README.md CHANGED
@@ -17,11 +17,11 @@ A practical, typed ESLint Flat Config for Vue 3, React, Angular, Vite, TypeScrip
17
17
  - Built for ESLint 10 and the native Flat Config format.
18
18
  - Vue 3 + TypeScript + Vite defaults; React and Angular are first-class opt-in integrations, so existing Vue projects do not activate unrelated rules.
19
19
  - First-class JavaScript, TypeScript, Vue SFC, JSX/TSX, Angular TypeScript and templates, JSON dialects, Markdown, RegExp, and import rules.
20
- - One focused `fastConfig()` factory with a compact public API and no project-file reads at module import time.
20
+ - A ready-to-use default Flat Config array that can be exported directly or spread, plus a named `fastConfig()` factory for customization.
21
21
  - Schema-generated rule types provide exact rule-name and rule-option completion.
22
22
  - Plugins and parsers are regular package dependencies, so consumers do not need to assemble the plugin graph.
23
23
  - Prettier stays a formatter: the default only disables conflicting ESLint rules and does not run Prettier inside ESLint.
24
- - Manifest sorting is explicit opt-in, preventing an unexpected large first-fix diff.
24
+ - Markdown and safe manifest sorting are enabled by default; React and Angular remain opt-in.
25
25
  - An opt-in Lodash policy keeps projects on either `lodash` or `lodash-unified` without mixing package entry points.
26
26
 
27
27
  ## Requirements
@@ -45,25 +45,27 @@ Equivalent npm, Yarn, and Bun commands work as well.
45
45
  Create `eslint.config.mjs`:
46
46
 
47
47
  ```js
48
+ import { defineConfig } from "eslint/config";
49
+
48
50
  import fastChina from "@fast-china/eslint-config";
49
51
 
50
- export default fastChina();
52
+ export default defineConfig([fastChina]);
51
53
  ```
52
54
 
53
- The default targets a conventional Vue 3 browser-based administration project. It enables Vue 3, TypeScript, JavaScript, JSON dialects, import ordering, RegExp checks, `.gitignore`, browser globals, and Node globals for common config, script, test, and CLI files. Markdown, React, Angular, and manifest sorting remain opt-in. Lodash policies are composed separately from the `configs` subpath.
55
+ You can also use `export default fastChina` directly, or `...fastChina` when composing other configs. The default targets a conventional Vue 3 browser-based administration project. It enables Vue 3, TypeScript, JavaScript, JSON dialects, Markdown, manifest sorting, import ordering, RegExp checks, `.gitignore`, browser globals, and Node globals for common config, script, test, and CLI files. React and Angular remain opt-in. Lodash policies are composed separately from the `configs` subpath.
54
56
 
55
57
  ## Other project types
56
58
 
57
- Other projects can either configure the root factory or compose focused fragments directly.
59
+ Other projects can configure the named `fastConfig()` factory or compose focused fragments directly.
58
60
 
59
61
  ### Use `fastConfig()`
60
62
 
61
63
  #### React + Vite
62
64
 
63
65
  ```js
64
- import fastChina from "@fast-china/eslint-config";
66
+ import { fastConfig } from "@fast-china/eslint-config";
65
67
 
66
- export default fastChina({
68
+ export default fastConfig({
67
69
  react: true,
68
70
  vue: false,
69
71
  });
@@ -74,9 +76,9 @@ React support applies the modern `@eslint-react` JavaScript/TypeScript preset, t
74
76
  #### Angular
75
77
 
76
78
  ```js
77
- import fastChina from "@fast-china/eslint-config";
79
+ import { fastConfig } from "@fast-china/eslint-config";
78
80
 
79
- export default fastChina({
81
+ export default fastConfig({
80
82
  angular: true,
81
83
  vue: false,
82
84
  });
@@ -85,7 +87,7 @@ export default fastChina({
85
87
  Angular support checks framework TypeScript, external `.html` templates, and inline component templates. Template accessibility and inline-template extraction are enabled by default:
86
88
 
87
89
  ```js
88
- export default fastChina({
90
+ export default fastConfig({
89
91
  angular: {
90
92
  inlineTemplates: true,
91
93
  templateAccessibility: true,
@@ -99,9 +101,9 @@ Angular requires the TypeScript integration; `angular: true` together with `type
99
101
  #### Node.js + TypeScript
100
102
 
101
103
  ```js
102
- import fastChina from "@fast-china/eslint-config";
104
+ import { fastConfig } from "@fast-china/eslint-config";
103
105
 
104
- export default fastChina({
106
+ export default fastConfig({
105
107
  environment: "node",
106
108
  vue: false,
107
109
  });
@@ -110,9 +112,9 @@ export default fastChina({
110
112
  #### JavaScript only
111
113
 
112
114
  ```js
113
- import fastChina from "@fast-china/eslint-config";
115
+ import { fastConfig } from "@fast-china/eslint-config";
114
116
 
115
- export default fastChina({
117
+ export default fastConfig({
116
118
  environment: "node",
117
119
  json: false,
118
120
  markdown: false,
@@ -124,9 +126,9 @@ export default fastChina({
124
126
  #### Type-aware TypeScript rules
125
127
 
126
128
  ```js
127
- import fastChina from "@fast-china/eslint-config";
129
+ import { fastConfig } from "@fast-china/eslint-config";
128
130
 
129
- export default fastChina({
131
+ export default fastConfig({
130
132
  typescript: {
131
133
  tsconfigRootDir: import.meta.dirname,
132
134
  typeChecked: true,
@@ -187,13 +189,13 @@ Use `createVueConfigs()` for Vue SFCs, `createAngularConfigs()` for Angular, or
187
189
  | `imports` | `true` | Enable import-x correctness and ordering rules. |
188
190
  | `javascript` | `true` | Process JavaScript and JSX files. |
189
191
  | `json` | `true` | Enable recommended JSON, JSONC, and JSON5 rules. |
190
- | `markdown` | `false` | Enable the official Markdown language rules. |
192
+ | `markdown` | `true` | Enable the official Markdown language rules. |
191
193
  | `prettier` | `true` | Disable ESLint rules that conflict with Prettier. |
192
194
  | `react` | `false` | Enable React/JSX/Hooks, or pass runtime and React-version settings. |
193
195
  | `regexp` | `true` | Enable recommended RegExp rules. |
194
196
  | `rules` | none | Add exactly typed project rules to every enabled code file. |
195
- | `sortPackageJson` | `false` | Sort safe package.json keys without entering conditional `exports`. |
196
- | `sortTsconfig` | `false` | Sort `tsconfig*.json` by TypeScript documentation topics. |
197
+ | `sortPackageJson` | `true` | Sort safe package.json keys without entering conditional `exports`. |
198
+ | `sortTsconfig` | `true` | Sort `tsconfig*.json` by TypeScript documentation topics. |
197
199
  | `typescript` | `true` | Disable it or pass `{ typeChecked: true, tsconfigRootDir }`. |
198
200
  | `vue` | `true` | Enable Vue 3 single-file components. |
199
201
 
@@ -223,7 +225,7 @@ import fastChina from "@fast-china/eslint-config";
223
225
  import { createLodashConfigs } from "@fast-china/eslint-config/configs";
224
226
  import { cloneDeep, debounce } from "lodash-unified";
225
227
 
226
- export default defineConfig([...fastChina(), ...createLodashConfigs("lodash-unified")]);
228
+ export default defineConfig([...fastChina, ...createLodashConfigs("lodash-unified")]);
227
229
  ```
228
230
 
229
231
  Choose standard `lodash`:
@@ -240,7 +242,7 @@ import fastChina from "@fast-china/eslint-config";
240
242
  import { createLodashConfigs } from "@fast-china/eslint-config/configs";
241
243
  import debounce from "lodash/debounce";
242
244
 
243
- export default defineConfig([...fastChina(), ...createLodashConfigs("lodash")]);
245
+ export default defineConfig([...fastChina, ...createLodashConfigs("lodash")]);
244
246
  ```
245
247
 
246
248
  This fragment uses ESLint core `no-restricted-imports`, adds no plugin, and does not install Lodash for the project. It checks static `import`/`export` only, not dynamic `import()` or CommonJS `require()`. It is independent of the root factory's `imports` option.
@@ -253,7 +255,7 @@ The package generates `RuleOptions` from the JSON Schemas published by ESLint co
253
255
 
254
256
  ```js
255
257
  // @ts-check
256
- import fastChina, { defineRules } from "@fast-china/eslint-config";
258
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
257
259
 
258
260
  const projectRules = defineRules({
259
261
  "@angular-eslint/template/alt-text": "error",
@@ -264,7 +266,7 @@ const projectRules = defineRules({
264
266
  "vue/attributes-order": ["error", { order: ["DEFINITION", "EVENTS", "CONTENT"] }],
265
267
  });
266
268
 
267
- export default fastChina(
269
+ export default fastConfig(
268
270
  { rules: projectRules },
269
271
  {
270
272
  files: ["**/*.generated.ts"],
@@ -288,7 +290,7 @@ The generated set covers ESLint core and plugins bundled by this package. Rules
288
290
 
289
291
  ## Rule risk and maintenance
290
292
 
291
- The default includes a small set of high-impact rules. They can block particular patterns or require a review of import side effects, type-only imports, and public component events. React and Angular are disabled globally by default, but enabling them also enables their documented modern-framework and accessibility policies. Manifest sorting is high-impact and disabled by default. Source comments mark these decisions as `[高影响]`, `[可自动修复]`, `[安全关注]`, or `[按需启用]`.
293
+ The default includes a small set of high-impact rules. They can block particular patterns or require a review of import side effects, type-only imports, public component events, and manifest sorting results. React and Angular are disabled globally by default, but enabling them also enables their documented modern-framework and accessibility policies. Source comments mark these decisions as `[High impact]`, `[Auto-fixable]`, or `[Security]`.
292
294
 
293
295
  See the [default-rule and risk guide](./docs/rules-risk.md) for inherited presets, the high-impact inventory, scoped override examples, and the maintenance contract. Run a read-only lint before `eslint --fix`, apply fixes in an isolated commit, and review imports, `package.json`, component events, and build output.
294
296
 
@@ -297,9 +299,9 @@ See the [default-rule and risk guide](./docs/rules-risk.md) for inherited preset
297
299
  Put common overrides in `rules`, and pass file-scoped overrides as later arguments. Later configurations take precedence:
298
300
 
299
301
  ```js
300
- import fastChina, { defineRules } from "@fast-china/eslint-config";
302
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
301
303
 
302
- export default fastChina(
304
+ export default fastConfig(
303
305
  {
304
306
  rules: {
305
307
  "no-console": "warn",
package/README.zh.md CHANGED
@@ -17,11 +17,11 @@
17
17
  - 基于 ESLint 10,仅提供原生 Flat Config。
18
18
  - 默认针对 Vue 3 + TypeScript + Vite;React 与 Angular 是完整但按需启用的框架集成,Vue 项目不会意外接管无关文件。
19
19
  - 完整覆盖 JavaScript、TypeScript、Vue SFC、JSX/TSX、Angular TypeScript 与模板、JSON 各方言、Markdown、正则表达式与导入规则。
20
- - 默认导出单一 `fastConfig()` 工厂,公共 API 清晰,并且不会在导入模块时读取项目文件。
20
+ - 默认导出可直接使用或展开的 Flat Config 数组;具名 `fastConfig()` 工厂用于自定义选项和项目覆写。
21
21
  - 根据 ESLint 与内置插件的规则 schema 生成精确类型,提供规则名和规则选项自动补全。
22
22
  - 插件与解析器均由本包直接声明依赖,使用者不需要手工拼装插件依赖树。
23
23
  - Prettier 只负责格式化:默认配置仅关闭冲突规则,不在 ESLint 内重复运行 Prettier。
24
- - `package.json` 与 `tsconfig.json` 排序为显式 opt-in,避免安装后首次修复产生非预期大 diff。
24
+ - 默认检查 Markdown,并安全排序 `package.json` 与 `tsconfig.json`;React Angular 保持按需启用。
25
25
  - 可选统一使用 `lodash` 或 `lodash-unified`,避免同一项目混用多个 Lodash 入口。
26
26
 
27
27
  ## 环境要求
@@ -45,25 +45,27 @@ pnpm add -D eslint typescript @fast-china/eslint-config
45
45
  创建 `eslint.config.mjs`:
46
46
 
47
47
  ```js
48
+ import { defineConfig } from "eslint/config";
49
+
48
50
  import fastChina from "@fast-china/eslint-config";
49
51
 
50
- export default fastChina();
52
+ export default defineConfig([fastChina]);
51
53
  ```
52
54
 
53
- 默认配置面向普通 Vue 3 浏览器后台管理项目,启用 Vue 3、TypeScript、JavaScript、JSON 各方言、导入排序、正则检查、`.gitignore` 与浏览器全局变量;常见配置文件、脚本、测试和 CLI 文件会额外获得 Node.js 全局变量。Markdown、ReactAngular 和清单排序按需启用;Lodash 策略通过 `configs` 子路径独立组合。
55
+ 也可以直接 `export default fastChina`,或在组合其他配置时使用 `...fastChina`。默认配置面向普通 Vue 3 浏览器后台管理项目,启用 Vue 3、TypeScript、JavaScript、JSON 各方言、Markdown、清单排序、导入排序、正则检查、`.gitignore` 与浏览器全局变量;常见配置文件、脚本、测试和 CLI 文件会额外获得 Node.js 全局变量。ReactAngular 按需启用;Lodash 策略通过 `configs` 子路径独立组合。
54
56
 
55
57
  ## 适配其他项目
56
58
 
57
- 其他项目可以配置根工厂,也可以完全绕过根工厂,直接组合所需片段。
59
+ 其他项目可以通过具名 `fastConfig()` 工厂配置选项,也可以完全绕过根工厂,直接组合所需片段。
58
60
 
59
61
  ### 使用 `fastConfig()`
60
62
 
61
63
  #### React + Vite
62
64
 
63
65
  ```js
64
- import fastChina from "@fast-china/eslint-config";
66
+ import { fastConfig } from "@fast-china/eslint-config";
65
67
 
66
- export default fastChina({
68
+ export default fastConfig({
67
69
  react: true,
68
70
  vue: false,
69
71
  });
@@ -74,9 +76,9 @@ React 集成会应用现代 `@eslint-react` JavaScript/TypeScript 预置、React
74
76
  #### Angular
75
77
 
76
78
  ```js
77
- import fastChina from "@fast-china/eslint-config";
79
+ import { fastConfig } from "@fast-china/eslint-config";
78
80
 
79
- export default fastChina({
81
+ export default fastConfig({
80
82
  angular: true,
81
83
  vue: false,
82
84
  });
@@ -85,7 +87,7 @@ export default fastChina({
85
87
  Angular 集成会检查框架 TypeScript、外部 `.html` 模板和组件内联模板。模板无障碍规则与内联模板提取默认开启,也可以显式配置:
86
88
 
87
89
  ```js
88
- export default fastChina({
90
+ export default fastConfig({
89
91
  angular: {
90
92
  inlineTemplates: true,
91
93
  templateAccessibility: true,
@@ -99,9 +101,9 @@ Angular 依赖 TypeScript 集成;同时设置 `angular: true` 与 `typescript:
99
101
  #### Node.js + TypeScript
100
102
 
101
103
  ```js
102
- import fastChina from "@fast-china/eslint-config";
104
+ import { fastConfig } from "@fast-china/eslint-config";
103
105
 
104
- export default fastChina({
106
+ export default fastConfig({
105
107
  environment: "node",
106
108
  vue: false,
107
109
  });
@@ -110,9 +112,9 @@ export default fastChina({
110
112
  #### 纯 JavaScript
111
113
 
112
114
  ```js
113
- import fastChina from "@fast-china/eslint-config";
115
+ import { fastConfig } from "@fast-china/eslint-config";
114
116
 
115
- export default fastChina({
117
+ export default fastConfig({
116
118
  environment: "node",
117
119
  json: false,
118
120
  markdown: false,
@@ -124,9 +126,9 @@ export default fastChina({
124
126
  #### 启用 TypeScript 类型感知规则
125
127
 
126
128
  ```js
127
- import fastChina from "@fast-china/eslint-config";
129
+ import { fastConfig } from "@fast-china/eslint-config";
128
130
 
129
- export default fastChina({
131
+ export default fastConfig({
130
132
  typescript: {
131
133
  tsconfigRootDir: import.meta.dirname,
132
134
  typeChecked: true,
@@ -187,13 +189,13 @@ Vue SFC 可增加 `createVueConfigs()`,Angular 可增加 `createAngularConfigs
187
189
  | `imports` | `true` | 启用 import-x 正确性与排序规则。 |
188
190
  | `javascript` | `true` | 处理 JavaScript 与 JSX。 |
189
191
  | `json` | `true` | 启用 JSON、JSONC 与 JSON5 推荐规则。 |
190
- | `markdown` | `false` | 启用官方 Markdown 语言规则。 |
192
+ | `markdown` | `true` | 启用官方 Markdown 语言规则。 |
191
193
  | `prettier` | `true` | 关闭与 Prettier 冲突的 ESLint 规则。 |
192
194
  | `react` | `false` | 启用 React、JSX 与 Hooks,或传入运行时和 React 版本设置。 |
193
195
  | `regexp` | `true` | 启用推荐的正则表达式规则。 |
194
196
  | `rules` | 无 | 对所有已启用代码文件追加具有精确类型的项目规则。 |
195
- | `sortPackageJson` | `false` | 按安全白名单排序 `package.json`,不会进入 `exports` 条件对象。 |
196
- | `sortTsconfig` | `false` | 按 TypeScript 文档主题排序 `tsconfig*.json`。 |
197
+ | `sortPackageJson` | `true` | 按安全白名单排序 `package.json`,不会进入 `exports` 条件对象。 |
198
+ | `sortTsconfig` | `true` | 按 TypeScript 文档主题排序 `tsconfig*.json`。 |
197
199
  | `typescript` | `true` | 可关闭,或传入 `{ typeChecked: true, tsconfigRootDir }`。 |
198
200
  | `vue` | `true` | 启用 Vue 3 单文件组件支持。 |
199
201
 
@@ -223,7 +225,7 @@ import fastChina from "@fast-china/eslint-config";
223
225
  import { createLodashConfigs } from "@fast-china/eslint-config/configs";
224
226
  import { cloneDeep, debounce } from "lodash-unified";
225
227
 
226
- export default defineConfig([...fastChina(), ...createLodashConfigs("lodash-unified")]);
228
+ export default defineConfig([...fastChina, ...createLodashConfigs("lodash-unified")]);
227
229
  ```
228
230
 
229
231
  选择标准 `lodash`:
@@ -240,7 +242,7 @@ import fastChina from "@fast-china/eslint-config";
240
242
  import { createLodashConfigs } from "@fast-china/eslint-config/configs";
241
243
  import debounce from "lodash/debounce";
242
244
 
243
- export default defineConfig([...fastChina(), ...createLodashConfigs("lodash")]);
245
+ export default defineConfig([...fastChina, ...createLodashConfigs("lodash")]);
244
246
  ```
245
247
 
246
248
  该片段使用 ESLint 核心 `no-restricted-imports`,不需要额外插件,也不会替项目安装 Lodash。它只检查静态 `import`/`export`,不检查动态 `import()` 或 CommonJS `require()`,并且独立于根工厂的 `imports` 选项。
@@ -253,7 +255,7 @@ export default defineConfig([...fastChina(), ...createLodashConfigs("lodash")]);
253
255
 
254
256
  ```js
255
257
  // @ts-check
256
- import fastChina, { defineRules } from "@fast-china/eslint-config";
258
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
257
259
 
258
260
  const projectRules = defineRules({
259
261
  "@angular-eslint/template/alt-text": "error",
@@ -264,7 +266,7 @@ const projectRules = defineRules({
264
266
  "vue/attributes-order": ["error", { order: ["DEFINITION", "EVENTS", "CONTENT"] }],
265
267
  });
266
268
 
267
- export default fastChina(
269
+ export default fastConfig(
268
270
  { rules: projectRules },
269
271
  {
270
272
  files: ["**/*.generated.ts"],
@@ -288,7 +290,7 @@ const rules = {
288
290
 
289
291
  ## 规则风险与维护
290
292
 
291
- 默认配置包含少量高影响规则:它们可能阻断特定写法,或要求复核 import 副作用、类型导入和组件公共事件。React 与 Angular 在全局默认关闭,但启用框架后也会启用文档中列出的现代框架约束和无障碍规则。清单排序同样属于高影响能力,但默认关闭。源码使用 `[高影响]`、`[可自动修复]`、`[安全关注]` 与 `[按需启用]` 标记这类规则。
293
+ 默认配置包含少量高影响规则:它们可能阻断特定写法,或要求复核 import 副作用、类型导入、组件公共事件和清单排序结果。React 与 Angular 在全局默认关闭,但启用框架后也会启用文档中列出的现代框架约束和无障碍规则。源码使用 `[高影响]`、`[可自动修复]` 与 `[安全关注]` 标记这类规则。
292
294
 
293
295
  完整的默认预置来源、高影响规则清单、关闭示例和维护约定见 [默认规则与风险指南](./docs/rules-risk.zh.md)。运行 `eslint --fix` 前建议先只检查,在独立提交中应用修复,并审查 import、`package.json`、组件事件和构建产物。
294
296
 
@@ -297,9 +299,9 @@ const rules = {
297
299
  最常用的全局覆盖可以直接放入 `rules`;按文件覆盖作为后续参数传入,后面的配置优先级更高:
298
300
 
299
301
  ```js
300
- import fastChina, { defineRules } from "@fast-china/eslint-config";
302
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
301
303
 
302
- export default fastChina(
304
+ export default fastConfig(
303
305
  {
304
306
  rules: {
305
307
  "no-console": "warn",
@@ -10,7 +10,7 @@ import eslintConfigFlatGitignore from "eslint-config-flat-gitignore";
10
10
  * 应由项目维护的文件。
11
11
  */
12
12
  const DEFAULT_IGNORE_PATTERNS = Object.freeze([
13
- "**/node_modules/**",
13
+ "**/.pnpm-store,node_modules/**",
14
14
  "**/{dist,build,coverage,output,temp,tmp}/**",
15
15
  "**/{.cache,.nuxt,.output,.vercel,.nitro}/**",
16
16
  "**/{.vitepress/cache,.vite-inspect}/**",
@@ -1 +1 @@
1
- {"version":3,"file":"ignores.mjs","names":[],"sources":["../../src/configs/ignores.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport eslintConfigFlatGitignore from \"eslint-config-flat-gitignore\";\nimport { GLOBS_LOCKFILES } from \"../constants\";\n\n/**\n * 默认忽略依赖、构建结果、缓存、生成文件和包管理器锁文件。\n *\n * @remarks\n * 不忽略 `src`、`public`、测试夹具或普通 Markdown 文档,避免共享配置静默漏检\n * 应由项目维护的文件。\n */\nexport const DEFAULT_IGNORE_PATTERNS = Object.freeze([\n\t\"**/node_modules/**\",\n\t\"**/{dist,build,coverage,output,temp,tmp}/**\",\n\t\"**/{.cache,.nuxt,.output,.vercel,.nitro}/**\",\n\t\"**/{.vitepress/cache,.vite-inspect}/**\",\n\t\"**/__snapshots__/**\",\n\t\"**/*.min.*\",\n\t\"**/auto-import?(s).d.ts\",\n\t\"**/components.d.ts\",\n\t...GLOBS_LOCKFILES,\n]);\n\n/**\n * 创建全局忽略配置,并在默认集合之后追加项目自定义模式。\n *\n * @param additionalPatterns - 追加到 {@link DEFAULT_IGNORE_PATTERNS} 之后的 ESLint 全局忽略模式。\n * @returns 包含单个命名全局忽略片段的 Flat Config 数组。\n */\nexport const createGlobalIgnores = (additionalPatterns: readonly string[] = []) =>\n\tdefineConfig([globalIgnores([...DEFAULT_IGNORE_PATTERNS, ...additionalPatterns], \"@fast-china/ignores/global\")]);\n\n/**\n * 创建读取项目 `.gitignore` 的全局忽略配置。\n *\n * @remarks\n * `.gitignore` 的查找位置由 `eslint-config-flat-gitignore` 根据 ESLint 当前工作目录确定。\n * 未找到文件时不会抛错;该片段也不会替代 {@link createGlobalIgnores} 的内置模式。\n *\n * @returns 包含 `.gitignore` 转换结果的 Flat Config 数组。\n */\nexport const createGitignoreConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/ignores/git\",\n\t\t\t...eslintConfigFlatGitignore({ strict: false }),\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,0BAA0B,OAAO,OAAO;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;AACJ,CAAC;;;;;;;AAQD,MAAa,uBAAuB,qBAAwC,CAAC,MAC5E,aAAa,CAAC,cAAc,CAAC,GAAG,yBAAyB,GAAG,kBAAkB,GAAG,4BAA4B,CAAC,CAAC;;;;;;;;;;AAWhH,MAAa,+BACZ,aAAa,CACZ;CACC,MAAM;CACN,GAAG,0BAA0B,EAAE,QAAQ,MAAM,CAAC;AAC/C,CACD,CAAC"}
1
+ {"version":3,"file":"ignores.mjs","names":[],"sources":["../../src/configs/ignores.ts"],"sourcesContent":["import { defineConfig, globalIgnores } from \"eslint/config\";\nimport eslintConfigFlatGitignore from \"eslint-config-flat-gitignore\";\nimport { GLOBS_LOCKFILES } from \"../constants\";\n\n/**\n * 默认忽略依赖、构建结果、缓存、生成文件和包管理器锁文件。\n *\n * @remarks\n * 不忽略 `src`、`public`、测试夹具或普通 Markdown 文档,避免共享配置静默漏检\n * 应由项目维护的文件。\n */\nexport const DEFAULT_IGNORE_PATTERNS = Object.freeze([\n\t\"**/.pnpm-store,node_modules/**\",\n\t\"**/{dist,build,coverage,output,temp,tmp}/**\",\n\t\"**/{.cache,.nuxt,.output,.vercel,.nitro}/**\",\n\t\"**/{.vitepress/cache,.vite-inspect}/**\",\n\t\"**/__snapshots__/**\",\n\t\"**/*.min.*\",\n\t\"**/auto-import?(s).d.ts\",\n\t\"**/components.d.ts\",\n\t...GLOBS_LOCKFILES,\n]);\n\n/**\n * 创建全局忽略配置,并在默认集合之后追加项目自定义模式。\n *\n * @param additionalPatterns - 追加到 {@link DEFAULT_IGNORE_PATTERNS} 之后的 ESLint 全局忽略模式。\n * @returns 包含单个命名全局忽略片段的 Flat Config 数组。\n */\nexport const createGlobalIgnores = (additionalPatterns: readonly string[] = []) =>\n\tdefineConfig([globalIgnores([...DEFAULT_IGNORE_PATTERNS, ...additionalPatterns], \"@fast-china/ignores/global\")]);\n\n/**\n * 创建读取项目 `.gitignore` 的全局忽略配置。\n *\n * @remarks\n * `.gitignore` 的查找位置由 `eslint-config-flat-gitignore` 根据 ESLint 当前工作目录确定。\n * 未找到文件时不会抛错;该片段也不会替代 {@link createGlobalIgnores} 的内置模式。\n *\n * @returns 包含 `.gitignore` 转换结果的 Flat Config 数组。\n */\nexport const createGitignoreConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/ignores/git\",\n\t\t\t...eslintConfigFlatGitignore({ strict: false }),\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,0BAA0B,OAAO,OAAO;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;AACJ,CAAC;;;;;;;AAQD,MAAa,uBAAuB,qBAAwC,CAAC,MAC5E,aAAa,CAAC,cAAc,CAAC,GAAG,yBAAyB,GAAG,kBAAkB,GAAG,4BAA4B,CAAC,CAAC;;;;;;;;;;AAWhH,MAAa,+BACZ,aAAa,CACZ;CACC,MAAM;CACN,GAAG,0BAA0B,EAAE,QAAQ,MAAM,CAAC;AAC/C,CACD,CAAC"}
package/dist/index.d.mts CHANGED
@@ -126,7 +126,7 @@ interface FastConfigOptions {
126
126
  *
127
127
  * 该配置关注 Markdown 文档本身,不会自动把项目的 JavaScript、TypeScript 或框架
128
128
  * 规则应用到围栏代码块;如需检查代码块,应通过项目覆盖配置明确指定。
129
- * @defaultValue `false`
129
+ * @defaultValue `true`
130
130
  */
131
131
  markdown?: boolean;
132
132
  /**
@@ -171,7 +171,7 @@ interface FastConfigOptions {
171
171
  * 规则只在执行 `eslint --fix` 时重排字段,并刻意不进入顺序具有运行时语义的
172
172
  * `exports` 条件对象。首次启用通常会产生较大的纯排序差异,建议单独提交并复核。
173
173
  * 启用此项会同时加载 JSON 解析配置。
174
- * @defaultValue `false`
174
+ * @defaultValue `true`
175
175
  */
176
176
  sortPackageJson?: boolean;
177
177
  /**
@@ -179,7 +179,7 @@ interface FastConfigOptions {
179
179
  *
180
180
  * 规则不会改变编译选项值,只在执行 `eslint --fix` 时调整字段顺序。首次启用可能产生
181
181
  * 较大差异,建议单独提交并确认继承关系仍清晰。启用此项会同时加载 JSON 解析配置。
182
- * @defaultValue `false`
182
+ * @defaultValue `true`
183
183
  */
184
184
  sortTsconfig?: boolean;
185
185
  /**
@@ -216,12 +216,12 @@ declare const defaultConfigOptions: Readonly<{
216
216
  readonly imports: true;
217
217
  readonly javascript: true;
218
218
  readonly json: true;
219
- readonly markdown: false;
219
+ readonly markdown: true;
220
220
  readonly prettier: true;
221
221
  readonly react: false;
222
222
  readonly regexp: true;
223
- readonly sortPackageJson: false;
224
- readonly sortTsconfig: false;
223
+ readonly sortPackageJson: true;
224
+ readonly sortTsconfig: true;
225
225
  readonly typescript: true;
226
226
  readonly vue: true;
227
227
  }>;
@@ -229,9 +229,9 @@ declare const defaultConfigOptions: Readonly<{
229
229
  * 创建面向 Vue 3、Vite、TypeScript 与浏览器后台管理项目的 ESLint Flat Config。
230
230
  *
231
231
  * @remarks
232
- * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON
233
- * Prettier 兼容层。ReactAngular、Markdown 与清单排序按需启用;Lodash 导入策略
234
- * 通过 `@fast-china/eslint-config/configs` 独立组合。
232
+ * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON、Markdown、
233
+ * 清单排序和 Prettier 兼容层。ReactAngular 按需启用;Lodash 导入策略通过
234
+ * `@fast-china/eslint-config/configs` 独立组合。
235
235
  * 额外配置参数会放在内置配置之后,因此项目可以按文件范围覆盖任何默认规则。
236
236
  *
237
237
  * @param options - 控制内置语言、框架、插件与项目级规则的选项。
@@ -241,7 +241,7 @@ declare const defaultConfigOptions: Readonly<{
241
241
  *
242
242
  * @example
243
243
  * ```ts
244
- * import fastConfig from "@fast-china/eslint-config";
244
+ * import { fastConfig } from "@fast-china/eslint-config";
245
245
  *
246
246
  * export default fastConfig(
247
247
  * { react: true, vue: false },
@@ -250,6 +250,20 @@ declare const defaultConfigOptions: Readonly<{
250
250
  * ```
251
251
  */
252
252
  declare const fastConfig: (options?: FastConfigOptions, ...overrides: Config[]) => Config[];
253
+ /**
254
+ * 可直接导出或展开的默认 ESLint Flat Config。
255
+ *
256
+ * @remarks
257
+ * 需要修改选项或追加覆盖配置时,请使用具名导出的 {@link fastConfig} 工厂。
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * import fastChina from "@fast-china/eslint-config";
262
+ *
263
+ * export default fastChina;
264
+ * ```
265
+ */
266
+ declare const fastChina: Config[];
253
267
  //#endregion
254
- export { FastConfigOptions, type RuleOptions, fastConfig as default, fastConfig, defaultConfigOptions, defineRules };
268
+ export { FastConfigOptions, type RuleOptions, fastChina as default, defaultConfigOptions, defineRules, fastConfig };
255
269
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -48,12 +48,12 @@ const defaultConfigOptions = Object.freeze({
48
48
  imports: true,
49
49
  javascript: true,
50
50
  json: true,
51
- markdown: false,
51
+ markdown: true,
52
52
  prettier: true,
53
53
  react: false,
54
54
  regexp: true,
55
- sortPackageJson: false,
56
- sortTsconfig: false,
55
+ sortPackageJson: true,
56
+ sortTsconfig: true,
57
57
  typescript: true,
58
58
  vue: true
59
59
  });
@@ -61,9 +61,9 @@ const defaultConfigOptions = Object.freeze({
61
61
  * 创建面向 Vue 3、Vite、TypeScript 与浏览器后台管理项目的 ESLint Flat Config。
62
62
  *
63
63
  * @remarks
64
- * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON
65
- * Prettier 兼容层。ReactAngular、Markdown 与清单排序按需启用;Lodash 导入策略
66
- * 通过 `@fast-china/eslint-config/configs` 独立组合。
64
+ * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON、Markdown、
65
+ * 清单排序和 Prettier 兼容层。ReactAngular 按需启用;Lodash 导入策略通过
66
+ * `@fast-china/eslint-config/configs` 独立组合。
67
67
  * 额外配置参数会放在内置配置之后,因此项目可以按文件范围覆盖任何默认规则。
68
68
  *
69
69
  * @param options - 控制内置语言、框架、插件与项目级规则的选项。
@@ -73,7 +73,7 @@ const defaultConfigOptions = Object.freeze({
73
73
  *
74
74
  * @example
75
75
  * ```ts
76
- * import fastConfig from "@fast-china/eslint-config";
76
+ * import { fastConfig } from "@fast-china/eslint-config";
77
77
  *
78
78
  * export default fastConfig(
79
79
  * { react: true, vue: false },
@@ -143,7 +143,21 @@ const fastConfig = (options = {}, ...overrides) => {
143
143
  ...overrides
144
144
  ]);
145
145
  };
146
+ /**
147
+ * 可直接导出或展开的默认 ESLint Flat Config。
148
+ *
149
+ * @remarks
150
+ * 需要修改选项或追加覆盖配置时,请使用具名导出的 {@link fastConfig} 工厂。
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * import fastChina from "@fast-china/eslint-config";
155
+ *
156
+ * export default fastChina;
157
+ * ```
158
+ */
159
+ const fastChina = fastConfig();
146
160
  //#endregion
147
- export { fastConfig as default, fastConfig, defaultConfigOptions, defineRules };
161
+ export { fastChina as default, defaultConfigOptions, defineRules, fastConfig };
148
162
 
149
163
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * 根入口提供面向 Vue 3 浏览器管理项目的默认配置工厂。\n *\n * 配置片段、glob 常量与原始规则分别由 `./configs`、`./constants` 与 `./rules` 子路径提供。\n *\n * @packageDocumentation\n */\nimport { type Config, defineConfig } from \"eslint/config\";\nimport { type AngularConfigOptions, createAngularConfigs } from \"./configs/angular\";\nimport { createCommonConfigs } from \"./configs/common\";\nimport { type RuntimeEnvironment, createEnvironmentConfigs } from \"./configs/environment\";\nimport { createGitignoreConfigs, createGlobalIgnores } from \"./configs/ignores\";\nimport { createImportConfigs } from \"./configs/import\";\nimport { createJavaScriptConfigs } from \"./configs/javascript\";\nimport { createJsonConfigs } from \"./configs/json\";\nimport { createMarkdownConfigs } from \"./configs/markdown\";\nimport { createPrettierConfigs } from \"./configs/prettier\";\nimport { type ReactConfigOptions, createReactConfigs } from \"./configs/react\";\nimport { createRegexpConfigs } from \"./configs/regexp\";\nimport { createPackageJsonSortConfigs } from \"./configs/sort-package\";\nimport { createTsconfigSortConfigs } from \"./configs/sort-tsconfig\";\nimport { type TypeScriptConfigOptions, createTypeScriptConfigs } from \"./configs/typescript\";\nimport { createVueConfigs } from \"./configs/vue\";\nimport { GLOBS_JAVASCRIPT, GLOBS_TYPESCRIPT, GLOB_VUE } from \"./constants\";\nimport type { RuleOptions } from \"./typegen\";\nimport type { Linter } from \"eslint\";\n\ntype RejectUnknownRuleNames<Rules extends RuleOptions> = Rules & Record<Exclude<keyof Rules, keyof RuleOptions>, never>;\n\n/**\n * 为项目规则提供精确的规则名、严重级别和规则选项自动补全。\n *\n * @remarks\n * 该函数不会修改传入对象;它只在 TypeScript 编译阶段拒绝未知规则和无效选项。\n *\n * @typeParam Rules - 调用方传入的规则记录类型;保留字面量键和值以提供精确推断。\n * @param rules - 需要进行规则名、严重级别和选项校验的 ESLint 规则记录。\n * @returns 原始规则记录。返回值同时兼容 ESLint 的通用 `RulesRecord` 类型。\n */\nexport const defineRules = <const Rules extends RuleOptions>(rules: RejectUnknownRuleNames<Rules>): Rules & Linter.RulesRecord => rules;\n\nexport type { RuleOptions } from \"./typegen\";\n\n/**\n * 核心工厂 `fastConfig()` 的项目级 ESLint Flat Config 选项。\n *\n * @remarks\n *\n * 每个字段只控制一个相对独立的配置片段。未传入字段时使用下方 `@defaultValue` 标注的值;\n * 布尔选项传入 `false` 会让工厂完全跳过对应片段,支持对象形式的框架或 TypeScript\n * 选项传入 `true` 时采用其内部默认值,传入对象时则在启用能力的同时覆盖内部默认值。\n *\n * `rules` 会在全部内置规则和 Prettier 兼容层之后应用;`fastConfig()` 的其余位置参数\n * 又会排在 `rules` 之后。因此,常规的全项目规则放在 `rules` 中,按文件覆盖或需要最高\n * 优先级的配置应通过其余位置参数传入。\n *\n * 这些选项只负责生成 ESLint 配置,不会修改 TypeScript、Vite 或各框架的构建配置。\n *\n * @example\n * ```ts\n * export default fastConfig({\n * environment: \"browser\",\n * react: { version: \"detect\" },\n * typescript: { typeChecked: true },\n * vue: false,\n * });\n * ```\n */\nexport interface FastConfigOptions {\n\t/**\n\t * 是否启用 Angular 源码与模板检查。\n\t *\n\t * `true` 使用 Angular 默认选项;传入对象可控制内联模板与模板无障碍规则。\n\t * 启用后会检查 Angular TypeScript 源码、外部 `.html` 模板,并默认提取\n\t * `@Component()` 中的内联模板。Angular 依赖 TypeScript 解析能力,因此不能与\n\t * `typescript: false` 同时使用,否则 `fastConfig()` 会直接抛出配置错误。\n\t *\n\t * 此选项只配置 ESLint,不会创建或修改 Angular CLI、编译器或项目文件。\n\t * @defaultValue `false`\n\t */\n\tangular?: boolean | AngularConfigOptions;\n\t/**\n\t * 应用代码实际运行的环境,用于声明 ESLint 可识别的运行时全局变量。\n\t *\n\t * - `\"browser\"`:提供浏览器全局变量,例如 `window`、`document`。\n\t * - `\"node\"`:提供 Node.js 全局变量,例如 `process`、`Buffer`。\n\t * - `\"universal\"`:同时提供浏览器与 Node.js 全局变量,适合 SSR 或同构代码。\n\t *\n\t * 常见 Vue、React、Angular 与 Vite 浏览器应用通常保持 `\"browser\"`。无论选择哪种\n\t * 环境,配置文件、脚本目录和测试文件等 Node.js 工程文件都会单独获得 Node.js\n\t * 全局变量。此选项不改变 JavaScript 编译目标或打包平台。\n\t * @defaultValue `\"browser\"`\n\t */\n\tenvironment?: RuntimeEnvironment;\n\t/**\n\t * 追加到应用代码运行环境中的项目级全局变量。\n\t *\n\t * 适用于测试运行器、UniApp、浏览器扩展或其他宿主平台注入的 API。值的格式遵循\n\t * ESLint `Linter.Globals`,可以声明为 `\"readonly\"`、`\"writable\"` 或 `\"off\"`。\n\t * 自定义值在环境预置之后合并,因此同名项目配置可以覆盖预置的读写权限。\n\t * @defaultValue `undefined`\n\t */\n\tglobals?: Linter.Globals;\n\t/**\n\t * 是否读取运行 ESLint 的项目根目录中的 `.gitignore` 并转换为全局忽略规则。\n\t *\n\t * 关闭此项只会停止读取 `.gitignore`,不会移除本库内置的依赖目录、构建产物、\n\t * 缓存、生成文件和锁文件忽略模式;如需补充忽略项,请使用 `ignores`。\n\t * @defaultValue `true`\n\t */\n\tgitignore?: boolean;\n\t/**\n\t * 追加到内置全局忽略集合末尾的 ESLint glob 模式。\n\t *\n\t * 这些模式不会替换内置忽略项。模式按 ESLint Flat Config 的全局忽略语义解析,\n\t * 适合排除项目特有的生成目录、工具输出或不应参与检查的资源。\n\t * @defaultValue `[]`\n\t */\n\tignores?: readonly string[];\n\t/**\n\t * 是否为全部已启用代码文件加载 `eslint-plugin-import-x` 推荐规则和本库覆盖规则。\n\t *\n\t * 该片段检查常见的 ESM 导入导出问题,但共享配置不会猜测项目的路径别名或自定义\n\t * resolver,因此默认关闭了强依赖模块解析且容易误报的规则。如果项目重新启用这些\n\t * 规则,应在传给 `fastConfig()` 的覆盖配置中同时补充 resolver。关闭本选项不会影响\n\t * JavaScript 或 TypeScript 的基础语法检查。\n\t * @defaultValue `true`\n\t */\n\timports?: boolean;\n\t/**\n\t * 是否让工厂接管 JavaScript、CommonJS、ES Module 与 JSX 文件。\n\t *\n\t * 启用时匹配 `.js`、`.cjs`、`.mjs` 与 `.jsx`;关闭后这些文件不会进入基础规则、\n\t * 环境全局变量、import、regexp 或 React 的 JavaScript 配置范围,但不会影响\n\t * 已启用的 TypeScript、Vue、JSON 或 Markdown 文件。\n\t * @defaultValue `true`\n\t */\n\tjavascript?: boolean;\n\t/**\n\t * 是否检查 JSON、JSONC 与 JSON5 文件,并为三种方言分别使用兼容的推荐规则。\n\t *\n\t * 此选项不负责字段排序。`sortPackageJson` 或 `sortTsconfig` 任一启用时,为了让对应\n\t * 排序规则能够解析文件,JSON 配置仍会被加载,即使这里显式传入 `false`。\n\t * @defaultValue `true`\n\t */\n\tjson?: boolean;\n\t/**\n\t * 是否使用 `@eslint/markdown` 推荐配置检查 `.md` 文档的结构和 Markdown 语法。\n\t *\n\t * 该配置关注 Markdown 文档本身,不会自动把项目的 JavaScript、TypeScript 或框架\n\t * 规则应用到围栏代码块;如需检查代码块,应通过项目覆盖配置明确指定。\n\t * @defaultValue `false`\n\t */\n\tmarkdown?: boolean;\n\t/**\n\t * 是否加载 `eslint-config-prettier`,关闭与 Prettier 冲突的 ESLint 格式规则。\n\t *\n\t * 该片段不会运行 Prettier,也不会检查文件是否符合 Prettier 输出;项目仍需自行安装\n\t * 并执行 Prettier。它位于内置规则之后、项目 `rules` 之前,因此项目仍可有意识地\n\t * 重新启用某条格式规则。\n\t * @defaultValue `true`\n\t */\n\tprettier?: boolean;\n\t/**\n\t * 是否为全部已启用代码文件加载 `eslint-plugin-regexp` 推荐规则。\n\t *\n\t * 规则用于发现无效、冗余、难以理解或可能产生性能问题的正则表达式;其中部分规则\n\t * 支持自动修复,执行 `eslint --fix` 后仍应运行项目测试验证真实匹配行为。\n\t * @defaultValue `true`\n\t */\n\tregexp?: boolean;\n\t/**\n\t * 是否启用 React、JSX/TSX 与 Hooks 正确性规则。\n\t *\n\t * `true` 使用默认 React 设置;传入对象可指定 React 版本、兼容 JSX 运行时包和多态\n\t * 组件属性名。规则范围由 `javascript` 与 `typescript` 共同决定:关闭其中一种语言\n\t * 后,React 不会继续接管该语言的文件。兼容 Preact 等运行时时,应同时配置相应的\n\t * `importSource`,但此选项不会修改 JSX 编译器或打包器设置。\n\t * @defaultValue `false`\n\t */\n\treact?: boolean | ReactConfigOptions;\n\t/**\n\t * 应用于全部已启用 JavaScript、TypeScript 和 Vue 文件的项目级规则记录。\n\t *\n\t * `RuleOptions` 为已安装插件提供精确规则名、严重级别和选项自动补全。该记录排在\n\t * 内置规则及 Prettier 兼容层之后,可以覆盖它们;但其余位置参数中的配置优先级更高。\n\t * JSON、Markdown、Angular HTML 模板或其他特殊文件范围应使用其余位置参数单独配置。\n\t * @defaultValue `undefined`\n\t */\n\trules?: RuleOptions;\n\t/**\n\t * 是否启用 `package.json` 顶层字段的固定顺序规则。\n\t *\n\t * 规则只在执行 `eslint --fix` 时重排字段,并刻意不进入顺序具有运行时语义的\n\t * `exports` 条件对象。首次启用通常会产生较大的纯排序差异,建议单独提交并复核。\n\t * 启用此项会同时加载 JSON 解析配置。\n\t * @defaultValue `false`\n\t */\n\tsortPackageJson?: boolean;\n\t/**\n\t * 是否按 TypeScript 配置主题顺序整理 `tsconfig.json` 与 `tsconfig.*.json`。\n\t *\n\t * 规则不会改变编译选项值,只在执行 `eslint --fix` 时调整字段顺序。首次启用可能产生\n\t * 较大差异,建议单独提交并确认继承关系仍清晰。启用此项会同时加载 JSON 解析配置。\n\t * @defaultValue `false`\n\t */\n\tsortTsconfig?: boolean;\n\t/**\n\t * 是否让工厂接管 `.ts`、`.cts`、`.mts` 与 `.tsx` 文件。\n\t *\n\t * `true` 使用无需类型信息的 TypeScript 推荐与风格预置;传入对象可进一步启用\n\t * `typeChecked` 和指定 `tsconfigRootDir`。类型感知设置还会同步给 Vue 与 React 的\n\t * TypeScript 配置。传入 `false` 会移除 TypeScript 文件范围,使 Vue 退回 JavaScript\n\t * 脚本解析,并且不能再启用 Angular。\n\t * @defaultValue `true`\n\t */\n\ttypescript?: boolean | TypeScriptConfigOptions;\n\t/**\n\t * 是否让工厂接管 Vue 3 `.vue` 单文件组件。\n\t *\n\t * 启用后加载 Vue 3 推荐规则、模板解析器以及本库的 Vue 规则。脚本语言跟随\n\t * `typescript`:TypeScript 开启时同时支持 `<script lang=\"ts\">` 和类型感知选项,\n\t * 关闭时仅按 JavaScript 解析脚本。此库不提供 Vue 2 兼容预置。\n\t * @defaultValue `true`\n\t */\n\tvue?: boolean;\n}\n\n/**\n * `fastConfig()` 使用的稳定默认选项。\n *\n * @remarks\n * 对象在运行时被冻结,不包含无固定默认值的 `globals`、`ignores` 与 `rules` 字段。\n * 调用方应将其视为只读参考,不应依赖修改该对象来改变工厂行为。\n */\nexport const defaultConfigOptions = Object.freeze({\n\tangular: false,\n\tenvironment: \"browser\",\n\tgitignore: true,\n\timports: true,\n\tjavascript: true,\n\tjson: true,\n\tmarkdown: false,\n\tprettier: true,\n\treact: false,\n\tregexp: true,\n\tsortPackageJson: false,\n\tsortTsconfig: false,\n\ttypescript: true,\n\tvue: true,\n} as const satisfies Required<Omit<FastConfigOptions, \"globals\" | \"ignores\" | \"rules\">>);\n\n/**\n * 创建面向 Vue 3、Vite、TypeScript 与浏览器后台管理项目的 ESLint Flat Config。\n *\n * @remarks\n * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON 和\n * Prettier 兼容层。React、Angular、Markdown 与清单排序按需启用;Lodash 导入策略\n * 通过 `@fast-china/eslint-config/configs` 独立组合。\n * 额外配置参数会放在内置配置之后,因此项目可以按文件范围覆盖任何默认规则。\n *\n * @param options - 控制内置语言、框架、插件与项目级规则的选项。\n * @param overrides - 追加到全部内置片段之后的 ESLint Flat Config,可用于按文件覆盖默认行为。\n * @returns 按应用顺序展开、可直接导出给 ESLint 的 Flat Config 数组。\n * @throws {@link TypeError} 当启用 Angular 的同时显式关闭 TypeScript 时抛出。\n *\n * @example\n * ```ts\n * import fastConfig from \"@fast-china/eslint-config\";\n *\n * export default fastConfig(\n * { react: true, vue: false },\n * { files: [\"src/index.ts\"], rules: { \"no-console\": \"error\" } },\n * );\n * ```\n */\nexport const fastConfig = (options: FastConfigOptions = {}, ...overrides: Config[]): Config[] => {\n\tconst angular = options.angular ?? defaultConfigOptions.angular;\n\tconst environment = options.environment ?? defaultConfigOptions.environment;\n\tconst gitignore = options.gitignore ?? defaultConfigOptions.gitignore;\n\tconst imports = options.imports ?? defaultConfigOptions.imports;\n\tconst javascript = options.javascript ?? defaultConfigOptions.javascript;\n\tconst json = options.json ?? defaultConfigOptions.json;\n\tconst markdown = options.markdown ?? defaultConfigOptions.markdown;\n\tconst prettier = options.prettier ?? defaultConfigOptions.prettier;\n\tconst react = options.react ?? defaultConfigOptions.react;\n\tconst regexp = options.regexp ?? defaultConfigOptions.regexp;\n\tconst sortPackageJson = options.sortPackageJson ?? defaultConfigOptions.sortPackageJson;\n\tconst sortTsconfig = options.sortTsconfig ?? defaultConfigOptions.sortTsconfig;\n\tconst typescript = options.typescript ?? defaultConfigOptions.typescript;\n\tconst vue = options.vue ?? defaultConfigOptions.vue;\n\n\tconst typeScriptEnabled = typescript !== false;\n\tconst typeScriptOptions = typeof typescript === \"object\" ? typescript : {};\n\tconst angularEnabled = angular !== false;\n\tconst angularOptions = typeof angular === \"object\" ? angular : {};\n\tconst reactEnabled = react !== false;\n\tconst reactOptions = typeof react === \"object\" ? react : {};\n\n\tif (angularEnabled && !typeScriptEnabled) {\n\t\tthrow new TypeError(\"Angular support requires TypeScript. Remove `typescript: false` or disable `angular`.\");\n\t}\n\t// RuleOptions 是无字符串索引签名的精确映射;运行时形状仍完全符合 ESLint RulesRecord。\n\tconst projectRules = options.rules as Linter.RulesRecord | undefined;\n\tconst scriptFiles = [...(javascript ? GLOBS_JAVASCRIPT : []), ...(typeScriptEnabled ? GLOBS_TYPESCRIPT : [])];\n\tconst codeFiles = [...scriptFiles, ...(vue ? [GLOB_VUE] : [])];\n\tconst jsonEnabled = json || sortPackageJson || sortTsconfig;\n\n\treturn defineConfig([\n\t\t...createGlobalIgnores(options.ignores),\n\t\t...(gitignore ? createGitignoreConfigs() : []),\n\t\t...(codeFiles.length\n\t\t\t? [\n\t\t\t\t\t...createEnvironmentConfigs({\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tfiles: codeFiles,\n\t\t\t\t\t\tglobals: options.globals,\n\t\t\t\t\t\tnodeFiles: scriptFiles,\n\t\t\t\t\t}),\n\t\t\t\t\t...createCommonConfigs(codeFiles),\n\t\t\t\t]\n\t\t\t: []),\n\t\t...(javascript ? createJavaScriptConfigs() : []),\n\t\t...(imports && codeFiles.length ? createImportConfigs(codeFiles) : []),\n\t\t...(regexp && codeFiles.length ? createRegexpConfigs(codeFiles) : []),\n\t\t...(typeScriptEnabled ? createTypeScriptConfigs(typeScriptOptions) : []),\n\t\t...(jsonEnabled ? createJsonConfigs() : []),\n\t\t...(sortPackageJson ? createPackageJsonSortConfigs() : []),\n\t\t...(sortTsconfig ? createTsconfigSortConfigs() : []),\n\t\t...(vue ? createVueConfigs({ typescript: typeScriptEnabled, typescriptOptions: typeScriptOptions }) : []),\n\t\t...(reactEnabled\n\t\t\t? createReactConfigs(reactOptions, {\n\t\t\t\t\tjavascript,\n\t\t\t\t\ttypeChecked: typeScriptOptions.typeChecked ?? false,\n\t\t\t\t\ttypescript: typeScriptEnabled,\n\t\t\t\t})\n\t\t\t: []),\n\t\t...(angularEnabled ? createAngularConfigs(angularOptions) : []),\n\t\t...(markdown ? createMarkdownConfigs() : []),\n\t\t...(prettier ? createPrettierConfigs() : []),\n\t\t...(projectRules && codeFiles.length\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"@fast-china/project/rules\",\n\t\t\t\t\t\tfiles: codeFiles,\n\t\t\t\t\t\trules: projectRules,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: []),\n\t\t...overrides,\n\t]);\n};\n\nexport default fastConfig;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * 根入口提供面向 Vue 3 浏览器管理项目的默认配置工厂。\n *\n * 配置片段、glob 常量与原始规则分别由 `./configs`、`./constants` 与 `./rules` 子路径提供。\n *\n * @packageDocumentation\n */\nimport { type Config, defineConfig } from \"eslint/config\";\nimport { type AngularConfigOptions, createAngularConfigs } from \"./configs/angular\";\nimport { createCommonConfigs } from \"./configs/common\";\nimport { type RuntimeEnvironment, createEnvironmentConfigs } from \"./configs/environment\";\nimport { createGitignoreConfigs, createGlobalIgnores } from \"./configs/ignores\";\nimport { createImportConfigs } from \"./configs/import\";\nimport { createJavaScriptConfigs } from \"./configs/javascript\";\nimport { createJsonConfigs } from \"./configs/json\";\nimport { createMarkdownConfigs } from \"./configs/markdown\";\nimport { createPrettierConfigs } from \"./configs/prettier\";\nimport { type ReactConfigOptions, createReactConfigs } from \"./configs/react\";\nimport { createRegexpConfigs } from \"./configs/regexp\";\nimport { createPackageJsonSortConfigs } from \"./configs/sort-package\";\nimport { createTsconfigSortConfigs } from \"./configs/sort-tsconfig\";\nimport { type TypeScriptConfigOptions, createTypeScriptConfigs } from \"./configs/typescript\";\nimport { createVueConfigs } from \"./configs/vue\";\nimport { GLOBS_JAVASCRIPT, GLOBS_TYPESCRIPT, GLOB_VUE } from \"./constants\";\nimport type { RuleOptions } from \"./typegen\";\nimport type { Linter } from \"eslint\";\n\ntype RejectUnknownRuleNames<Rules extends RuleOptions> = Rules & Record<Exclude<keyof Rules, keyof RuleOptions>, never>;\n\n/**\n * 为项目规则提供精确的规则名、严重级别和规则选项自动补全。\n *\n * @remarks\n * 该函数不会修改传入对象;它只在 TypeScript 编译阶段拒绝未知规则和无效选项。\n *\n * @typeParam Rules - 调用方传入的规则记录类型;保留字面量键和值以提供精确推断。\n * @param rules - 需要进行规则名、严重级别和选项校验的 ESLint 规则记录。\n * @returns 原始规则记录。返回值同时兼容 ESLint 的通用 `RulesRecord` 类型。\n */\nexport const defineRules = <const Rules extends RuleOptions>(rules: RejectUnknownRuleNames<Rules>): Rules & Linter.RulesRecord => rules;\n\nexport type { RuleOptions } from \"./typegen\";\n\n/**\n * 核心工厂 `fastConfig()` 的项目级 ESLint Flat Config 选项。\n *\n * @remarks\n *\n * 每个字段只控制一个相对独立的配置片段。未传入字段时使用下方 `@defaultValue` 标注的值;\n * 布尔选项传入 `false` 会让工厂完全跳过对应片段,支持对象形式的框架或 TypeScript\n * 选项传入 `true` 时采用其内部默认值,传入对象时则在启用能力的同时覆盖内部默认值。\n *\n * `rules` 会在全部内置规则和 Prettier 兼容层之后应用;`fastConfig()` 的其余位置参数\n * 又会排在 `rules` 之后。因此,常规的全项目规则放在 `rules` 中,按文件覆盖或需要最高\n * 优先级的配置应通过其余位置参数传入。\n *\n * 这些选项只负责生成 ESLint 配置,不会修改 TypeScript、Vite 或各框架的构建配置。\n *\n * @example\n * ```ts\n * export default fastConfig({\n * environment: \"browser\",\n * react: { version: \"detect\" },\n * typescript: { typeChecked: true },\n * vue: false,\n * });\n * ```\n */\nexport interface FastConfigOptions {\n\t/**\n\t * 是否启用 Angular 源码与模板检查。\n\t *\n\t * `true` 使用 Angular 默认选项;传入对象可控制内联模板与模板无障碍规则。\n\t * 启用后会检查 Angular TypeScript 源码、外部 `.html` 模板,并默认提取\n\t * `@Component()` 中的内联模板。Angular 依赖 TypeScript 解析能力,因此不能与\n\t * `typescript: false` 同时使用,否则 `fastConfig()` 会直接抛出配置错误。\n\t *\n\t * 此选项只配置 ESLint,不会创建或修改 Angular CLI、编译器或项目文件。\n\t * @defaultValue `false`\n\t */\n\tangular?: boolean | AngularConfigOptions;\n\t/**\n\t * 应用代码实际运行的环境,用于声明 ESLint 可识别的运行时全局变量。\n\t *\n\t * - `\"browser\"`:提供浏览器全局变量,例如 `window`、`document`。\n\t * - `\"node\"`:提供 Node.js 全局变量,例如 `process`、`Buffer`。\n\t * - `\"universal\"`:同时提供浏览器与 Node.js 全局变量,适合 SSR 或同构代码。\n\t *\n\t * 常见 Vue、React、Angular 与 Vite 浏览器应用通常保持 `\"browser\"`。无论选择哪种\n\t * 环境,配置文件、脚本目录和测试文件等 Node.js 工程文件都会单独获得 Node.js\n\t * 全局变量。此选项不改变 JavaScript 编译目标或打包平台。\n\t * @defaultValue `\"browser\"`\n\t */\n\tenvironment?: RuntimeEnvironment;\n\t/**\n\t * 追加到应用代码运行环境中的项目级全局变量。\n\t *\n\t * 适用于测试运行器、UniApp、浏览器扩展或其他宿主平台注入的 API。值的格式遵循\n\t * ESLint `Linter.Globals`,可以声明为 `\"readonly\"`、`\"writable\"` 或 `\"off\"`。\n\t * 自定义值在环境预置之后合并,因此同名项目配置可以覆盖预置的读写权限。\n\t * @defaultValue `undefined`\n\t */\n\tglobals?: Linter.Globals;\n\t/**\n\t * 是否读取运行 ESLint 的项目根目录中的 `.gitignore` 并转换为全局忽略规则。\n\t *\n\t * 关闭此项只会停止读取 `.gitignore`,不会移除本库内置的依赖目录、构建产物、\n\t * 缓存、生成文件和锁文件忽略模式;如需补充忽略项,请使用 `ignores`。\n\t * @defaultValue `true`\n\t */\n\tgitignore?: boolean;\n\t/**\n\t * 追加到内置全局忽略集合末尾的 ESLint glob 模式。\n\t *\n\t * 这些模式不会替换内置忽略项。模式按 ESLint Flat Config 的全局忽略语义解析,\n\t * 适合排除项目特有的生成目录、工具输出或不应参与检查的资源。\n\t * @defaultValue `[]`\n\t */\n\tignores?: readonly string[];\n\t/**\n\t * 是否为全部已启用代码文件加载 `eslint-plugin-import-x` 推荐规则和本库覆盖规则。\n\t *\n\t * 该片段检查常见的 ESM 导入导出问题,但共享配置不会猜测项目的路径别名或自定义\n\t * resolver,因此默认关闭了强依赖模块解析且容易误报的规则。如果项目重新启用这些\n\t * 规则,应在传给 `fastConfig()` 的覆盖配置中同时补充 resolver。关闭本选项不会影响\n\t * JavaScript 或 TypeScript 的基础语法检查。\n\t * @defaultValue `true`\n\t */\n\timports?: boolean;\n\t/**\n\t * 是否让工厂接管 JavaScript、CommonJS、ES Module 与 JSX 文件。\n\t *\n\t * 启用时匹配 `.js`、`.cjs`、`.mjs` 与 `.jsx`;关闭后这些文件不会进入基础规则、\n\t * 环境全局变量、import、regexp 或 React 的 JavaScript 配置范围,但不会影响\n\t * 已启用的 TypeScript、Vue、JSON 或 Markdown 文件。\n\t * @defaultValue `true`\n\t */\n\tjavascript?: boolean;\n\t/**\n\t * 是否检查 JSON、JSONC 与 JSON5 文件,并为三种方言分别使用兼容的推荐规则。\n\t *\n\t * 此选项不负责字段排序。`sortPackageJson` 或 `sortTsconfig` 任一启用时,为了让对应\n\t * 排序规则能够解析文件,JSON 配置仍会被加载,即使这里显式传入 `false`。\n\t * @defaultValue `true`\n\t */\n\tjson?: boolean;\n\t/**\n\t * 是否使用 `@eslint/markdown` 推荐配置检查 `.md` 文档的结构和 Markdown 语法。\n\t *\n\t * 该配置关注 Markdown 文档本身,不会自动把项目的 JavaScript、TypeScript 或框架\n\t * 规则应用到围栏代码块;如需检查代码块,应通过项目覆盖配置明确指定。\n\t * @defaultValue `true`\n\t */\n\tmarkdown?: boolean;\n\t/**\n\t * 是否加载 `eslint-config-prettier`,关闭与 Prettier 冲突的 ESLint 格式规则。\n\t *\n\t * 该片段不会运行 Prettier,也不会检查文件是否符合 Prettier 输出;项目仍需自行安装\n\t * 并执行 Prettier。它位于内置规则之后、项目 `rules` 之前,因此项目仍可有意识地\n\t * 重新启用某条格式规则。\n\t * @defaultValue `true`\n\t */\n\tprettier?: boolean;\n\t/**\n\t * 是否为全部已启用代码文件加载 `eslint-plugin-regexp` 推荐规则。\n\t *\n\t * 规则用于发现无效、冗余、难以理解或可能产生性能问题的正则表达式;其中部分规则\n\t * 支持自动修复,执行 `eslint --fix` 后仍应运行项目测试验证真实匹配行为。\n\t * @defaultValue `true`\n\t */\n\tregexp?: boolean;\n\t/**\n\t * 是否启用 React、JSX/TSX 与 Hooks 正确性规则。\n\t *\n\t * `true` 使用默认 React 设置;传入对象可指定 React 版本、兼容 JSX 运行时包和多态\n\t * 组件属性名。规则范围由 `javascript` 与 `typescript` 共同决定:关闭其中一种语言\n\t * 后,React 不会继续接管该语言的文件。兼容 Preact 等运行时时,应同时配置相应的\n\t * `importSource`,但此选项不会修改 JSX 编译器或打包器设置。\n\t * @defaultValue `false`\n\t */\n\treact?: boolean | ReactConfigOptions;\n\t/**\n\t * 应用于全部已启用 JavaScript、TypeScript 和 Vue 文件的项目级规则记录。\n\t *\n\t * `RuleOptions` 为已安装插件提供精确规则名、严重级别和选项自动补全。该记录排在\n\t * 内置规则及 Prettier 兼容层之后,可以覆盖它们;但其余位置参数中的配置优先级更高。\n\t * JSON、Markdown、Angular HTML 模板或其他特殊文件范围应使用其余位置参数单独配置。\n\t * @defaultValue `undefined`\n\t */\n\trules?: RuleOptions;\n\t/**\n\t * 是否启用 `package.json` 顶层字段的固定顺序规则。\n\t *\n\t * 规则只在执行 `eslint --fix` 时重排字段,并刻意不进入顺序具有运行时语义的\n\t * `exports` 条件对象。首次启用通常会产生较大的纯排序差异,建议单独提交并复核。\n\t * 启用此项会同时加载 JSON 解析配置。\n\t * @defaultValue `true`\n\t */\n\tsortPackageJson?: boolean;\n\t/**\n\t * 是否按 TypeScript 配置主题顺序整理 `tsconfig.json` 与 `tsconfig.*.json`。\n\t *\n\t * 规则不会改变编译选项值,只在执行 `eslint --fix` 时调整字段顺序。首次启用可能产生\n\t * 较大差异,建议单独提交并确认继承关系仍清晰。启用此项会同时加载 JSON 解析配置。\n\t * @defaultValue `true`\n\t */\n\tsortTsconfig?: boolean;\n\t/**\n\t * 是否让工厂接管 `.ts`、`.cts`、`.mts` 与 `.tsx` 文件。\n\t *\n\t * `true` 使用无需类型信息的 TypeScript 推荐与风格预置;传入对象可进一步启用\n\t * `typeChecked` 和指定 `tsconfigRootDir`。类型感知设置还会同步给 Vue 与 React 的\n\t * TypeScript 配置。传入 `false` 会移除 TypeScript 文件范围,使 Vue 退回 JavaScript\n\t * 脚本解析,并且不能再启用 Angular。\n\t * @defaultValue `true`\n\t */\n\ttypescript?: boolean | TypeScriptConfigOptions;\n\t/**\n\t * 是否让工厂接管 Vue 3 `.vue` 单文件组件。\n\t *\n\t * 启用后加载 Vue 3 推荐规则、模板解析器以及本库的 Vue 规则。脚本语言跟随\n\t * `typescript`:TypeScript 开启时同时支持 `<script lang=\"ts\">` 和类型感知选项,\n\t * 关闭时仅按 JavaScript 解析脚本。此库不提供 Vue 2 兼容预置。\n\t * @defaultValue `true`\n\t */\n\tvue?: boolean;\n}\n\n/**\n * `fastConfig()` 使用的稳定默认选项。\n *\n * @remarks\n * 对象在运行时被冻结,不包含无固定默认值的 `globals`、`ignores` 与 `rules` 字段。\n * 调用方应将其视为只读参考,不应依赖修改该对象来改变工厂行为。\n */\nexport const defaultConfigOptions = Object.freeze({\n\tangular: false,\n\tenvironment: \"browser\",\n\tgitignore: true,\n\timports: true,\n\tjavascript: true,\n\tjson: true,\n\tmarkdown: true,\n\tprettier: true,\n\treact: false,\n\tregexp: true,\n\tsortPackageJson: true,\n\tsortTsconfig: true,\n\ttypescript: true,\n\tvue: true,\n} as const satisfies Required<Omit<FastConfigOptions, \"globals\" | \"ignores\" | \"rules\">>);\n\n/**\n * 创建面向 Vue 3、Vite、TypeScript 与浏览器后台管理项目的 ESLint Flat Config。\n *\n * @remarks\n * 默认启用浏览器环境、JavaScript、TypeScript、Vue 3、import、RegExp、JSON、Markdown、\n * 清单排序和 Prettier 兼容层。React 与 Angular 按需启用;Lodash 导入策略通过\n * `@fast-china/eslint-config/configs` 独立组合。\n * 额外配置参数会放在内置配置之后,因此项目可以按文件范围覆盖任何默认规则。\n *\n * @param options - 控制内置语言、框架、插件与项目级规则的选项。\n * @param overrides - 追加到全部内置片段之后的 ESLint Flat Config,可用于按文件覆盖默认行为。\n * @returns 按应用顺序展开、可直接导出给 ESLint 的 Flat Config 数组。\n * @throws {@link TypeError} 当启用 Angular 的同时显式关闭 TypeScript 时抛出。\n *\n * @example\n * ```ts\n * import { fastConfig } from \"@fast-china/eslint-config\";\n *\n * export default fastConfig(\n * { react: true, vue: false },\n * { files: [\"src/index.ts\"], rules: { \"no-console\": \"error\" } },\n * );\n * ```\n */\nexport const fastConfig = (options: FastConfigOptions = {}, ...overrides: Config[]): Config[] => {\n\tconst angular = options.angular ?? defaultConfigOptions.angular;\n\tconst environment = options.environment ?? defaultConfigOptions.environment;\n\tconst gitignore = options.gitignore ?? defaultConfigOptions.gitignore;\n\tconst imports = options.imports ?? defaultConfigOptions.imports;\n\tconst javascript = options.javascript ?? defaultConfigOptions.javascript;\n\tconst json = options.json ?? defaultConfigOptions.json;\n\tconst markdown = options.markdown ?? defaultConfigOptions.markdown;\n\tconst prettier = options.prettier ?? defaultConfigOptions.prettier;\n\tconst react = options.react ?? defaultConfigOptions.react;\n\tconst regexp = options.regexp ?? defaultConfigOptions.regexp;\n\tconst sortPackageJson = options.sortPackageJson ?? defaultConfigOptions.sortPackageJson;\n\tconst sortTsconfig = options.sortTsconfig ?? defaultConfigOptions.sortTsconfig;\n\tconst typescript = options.typescript ?? defaultConfigOptions.typescript;\n\tconst vue = options.vue ?? defaultConfigOptions.vue;\n\n\tconst typeScriptEnabled = typescript !== false;\n\tconst typeScriptOptions = typeof typescript === \"object\" ? typescript : {};\n\tconst angularEnabled = angular !== false;\n\tconst angularOptions = typeof angular === \"object\" ? angular : {};\n\tconst reactEnabled = react !== false;\n\tconst reactOptions = typeof react === \"object\" ? react : {};\n\n\tif (angularEnabled && !typeScriptEnabled) {\n\t\tthrow new TypeError(\"Angular support requires TypeScript. Remove `typescript: false` or disable `angular`.\");\n\t}\n\t// RuleOptions 是无字符串索引签名的精确映射;运行时形状仍完全符合 ESLint RulesRecord。\n\tconst projectRules = options.rules as Linter.RulesRecord | undefined;\n\tconst scriptFiles = [...(javascript ? GLOBS_JAVASCRIPT : []), ...(typeScriptEnabled ? GLOBS_TYPESCRIPT : [])];\n\tconst codeFiles = [...scriptFiles, ...(vue ? [GLOB_VUE] : [])];\n\tconst jsonEnabled = json || sortPackageJson || sortTsconfig;\n\n\treturn defineConfig([\n\t\t...createGlobalIgnores(options.ignores),\n\t\t...(gitignore ? createGitignoreConfigs() : []),\n\t\t...(codeFiles.length\n\t\t\t? [\n\t\t\t\t\t...createEnvironmentConfigs({\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tfiles: codeFiles,\n\t\t\t\t\t\tglobals: options.globals,\n\t\t\t\t\t\tnodeFiles: scriptFiles,\n\t\t\t\t\t}),\n\t\t\t\t\t...createCommonConfigs(codeFiles),\n\t\t\t\t]\n\t\t\t: []),\n\t\t...(javascript ? createJavaScriptConfigs() : []),\n\t\t...(imports && codeFiles.length ? createImportConfigs(codeFiles) : []),\n\t\t...(regexp && codeFiles.length ? createRegexpConfigs(codeFiles) : []),\n\t\t...(typeScriptEnabled ? createTypeScriptConfigs(typeScriptOptions) : []),\n\t\t...(jsonEnabled ? createJsonConfigs() : []),\n\t\t...(sortPackageJson ? createPackageJsonSortConfigs() : []),\n\t\t...(sortTsconfig ? createTsconfigSortConfigs() : []),\n\t\t...(vue ? createVueConfigs({ typescript: typeScriptEnabled, typescriptOptions: typeScriptOptions }) : []),\n\t\t...(reactEnabled\n\t\t\t? createReactConfigs(reactOptions, {\n\t\t\t\t\tjavascript,\n\t\t\t\t\ttypeChecked: typeScriptOptions.typeChecked ?? false,\n\t\t\t\t\ttypescript: typeScriptEnabled,\n\t\t\t\t})\n\t\t\t: []),\n\t\t...(angularEnabled ? createAngularConfigs(angularOptions) : []),\n\t\t...(markdown ? createMarkdownConfigs() : []),\n\t\t...(prettier ? createPrettierConfigs() : []),\n\t\t...(projectRules && codeFiles.length\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"@fast-china/project/rules\",\n\t\t\t\t\t\tfiles: codeFiles,\n\t\t\t\t\t\trules: projectRules,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: []),\n\t\t...overrides,\n\t]);\n};\n\n/**\n * 可直接导出或展开的默认 ESLint Flat Config。\n *\n * @remarks\n * 需要修改选项或追加覆盖配置时,请使用具名导出的 {@link fastConfig} 工厂。\n *\n * @example\n * ```ts\n * import fastChina from \"@fast-china/eslint-config\";\n *\n * export default fastChina;\n * ```\n */\nconst fastChina: Config[] = fastConfig();\n\nexport default fastChina;\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-package.mjs","names":[],"sources":["../../src/rules/sort-package.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * package.json 属性排序规则。\n *\n * @remarks\n * `[高影响][可自动修复]`:仅在 `sortPackageJson: true` 时启用,首次修复可能重排大量字段。\n * 注意:这里故意不排序 `exports` 内部键;条件导出的键顺序具有模块解析语义。\n */\nexport const packageJsonSortRules = {\n\t// [高影响][可自动修复][按需启用] npm 的 files 清单按字母排序;数组顺序不改打包集合,但首次 diff 较大。\n\t\"jsonc/sort-array-values\": [\n\t\t\"error\",\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^files$\",\n\t\t},\n\t],\n\t// [高影响][可自动修复][按需启用] 仅排序明确安全的 package.json 区域,不进入 exports 条件对象。\n\t\"jsonc/sort-keys\": [\n\t\t\"error\",\n\t\t// 根字段按常见阅读顺序组织,减少不同项目之间的清单噪声。\n\t\t{\n\t\t\torder: [\n\t\t\t\t\"name\",\n\t\t\t\t\"version\",\n\t\t\t\t\"private\",\n\t\t\t\t\"packageManager\",\n\t\t\t\t\"description\",\n\t\t\t\t\"type\",\n\t\t\t\t\"keywords\",\n\t\t\t\t\"license\",\n\t\t\t\t\"homepage\",\n\t\t\t\t\"bugs\",\n\t\t\t\t\"repository\",\n\t\t\t\t\"author\",\n\t\t\t\t\"contributors\",\n\t\t\t\t\"funding\",\n\t\t\t\t\"files\",\n\t\t\t\t\"main\",\n\t\t\t\t\"module\",\n\t\t\t\t\"types\",\n\t\t\t\t\"exports\",\n\t\t\t\t\"typesVersions\",\n\t\t\t\t\"sideEffects\",\n\t\t\t\t\"unpkg\",\n\t\t\t\t\"jsdelivr\",\n\t\t\t\t\"browser\",\n\t\t\t\t\"bin\",\n\t\t\t\t\"man\",\n\t\t\t\t\"directories\",\n\t\t\t\t\"publishConfig\",\n\t\t\t\t\"scripts\",\n\t\t\t\t\"peerDependencies\",\n\t\t\t\t\"peerDependenciesMeta\",\n\t\t\t\t\"optionalDependencies\",\n\t\t\t\t\"dependencies\",\n\t\t\t\t\"devDependencies\",\n\t\t\t\t\"engines\",\n\t\t\t\t\"config\",\n\t\t\t\t\"overrides\",\n\t\t\t\t\"pnpm\",\n\t\t\t\t\"husky\",\n\t\t\t\t\"lint-staged\",\n\t\t\t\t\"eslintConfig\",\n\t\t\t\t\"prettier\",\n\t\t\t],\n\t\t\tpathPattern: \"^$\",\n\t\t},\n\t\t// 各类依赖映射按包名排序,方便发现重复或异常依赖。\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$\",\n\t\t},\n\t\t// overrides/resolutions 只排序直接键;修改前仍应关注包管理器的模式匹配语义。\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^(?:resolutions|overrides|pnpm.overrides)$\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;AASA,MAAa,uBAAuB;CAEnC,2BAA2B,CAC1B,SACA;EACC,OAAO,EAAE,MAAM,MAAM;EACrB,aAAa;CACd,CACD;CAEA,mBAAmB;EAClB;EAEA;GACC,OAAO;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GACA,aAAa;EACd;EAEA;GACC,OAAO,EAAE,MAAM,MAAM;GACrB,aAAa;EACd;EAEA;GACC,OAAO,EAAE,MAAM,MAAM;GACrB,aAAa;EACd;CACD;AACD"}
1
+ {"version":3,"file":"sort-package.mjs","names":[],"sources":["../../src/rules/sort-package.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * package.json 属性排序规则。\n *\n * @remarks\n * `[高影响][可自动修复]`:仅在 `sortPackageJson: true` 时启用,首次修复可能重排大量字段。\n * 注意:这里故意不排序 `exports` 内部键;条件导出的键顺序具有模块解析语义。\n */\nexport const packageJsonSortRules = {\n\t// [高影响][可自动修复] npm 的 files 清单按字母排序;数组顺序不改打包集合,但首次 diff 较大。\n\t\"jsonc/sort-array-values\": [\n\t\t\"error\",\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^files$\",\n\t\t},\n\t],\n\t// [高影响][可自动修复] 仅排序明确安全的 package.json 区域,不进入 exports 条件对象。\n\t\"jsonc/sort-keys\": [\n\t\t\"error\",\n\t\t// 根字段按常见阅读顺序组织,减少不同项目之间的清单噪声。\n\t\t{\n\t\t\torder: [\n\t\t\t\t\"name\",\n\t\t\t\t\"version\",\n\t\t\t\t\"private\",\n\t\t\t\t\"packageManager\",\n\t\t\t\t\"description\",\n\t\t\t\t\"type\",\n\t\t\t\t\"keywords\",\n\t\t\t\t\"license\",\n\t\t\t\t\"homepage\",\n\t\t\t\t\"bugs\",\n\t\t\t\t\"repository\",\n\t\t\t\t\"author\",\n\t\t\t\t\"contributors\",\n\t\t\t\t\"funding\",\n\t\t\t\t\"files\",\n\t\t\t\t\"main\",\n\t\t\t\t\"module\",\n\t\t\t\t\"types\",\n\t\t\t\t\"exports\",\n\t\t\t\t\"typesVersions\",\n\t\t\t\t\"sideEffects\",\n\t\t\t\t\"unpkg\",\n\t\t\t\t\"jsdelivr\",\n\t\t\t\t\"browser\",\n\t\t\t\t\"bin\",\n\t\t\t\t\"man\",\n\t\t\t\t\"directories\",\n\t\t\t\t\"publishConfig\",\n\t\t\t\t\"scripts\",\n\t\t\t\t\"peerDependencies\",\n\t\t\t\t\"peerDependenciesMeta\",\n\t\t\t\t\"optionalDependencies\",\n\t\t\t\t\"dependencies\",\n\t\t\t\t\"devDependencies\",\n\t\t\t\t\"engines\",\n\t\t\t\t\"config\",\n\t\t\t\t\"overrides\",\n\t\t\t\t\"pnpm\",\n\t\t\t\t\"husky\",\n\t\t\t\t\"lint-staged\",\n\t\t\t\t\"eslintConfig\",\n\t\t\t\t\"prettier\",\n\t\t\t],\n\t\t\tpathPattern: \"^$\",\n\t\t},\n\t\t// 各类依赖映射按包名排序,方便发现重复或异常依赖。\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$\",\n\t\t},\n\t\t// overrides/resolutions 只排序直接键;修改前仍应关注包管理器的模式匹配语义。\n\t\t{\n\t\t\torder: { type: \"asc\" },\n\t\t\tpathPattern: \"^(?:resolutions|overrides|pnpm.overrides)$\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;AASA,MAAa,uBAAuB;CAEnC,2BAA2B,CAC1B,SACA;EACC,OAAO,EAAE,MAAM,MAAM;EACrB,aAAa;CACd,CACD;CAEA,mBAAmB;EAClB;EAEA;GACC,OAAO;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GACA,aAAa;EACd;EAEA;GACC,OAAO,EAAE,MAAM,MAAM;GACrB,aAAa;EACd;EAEA;GACC,OAAO,EAAE,MAAM,MAAM;GACrB,aAAa;EACd;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-tsconfig.mjs","names":[],"sources":["../../src/rules/sort-tsconfig.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * tsconfig.json 属性排序规则。\n *\n * @remarks\n * `[高影响][可自动修复]`:仅在 `sortTsconfig: true` 时启用,首次修复会重排大量字段,\n * 但只改变 JSONC 的阅读顺序,不改变 TypeScript 编译选项值。\n */\nexport const tsconfigJsonSortRules = {\n\t// tsconfig 是 JSONC,注释用于解释不直观的编译器取舍,必须保留。\n\t\"jsonc/no-comments\": \"off\",\n\n\t// [高影响][可自动修复][按需启用] 只调整顶层和 compilerOptions 的键顺序,不改写任何选项值或数组。\n\t\"jsonc/sort-keys\": [\n\t\t\"error\",\n\t\t// 顶层按继承、选项、项目引用和文件范围的阅读顺序排列。\n\t\t{\n\t\t\torder: [\"extends\", \"compilerOptions\", \"references\", \"files\", \"include\", \"exclude\"],\n\t\t\tpathPattern: \"^$\",\n\t\t},\n\t\t// compilerOptions 的顺序跟随 TypeScript 文档主题,便于检索和代码审查。\n\t\t{\n\t\t\torder: [\n\t\t\t\t/* Projects */\n\t\t\t\t\"incremental\",\n\t\t\t\t\"composite\",\n\t\t\t\t\"tsBuildInfoFile\",\n\t\t\t\t\"disableSourceOfProjectReferenceRedirect\",\n\t\t\t\t\"disableSolutionSearching\",\n\t\t\t\t\"disableReferencedProjectLoad\",\n\t\t\t\t/* Language and Environment */\n\t\t\t\t\"target\",\n\t\t\t\t\"jsx\",\n\t\t\t\t\"jsxFactory\",\n\t\t\t\t\"jsxFragmentFactory\",\n\t\t\t\t\"jsxImportSource\",\n\t\t\t\t\"lib\",\n\t\t\t\t\"moduleDetection\",\n\t\t\t\t\"noLib\",\n\t\t\t\t\"reactNamespace\",\n\t\t\t\t\"useDefineForClassFields\",\n\t\t\t\t\"emitDecoratorMetadata\",\n\t\t\t\t\"experimentalDecorators\",\n\t\t\t\t/* Modules */\n\t\t\t\t\"baseUrl\",\n\t\t\t\t\"rootDir\",\n\t\t\t\t\"rootDirs\",\n\t\t\t\t\"customConditions\",\n\t\t\t\t\"module\",\n\t\t\t\t\"moduleResolution\",\n\t\t\t\t\"moduleSuffixes\",\n\t\t\t\t\"noResolve\",\n\t\t\t\t\"paths\",\n\t\t\t\t\"resolveJsonModule\",\n\t\t\t\t\"resolvePackageJsonExports\",\n\t\t\t\t\"resolvePackageJsonImports\",\n\t\t\t\t\"typeRoots\",\n\t\t\t\t\"types\",\n\t\t\t\t\"allowArbitraryExtensions\",\n\t\t\t\t\"allowImportingTsExtensions\",\n\t\t\t\t\"allowUmdGlobalAccess\",\n\t\t\t\t/* JavaScript Support */\n\t\t\t\t\"allowJs\",\n\t\t\t\t\"checkJs\",\n\t\t\t\t\"maxNodeModuleJsDepth\",\n\t\t\t\t/* Type Checking */\n\t\t\t\t\"strict\",\n\t\t\t\t\"strictBindCallApply\",\n\t\t\t\t\"strictFunctionTypes\",\n\t\t\t\t\"strictNullChecks\",\n\t\t\t\t\"strictPropertyInitialization\",\n\t\t\t\t\"allowUnreachableCode\",\n\t\t\t\t\"allowUnusedLabels\",\n\t\t\t\t\"alwaysStrict\",\n\t\t\t\t\"exactOptionalPropertyTypes\",\n\t\t\t\t\"noFallthroughCasesInSwitch\",\n\t\t\t\t\"noImplicitAny\",\n\t\t\t\t\"noImplicitOverride\",\n\t\t\t\t\"noImplicitReturns\",\n\t\t\t\t\"noImplicitThis\",\n\t\t\t\t\"noPropertyAccessFromIndexSignature\",\n\t\t\t\t\"noUncheckedIndexedAccess\",\n\t\t\t\t\"noUnusedLocals\",\n\t\t\t\t\"noUnusedParameters\",\n\t\t\t\t\"useUnknownInCatchVariables\",\n\t\t\t\t/* Emit */\n\t\t\t\t\"declaration\",\n\t\t\t\t\"declarationDir\",\n\t\t\t\t\"declarationMap\",\n\t\t\t\t\"downlevelIteration\",\n\t\t\t\t\"emitBOM\",\n\t\t\t\t\"emitDeclarationOnly\",\n\t\t\t\t\"importHelpers\",\n\t\t\t\t\"importsNotUsedAsValues\",\n\t\t\t\t\"inlineSourceMap\",\n\t\t\t\t\"inlineSources\",\n\t\t\t\t\"isolatedDeclarations\",\n\t\t\t\t\"mapRoot\",\n\t\t\t\t\"newLine\",\n\t\t\t\t\"noEmit\",\n\t\t\t\t\"noEmitHelpers\",\n\t\t\t\t\"noEmitOnError\",\n\t\t\t\t\"outDir\",\n\t\t\t\t\"outFile\",\n\t\t\t\t\"preserveConstEnums\",\n\t\t\t\t\"preserveValueImports\",\n\t\t\t\t\"removeComments\",\n\t\t\t\t\"sourceMap\",\n\t\t\t\t\"sourceRoot\",\n\t\t\t\t\"stripInternal\",\n\t\t\t\t/* Interop Constraints */\n\t\t\t\t\"allowSyntheticDefaultImports\",\n\t\t\t\t\"esModuleInterop\",\n\t\t\t\t\"forceConsistentCasingInFileNames\",\n\t\t\t\t\"isolatedModules\",\n\t\t\t\t\"preserveSymlinks\",\n\t\t\t\t\"verbatimModuleSyntax\",\n\t\t\t\t/* Completeness */\n\t\t\t\t\"skipDefaultLibCheck\",\n\t\t\t\t\"skipLibCheck\",\n\t\t\t],\n\t\t\tpathPattern: \"^compilerOptions$\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;AASA,MAAa,wBAAwB;CAEpC,qBAAqB;CAGrB,mBAAmB;EAClB;EAEA;GACC,OAAO;IAAC;IAAW;IAAmB;IAAc;IAAS;IAAW;GAAS;GACjF,aAAa;EACd;EAEA;GACC,OAAO;IAEN;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;GACD;GACA,aAAa;EACd;CACD;AACD"}
1
+ {"version":3,"file":"sort-tsconfig.mjs","names":[],"sources":["../../src/rules/sort-tsconfig.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * tsconfig.json 属性排序规则。\n *\n * @remarks\n * `[高影响][可自动修复]`:仅在 `sortTsconfig: true` 时启用,首次修复会重排大量字段,\n * 但只改变 JSONC 的阅读顺序,不改变 TypeScript 编译选项值。\n */\nexport const tsconfigJsonSortRules = {\n\t// tsconfig 是 JSONC,注释用于解释不直观的编译器取舍,必须保留。\n\t\"jsonc/no-comments\": \"off\",\n\n\t// [高影响][可自动修复] 只调整顶层和 compilerOptions 的键顺序,不改写任何选项值或数组。\n\t\"jsonc/sort-keys\": [\n\t\t\"error\",\n\t\t// 顶层按继承、选项、项目引用和文件范围的阅读顺序排列。\n\t\t{\n\t\t\torder: [\"extends\", \"compilerOptions\", \"references\", \"files\", \"include\", \"exclude\"],\n\t\t\tpathPattern: \"^$\",\n\t\t},\n\t\t// compilerOptions 的顺序跟随 TypeScript 文档主题,便于检索和代码审查。\n\t\t{\n\t\t\torder: [\n\t\t\t\t/* Projects */\n\t\t\t\t\"incremental\",\n\t\t\t\t\"composite\",\n\t\t\t\t\"tsBuildInfoFile\",\n\t\t\t\t\"disableSourceOfProjectReferenceRedirect\",\n\t\t\t\t\"disableSolutionSearching\",\n\t\t\t\t\"disableReferencedProjectLoad\",\n\t\t\t\t/* Language and Environment */\n\t\t\t\t\"target\",\n\t\t\t\t\"jsx\",\n\t\t\t\t\"jsxFactory\",\n\t\t\t\t\"jsxFragmentFactory\",\n\t\t\t\t\"jsxImportSource\",\n\t\t\t\t\"lib\",\n\t\t\t\t\"moduleDetection\",\n\t\t\t\t\"noLib\",\n\t\t\t\t\"reactNamespace\",\n\t\t\t\t\"useDefineForClassFields\",\n\t\t\t\t\"emitDecoratorMetadata\",\n\t\t\t\t\"experimentalDecorators\",\n\t\t\t\t/* Modules */\n\t\t\t\t\"baseUrl\",\n\t\t\t\t\"rootDir\",\n\t\t\t\t\"rootDirs\",\n\t\t\t\t\"customConditions\",\n\t\t\t\t\"module\",\n\t\t\t\t\"moduleResolution\",\n\t\t\t\t\"moduleSuffixes\",\n\t\t\t\t\"noResolve\",\n\t\t\t\t\"paths\",\n\t\t\t\t\"resolveJsonModule\",\n\t\t\t\t\"resolvePackageJsonExports\",\n\t\t\t\t\"resolvePackageJsonImports\",\n\t\t\t\t\"typeRoots\",\n\t\t\t\t\"types\",\n\t\t\t\t\"allowArbitraryExtensions\",\n\t\t\t\t\"allowImportingTsExtensions\",\n\t\t\t\t\"allowUmdGlobalAccess\",\n\t\t\t\t/* JavaScript Support */\n\t\t\t\t\"allowJs\",\n\t\t\t\t\"checkJs\",\n\t\t\t\t\"maxNodeModuleJsDepth\",\n\t\t\t\t/* Type Checking */\n\t\t\t\t\"strict\",\n\t\t\t\t\"strictBindCallApply\",\n\t\t\t\t\"strictFunctionTypes\",\n\t\t\t\t\"strictNullChecks\",\n\t\t\t\t\"strictPropertyInitialization\",\n\t\t\t\t\"allowUnreachableCode\",\n\t\t\t\t\"allowUnusedLabels\",\n\t\t\t\t\"alwaysStrict\",\n\t\t\t\t\"exactOptionalPropertyTypes\",\n\t\t\t\t\"noFallthroughCasesInSwitch\",\n\t\t\t\t\"noImplicitAny\",\n\t\t\t\t\"noImplicitOverride\",\n\t\t\t\t\"noImplicitReturns\",\n\t\t\t\t\"noImplicitThis\",\n\t\t\t\t\"noPropertyAccessFromIndexSignature\",\n\t\t\t\t\"noUncheckedIndexedAccess\",\n\t\t\t\t\"noUnusedLocals\",\n\t\t\t\t\"noUnusedParameters\",\n\t\t\t\t\"useUnknownInCatchVariables\",\n\t\t\t\t/* Emit */\n\t\t\t\t\"declaration\",\n\t\t\t\t\"declarationDir\",\n\t\t\t\t\"declarationMap\",\n\t\t\t\t\"downlevelIteration\",\n\t\t\t\t\"emitBOM\",\n\t\t\t\t\"emitDeclarationOnly\",\n\t\t\t\t\"importHelpers\",\n\t\t\t\t\"importsNotUsedAsValues\",\n\t\t\t\t\"inlineSourceMap\",\n\t\t\t\t\"inlineSources\",\n\t\t\t\t\"isolatedDeclarations\",\n\t\t\t\t\"mapRoot\",\n\t\t\t\t\"newLine\",\n\t\t\t\t\"noEmit\",\n\t\t\t\t\"noEmitHelpers\",\n\t\t\t\t\"noEmitOnError\",\n\t\t\t\t\"outDir\",\n\t\t\t\t\"outFile\",\n\t\t\t\t\"preserveConstEnums\",\n\t\t\t\t\"preserveValueImports\",\n\t\t\t\t\"removeComments\",\n\t\t\t\t\"sourceMap\",\n\t\t\t\t\"sourceRoot\",\n\t\t\t\t\"stripInternal\",\n\t\t\t\t/* Interop Constraints */\n\t\t\t\t\"allowSyntheticDefaultImports\",\n\t\t\t\t\"esModuleInterop\",\n\t\t\t\t\"forceConsistentCasingInFileNames\",\n\t\t\t\t\"isolatedModules\",\n\t\t\t\t\"preserveSymlinks\",\n\t\t\t\t\"verbatimModuleSyntax\",\n\t\t\t\t/* Completeness */\n\t\t\t\t\"skipDefaultLibCheck\",\n\t\t\t\t\"skipLibCheck\",\n\t\t\t],\n\t\t\tpathPattern: \"^compilerOptions$\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;AASA,MAAa,wBAAwB;CAEpC,qBAAqB;CAGrB,mBAAmB;EAClB;EAEA;GACC,OAAO;IAAC;IAAW;IAAmB;IAAc;IAAS;IAAW;GAAS;GACjF,aAAa;EACd;EAEA;GACC,OAAO;IAEN;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;GACD;GACA,aAAa;EACd;CACD;AACD"}
@@ -8,7 +8,7 @@
8
8
 
9
9
  当前仓库已经具备完整 ESLint Flat Config 开源库所需的核心能力:稳定且精简的公共 API、明确的语言作用域、可选类型感知检查、精确规则类型、可重复构建、集成测试、CI、发布归档检查和中英文文档。
10
10
 
11
- 默认场景面向普通 Vue 3 + Vite + TypeScript 浏览器后台管理项目;ReactAngular、Markdown 和清单排序按需启用,Lodash 策略通过 `configs` 子路径独立组合。配置仍支持 JavaScript、Node.js 工程文件、JSON 方言、正则表达式和模块导入检查,项目覆写始终位于内置配置之后。
11
+ 默认场景面向普通 Vue 3 + Vite + TypeScript 浏览器后台管理项目;Markdown 和清单排序默认启用,ReactAngular 按需启用,Lodash 策略通过 `configs` 子路径独立组合。配置仍支持 JavaScript、Node.js 工程文件、JSON 方言、正则表达式和模块导入检查,项目覆写始终位于内置配置之后。
12
12
 
13
13
  ## 审查范围
14
14
 
@@ -34,7 +34,7 @@
34
34
  | 数据与文档文件 | 通过 | JSON、JSONC、JSON5 和 Markdown 分别使用对应语言配置 |
35
35
  | 规则自动补全 | 通过 | 从 ESLint 核心和随包插件 schema 生成精确 `RuleOptions` |
36
36
  | Lodash 策略 | 通过 | 可选统一 `lodash` 或 `lodash-unified`,默认不限制项目依赖选择 |
37
- | 清单排序 | 通过 | 默认关闭;启用后不会重排 `package.json#exports` 条件键 |
37
+ | 清单排序 | 通过 | 默认启用;不会重排 `package.json#exports` 条件键 |
38
38
  | Prettier | 通过 | 只关闭冲突规则,格式化由 Prettier CLI 或编辑器负责 |
39
39
  | 构建与发布 | 通过 | tsdown 生成 `.mjs`、`.d.mts` 和 source map,`prepack` 执行完整质量门禁 |
40
40
  | 自动化验证 | 通过 | 运行时测试、消费者类型测试、格式检查、静态检查和 Node.js 多版本 CI |
@@ -13,7 +13,7 @@ High impact does not mean inherently unsafe. It means adoption or fix review is
13
13
 
14
14
  ## Bundled preset sources
15
15
 
16
- `fastConfig()` defaults to a conventional Vue 3 browser administration project with TypeScript, JavaScript, import, RegExp, JSON, and the Prettier compatibility layer. React, Angular, Markdown, type-aware TypeScript linting, and manifest sorting are opt-in. Lodash policies are separate fragments from the `configs` subpath.
16
+ The default export and `fastConfig()` defaults target a conventional Vue 3 browser administration project with TypeScript, JavaScript, import, RegExp, JSON, Markdown, manifest sorting, and the Prettier compatibility layer. React, Angular, and type-aware TypeScript linting are opt-in. Lodash policies are separate fragments from the `configs` subpath.
17
17
 
18
18
  | Scope | Inherited preset | Notes |
19
19
  | ---------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
@@ -25,7 +25,7 @@ High impact does not mean inherently unsafe. It means adoption or fix review is
25
25
  | Imports | `eslint-plugin-import-x` `recommended` | Local rules add import placement, deduplication, and ordering. Resolver-dependent checks stay disabled. |
26
26
  | RegExp | `eslint-plugin-regexp` `flat/recommended` | Some rules can rewrite regular expressions; run tests after bulk fixes. |
27
27
  | JSON dialects | The matching `eslint-plugin-jsonc` `flat/recommended-*` preset | JSON, JSONC, and JSON5 are scoped separately. |
28
- | Markdown (opt-in) | `@eslint/markdown` `recommended` | Checks Markdown structure and syntax. |
28
+ | Markdown | `@eslint/markdown` `recommended` | Checks Markdown structure and syntax. |
29
29
  | Prettier compatibility | `eslint-config-prettier/flat` | Disables conflicting rules only; it does not run Prettier through ESLint. |
30
30
 
31
31
  The exact upstream rule set is defined by the dependency versions in `pnpm-lock.yaml`. Review the effective config with the config inspector whenever ESLint or a plugin is upgraded instead of copying an upstream list that will become stale.
@@ -51,12 +51,12 @@ The exact upstream rule set is defined by the dependency versions in `pnpm-lock.
51
51
 
52
52
  `vue/no-v-html` is also enabled as a warning. It is a security signal rather than an automatic rewrite: HTML must be trusted or reliably sanitized.
53
53
 
54
- ## High-impact features not enabled by default
54
+ ## High-impact and disabled-by-default features
55
55
 
56
56
  - Type-aware TypeScript and Vue presets require `typeChecked: true`. They add project-service cost and rules such as `no-floating-promises`. `prefer-promise-reject-errors` permits transparent forwarding of `unknown` rejection reasons while still reporting statically known non-`Error` values such as strings and numbers.
57
57
  - React requires `react: true`. Its upstream recommended and official Hooks presets include blocking component, Hooks, and React Compiler rules; review existing custom hook and memoization patterns when adopting it.
58
58
  - Angular requires `angular: true`. The framework bundle enables `prefer-inject`, OnPush change detection, standalone components, modern template control flow, and template accessibility. These policies are intentionally not active in the default Vue configuration.
59
- - The `jsonc/sort-keys` and `jsonc/sort-array-values` manifest rules require `sortPackageJson: true` or `sortTsconfig: true`. Isolate the first fix and verify the publish manifest.
59
+ - The `jsonc/sort-keys` and `jsonc/sort-array-values` manifest rules are enabled by default and can be disabled with `sortPackageJson: false` or `sortTsconfig: false`. Isolate the first fix and verify the publish manifest.
60
60
  - Lodash import restrictions require `createLodashConfigs("lodash")` or `createLodashConfigs("lodash-unified")` from the `configs` subpath. They use `no-restricted-imports` to prevent mixed static package entry points but do not inspect dynamic `import()` or CommonJS `require()`.
61
61
  - Resolver-dependent import checks such as `import-x/no-unresolved` and `import-x/named` stay disabled.
62
62
  - Keys inside `package.json#exports` are never sorted. Node conditional exports use key order during matching, so reordering can change the loaded file.
@@ -68,9 +68,9 @@ When Angular is enabled, the highest-adoption-cost rules are `@angular-eslint/pr
68
68
  Overrides must follow the shared config and should target only the affected files:
69
69
 
70
70
  ```js
71
- import fastChina, { defineRules } from "@fast-china/eslint-config";
71
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
72
72
 
73
- export default fastChina(
73
+ export default fastConfig(
74
74
  {},
75
75
  {
76
76
  name: "project/typescript-exceptions",
@@ -15,7 +15,7 @@
15
15
 
16
16
  ## 内置预置来源
17
17
 
18
- `fastConfig()` 默认面向普通 Vue 3 浏览器后台管理项目,开启 TypeScript、JavaScript、import、RegExp、JSON Prettier 兼容层;React、Angular、Markdown、TypeScript 类型感知和清单排序按需启用。Lodash 策略通过 `configs` 子路径独立组合。
18
+ 默认导出和 `fastConfig()` 默认面向普通 Vue 3 浏览器后台管理项目,开启 TypeScript、JavaScript、import、RegExp、JSON、Markdown、清单排序与 Prettier 兼容层;React、AngularTypeScript 类型感知按需启用。Lodash 策略通过 `configs` 子路径独立组合。
19
19
 
20
20
  | 范围 | 默认继承 | 说明 |
21
21
  | ---------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
@@ -27,7 +27,7 @@
27
27
  | import | `eslint-plugin-import-x` 的 `recommended` | 本库额外配置导入位置、去重和排序。解析器相关规则默认关闭,避免绑定具体别名方案。 |
28
28
  | RegExp | `eslint-plugin-regexp` 的 `flat/recommended` | 部分规则可自动改写正则表达式,批量修复后需运行测试。 |
29
29
  | JSON/JSONC/JSON5 | `eslint-plugin-jsonc` 对应方言的 `flat/recommended-*` | 三种方言按扩展名隔离,不会互相叠加。 |
30
- | Markdown(按需) | `@eslint/markdown` 的 `recommended` | 检查 Markdown 结构和语法。 |
30
+ | Markdown | `@eslint/markdown` 的 `recommended` | 检查 Markdown 结构和语法。 |
31
31
  | Prettier 兼容 | `eslint-config-prettier/flat` | 只关闭冲突的格式规则,不会在 ESLint 内执行 Prettier。 |
32
32
 
33
33
  上游预置的具体规则集合由锁文件中的依赖版本决定,升级 ESLint 或任一插件时都可能变化。审查实际生效配置时,应以配置检查器和 `pnpm-lock.yaml` 为准,而不是复制一份很快过期的上游规则列表。
@@ -55,12 +55,12 @@
55
55
 
56
56
  另外,`vue/no-v-html` 默认是 `warn`,属于安全关注而非自动重写规则。它提示调用方必须保证 HTML 来自可信来源或经过可靠净化。
57
57
 
58
- ## 明确不默认启用的高影响能力
58
+ ## 高影响能力与默认关闭能力
59
59
 
60
60
  - TypeScript 和 Vue 的类型感知预置仅在 `typeChecked: true` 时启用;它们会增加项目服务开销,并启用 `no-floating-promises` 等需要类型信息的规则。`prefer-promise-reject-errors` 允许透明转发 `unknown` 拒绝原因,但静态可知的 string、number 等非 `Error` 值仍会被报告。
61
61
  - React 仅在 `react: true` 时启用。其上游推荐预置和官方 Hooks 预置包含阻断级组件、Hooks 与 React Compiler 规则;接入旧项目时应重点审查自定义 Hook 和 memoization 写法。
62
62
  - Angular 仅在 `angular: true` 时启用。框架规则默认要求 `inject()`、OnPush 变更检测、独立组件、现代模板控制流和模板无障碍;这些约束不会进入默认 Vue 配置。
63
- - 清单排序规则 `jsonc/sort-keys`、`jsonc/sort-array-values` 分别仅在 `sortPackageJson: true`、`sortTsconfig: true` 时启用;首次修复应单独提交并核对发布清单。
63
+ - 清单排序规则 `jsonc/sort-keys`、`jsonc/sort-array-values` 默认启用,可分别通过 `sortPackageJson: false`、`sortTsconfig: false` 关闭;首次修复应单独提交并核对发布清单。
64
64
  - Lodash 静态导入限制仅在从 `configs` 子路径调用 `createLodashConfigs("lodash")` 或 `createLodashConfigs("lodash-unified")` 时启用。该策略使用 `no-restricted-imports` 阻止混用包入口,但不会检查动态 `import()` 或 CommonJS `require()`。
65
65
  - `import-x/no-unresolved`、`import-x/named` 等依赖 resolver 的检查默认关闭。
66
66
  - `package.json` 的 `exports` 条件键永不自动排序。Node 条件导出按键顺序匹配,改写顺序可能改变实际加载文件。
@@ -72,9 +72,9 @@
72
72
  覆盖项必须放在共享配置之后,并尽量限定文件范围:
73
73
 
74
74
  ```js
75
- import fastChina, { defineRules } from "@fast-china/eslint-config";
75
+ import { defineRules, fastConfig } from "@fast-china/eslint-config";
76
76
 
77
- export default fastChina(
77
+ export default fastConfig(
78
78
  {},
79
79
  {
80
80
  name: "project/typescript-exceptions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fast-china/eslint-config",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Opinionated, typed ESLint Flat Config for Vue 3, React, Angular, Vite, TypeScript, JavaScript, and Node.js.",
5
5
  "type": "module",
6
6
  "keywords": [