@fast-china/eslint-config 2.0.4 → 2.0.5
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 +7 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/configs/angular.d.mts +7 -2
- package/dist/configs/angular.d.mts.map +1 -1
- package/dist/configs/angular.mjs +4 -0
- package/dist/configs/angular.mjs.map +1 -1
- package/dist/configs/common.d.mts +4 -0
- package/dist/configs/common.d.mts.map +1 -1
- package/dist/configs/common.mjs +4 -0
- package/dist/configs/common.mjs.map +1 -1
- package/dist/configs/environment.d.mts +16 -4
- package/dist/configs/environment.d.mts.map +1 -1
- package/dist/configs/environment.mjs +4 -0
- package/dist/configs/environment.mjs.map +1 -1
- package/dist/configs/ignores.d.mts +16 -2
- package/dist/configs/ignores.d.mts.map +1 -1
- package/dist/configs/ignores.mjs +16 -2
- package/dist/configs/ignores.mjs.map +1 -1
- package/dist/configs/import.d.mts +4 -0
- package/dist/configs/import.d.mts.map +1 -1
- package/dist/configs/import.mjs +4 -0
- package/dist/configs/import.mjs.map +1 -1
- package/dist/configs/javascript.d.mts +5 -0
- package/dist/configs/javascript.d.mts.map +1 -1
- package/dist/configs/javascript.mjs +5 -0
- package/dist/configs/javascript.mjs.map +1 -1
- package/dist/configs/json.d.mts +4 -0
- package/dist/configs/json.d.mts.map +1 -1
- package/dist/configs/json.mjs +4 -0
- package/dist/configs/json.mjs.map +1 -1
- package/dist/configs/lodash.d.mts +11 -1
- package/dist/configs/lodash.d.mts.map +1 -1
- package/dist/configs/lodash.mjs +6 -0
- package/dist/configs/lodash.mjs.map +1 -1
- package/dist/configs/markdown.d.mts +3 -0
- package/dist/configs/markdown.d.mts.map +1 -1
- package/dist/configs/markdown.mjs +3 -0
- package/dist/configs/markdown.mjs.map +1 -1
- package/dist/configs/prettier.d.mts +3 -0
- package/dist/configs/prettier.d.mts.map +1 -1
- package/dist/configs/prettier.mjs +3 -0
- package/dist/configs/prettier.mjs.map +1 -1
- package/dist/configs/react.d.mts +13 -6
- package/dist/configs/react.d.mts.map +1 -1
- package/dist/configs/react.mjs +5 -0
- package/dist/configs/react.mjs.map +1 -1
- package/dist/configs/regexp.d.mts +4 -0
- package/dist/configs/regexp.d.mts.map +1 -1
- package/dist/configs/regexp.mjs +4 -0
- package/dist/configs/regexp.mjs.map +1 -1
- package/dist/configs/sort-package.d.mts +3 -0
- package/dist/configs/sort-package.d.mts.map +1 -1
- package/dist/configs/sort-package.mjs +3 -0
- package/dist/configs/sort-package.mjs.map +1 -1
- package/dist/configs/sort-tsconfig.d.mts +3 -0
- package/dist/configs/sort-tsconfig.d.mts.map +1 -1
- package/dist/configs/sort-tsconfig.mjs +3 -0
- package/dist/configs/sort-tsconfig.mjs.map +1 -1
- package/dist/configs/typescript.d.mts +19 -3
- package/dist/configs/typescript.d.mts.map +1 -1
- package/dist/configs/typescript.mjs +16 -1
- package/dist/configs/typescript.mjs.map +1 -1
- package/dist/configs/vue.d.mts +7 -2
- package/dist/configs/vue.d.mts.map +1 -1
- package/dist/configs/vue.mjs +4 -0
- package/dist/configs/vue.mjs.map +1 -1
- package/dist/constants/index.d.mts +12 -2
- package/dist/constants/index.d.mts.map +1 -1
- package/dist/constants/index.mjs +12 -2
- package/dist/constants/index.mjs.map +1 -1
- package/dist/index.d.mts +48 -19
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +31 -1
- package/dist/index.mjs.map +1 -1
- package/dist/rules/angular.d.mts +15 -2
- package/dist/rules/angular.d.mts.map +1 -1
- package/dist/rules/angular.mjs +15 -2
- package/dist/rules/angular.mjs.map +1 -1
- package/dist/rules/common.d.mts +1 -0
- package/dist/rules/common.d.mts.map +1 -1
- package/dist/rules/common.mjs +1 -0
- package/dist/rules/common.mjs.map +1 -1
- package/dist/rules/import.d.mts +7 -1
- package/dist/rules/import.d.mts.map +1 -1
- package/dist/rules/import.mjs +7 -1
- package/dist/rules/import.mjs.map +1 -1
- package/dist/rules/javascript.d.mts +2 -0
- package/dist/rules/javascript.d.mts.map +1 -1
- package/dist/rules/javascript.mjs +2 -0
- package/dist/rules/javascript.mjs.map +1 -1
- package/dist/rules/lodash.d.mts +2 -0
- package/dist/rules/lodash.d.mts.map +1 -1
- package/dist/rules/lodash.mjs +2 -0
- package/dist/rules/lodash.mjs.map +1 -1
- package/dist/rules/react.d.mts +1 -0
- package/dist/rules/react.d.mts.map +1 -1
- package/dist/rules/react.mjs +1 -0
- package/dist/rules/react.mjs.map +1 -1
- package/dist/rules/sort-package.d.mts +1 -0
- package/dist/rules/sort-package.d.mts.map +1 -1
- package/dist/rules/sort-package.mjs +1 -0
- package/dist/rules/sort-package.mjs.map +1 -1
- package/dist/rules/sort-tsconfig.d.mts +1 -0
- package/dist/rules/sort-tsconfig.d.mts.map +1 -1
- package/dist/rules/sort-tsconfig.mjs +1 -0
- package/dist/rules/sort-tsconfig.mjs.map +1 -1
- package/dist/rules/typescript.d.mts +2 -0
- package/dist/rules/typescript.d.mts.map +1 -1
- package/dist/rules/typescript.mjs +2 -0
- package/dist/rules/typescript.mjs.map +1 -1
- package/dist/rules/vue.d.mts +2 -0
- package/dist/rules/vue.d.mts.map +1 -1
- package/dist/rules/vue.mjs +2 -0
- package/dist/rules/vue.mjs.map +1 -1
- package/docs/engineering-audit.zh.md +5 -2
- package/package.json +6 -3
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.5 - 2026-08-02
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Upgraded public API documentation to complete TSDoc, including standard defaults, parameters, return values, thrown errors, remarks, examples, and package-level documentation.
|
|
14
|
+
- Separated runtime, type-contract, rule-governance, and package-contract tests, and replaced the hard-coded release version assertion with SemVer and changelog consistency checks.
|
|
15
|
+
|
|
9
16
|
## 2.0.4 - 2026-08-02
|
|
10
17
|
|
|
11
18
|
### Added
|
package/README.md
CHANGED
|
@@ -343,7 +343,7 @@ pnpm check
|
|
|
343
343
|
pnpm pack --dry-run
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
Run `pnpm typegen` after upgrading ESLint or a plugin and commit `src/typegen.d.ts`; never edit the generated file manually. `pnpm
|
|
346
|
+
Run `pnpm typegen` after upgrading ESLint or a plugin and commit `src/typegen.d.ts`; never edit the generated file manually. `pnpm test` rebuilds the package before running consumer type-contract, runtime integration, rule-governance, and package-contract tests. `pnpm check` adds source type-checking, full-repository linting, and formatting verification.
|
|
347
347
|
|
|
348
348
|
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution workflow, the [default-rule and risk guide](./docs/rules-risk.md) for rule maintenance, and [the engineering audit](./docs/engineering-audit.zh.md) for the current quality baseline.
|
|
349
349
|
|
package/README.zh.md
CHANGED
|
@@ -343,7 +343,7 @@ pnpm check
|
|
|
343
343
|
pnpm pack --dry-run
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
升级 ESLint 或插件后运行 `pnpm typegen` 并提交 `src/typegen.d.ts`;不要手工编辑生成文件。`pnpm check`
|
|
346
|
+
升级 ESLint 或插件后运行 `pnpm typegen` 并提交 `src/typegen.d.ts`;不要手工编辑生成文件。`pnpm test` 会先重新构建发布产物,再分别执行消费者类型契约、运行时集成、规则治理和发布包契约测试。`pnpm check` 在此基础上增加源码类型检查、全仓 ESLint 和格式验证。
|
|
347
347
|
|
|
348
348
|
贡献流程见 [CONTRIBUTING.md](./CONTRIBUTING.md),规则维护约定见 [默认规则与风险指南](./docs/rules-risk.zh.md),本次工程审查和质量基线见 [工程质量审查报告](./docs/engineering-audit.zh.md)。
|
|
349
349
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Angular TypeScript 源码与 HTML 模板检查的细分选项。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 该对象通过 `fastConfig({ angular: { ... } })` 传入。只要传入对象,Angular 支持就会
|
|
6
7
|
* 被启用;未指定的字段继续使用各自默认值。Angular 配置始终包含框架 TypeScript 规则
|
|
7
8
|
* 和外部 `.html` 模板基础规则,本接口只控制成本或迁移影响较高的可选部分。
|
|
@@ -16,7 +17,7 @@ interface AngularConfigOptions {
|
|
|
16
17
|
*
|
|
17
18
|
* 关闭后仍会检查 Angular TypeScript 源码和外部 `.html` 模板,只是不再处理组件中的
|
|
18
19
|
* 内联模板。大型项目若主要使用外部模板,或 processor 与其他工具发生冲突,可暂时关闭。
|
|
19
|
-
* @
|
|
20
|
+
* @defaultValue `true`
|
|
20
21
|
*/
|
|
21
22
|
inlineTemplates?: boolean;
|
|
22
23
|
/**
|
|
@@ -25,15 +26,19 @@ interface AngularConfigOptions {
|
|
|
25
26
|
* 该规则组检查替代文本、键盘交互、焦点、表单标签和 ARIA 等可访问性问题,适用于
|
|
26
27
|
* 外部模板与已提取的内联模板。关闭后仍保留模板语法、严格比较和现代控制流等基础规则。
|
|
27
28
|
* 对旧项目而言可能一次产生较多报告,建议在确认迁移计划后再决定是否临时关闭。
|
|
28
|
-
* @
|
|
29
|
+
* @defaultValue `true`
|
|
29
30
|
*/
|
|
30
31
|
templateAccessibility?: boolean;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* 创建 Angular TypeScript、外部 HTML 模板与内联模板配置。
|
|
34
35
|
*
|
|
36
|
+
* @remarks
|
|
35
37
|
* Angular 支持依赖工厂的 TypeScript 配置先注册 typescript-eslint 解析器;模板由
|
|
36
38
|
* Angular 专用 parser 解析,内联模板通过官方 processor 复用同一套 HTML 规则。
|
|
39
|
+
*
|
|
40
|
+
* @param options - 控制内联模板处理与模板无障碍规则的 Angular 选项。
|
|
41
|
+
* @returns 按 TypeScript 源码、外部模板顺序排列的 ESLint Flat Config 数组。
|
|
37
42
|
*/
|
|
38
43
|
declare const createAngularConfigs: ({ inlineTemplates, templateAccessibility }?: AngularConfigOptions) => import("eslint/config").ConfigObject[];
|
|
39
44
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.d.mts","names":[],"sources":["../../src/configs/angular.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"angular.d.mts","names":[],"sources":["../../src/configs/angular.ts"],"mappings":";;;;;;;;;;;;UAqBiB;;;;;;;;;EAShB;;;;;;;;;EASA;;;;;;;;;;;;cAaY,yBAAwB,iBAAA,0BAA0D,iDAAyB"}
|
package/dist/configs/angular.mjs
CHANGED
|
@@ -8,8 +8,12 @@ import { defineConfig } from "eslint/config";
|
|
|
8
8
|
/**
|
|
9
9
|
* 创建 Angular TypeScript、外部 HTML 模板与内联模板配置。
|
|
10
10
|
*
|
|
11
|
+
* @remarks
|
|
11
12
|
* Angular 支持依赖工厂的 TypeScript 配置先注册 typescript-eslint 解析器;模板由
|
|
12
13
|
* Angular 专用 parser 解析,内联模板通过官方 processor 复用同一套 HTML 规则。
|
|
14
|
+
*
|
|
15
|
+
* @param options - 控制内联模板处理与模板无障碍规则的 Angular 选项。
|
|
16
|
+
* @returns 按 TypeScript 源码、外部模板顺序排列的 ESLint Flat Config 数组。
|
|
13
17
|
*/
|
|
14
18
|
const createAngularConfigs = ({ inlineTemplates = true, templateAccessibility = true } = {}) => defineConfig([{
|
|
15
19
|
name: inlineTemplates ? "@fast-china/angular/typescript-with-inline-templates" : "@fast-china/angular/typescript",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.mjs","names":[],"sources":["../../src/configs/angular.ts"],"sourcesContent":["import angularPlugin from \"@angular-eslint/eslint-plugin\";\nimport angularTemplatePlugin from \"@angular-eslint/eslint-plugin-template\";\nimport angularTemplateParser from \"@angular-eslint/template-parser\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOB_ANGULAR_TEMPLATE, GLOB_ANGULAR_TYPESCRIPT } from \"../constants\";\nimport { angularRules, angularTemplateAccessibilityRules, angularTemplateRules } from \"../rules\";\n\nimport type { ESLint, Linter } from \"eslint\";\n\n/**\n * Angular TypeScript 源码与 HTML 模板检查的细分选项。\n *\n * 该对象通过 `fastConfig({ angular: { ... } })` 传入。只要传入对象,Angular 支持就会\n * 被启用;未指定的字段继续使用各自默认值。Angular 配置始终包含框架 TypeScript 规则\n * 和外部 `.html` 模板基础规则,本接口只控制成本或迁移影响较高的可选部分。\n *\n * Angular 支持依赖顶层 `typescript` 能力,不能与 `typescript: false` 同时使用。\n * 这些选项不会修改 Angular 编译器、CLI 或模板类型检查配置。\n */\nexport interface AngularConfigOptions {\n\t/**\n\t * 是否使用 Angular 官方 processor,从 TypeScript 文件的\n\t * `@Component({ template: ... })` 元数据中提取内联 HTML 并复用模板规则进行检查。\n\t *\n\t * 关闭后仍会检查 Angular TypeScript 源码和外部 `.html` 模板,只是不再处理组件中的\n\t * 内联模板。大型项目若主要使用外部模板,或 processor 与其他工具发生冲突,可暂时关闭。\n\t * @
|
|
1
|
+
{"version":3,"file":"angular.mjs","names":[],"sources":["../../src/configs/angular.ts"],"sourcesContent":["import angularPlugin from \"@angular-eslint/eslint-plugin\";\nimport angularTemplatePlugin from \"@angular-eslint/eslint-plugin-template\";\nimport angularTemplateParser from \"@angular-eslint/template-parser\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOB_ANGULAR_TEMPLATE, GLOB_ANGULAR_TYPESCRIPT } from \"../constants\";\nimport { angularRules, angularTemplateAccessibilityRules, angularTemplateRules } from \"../rules\";\n\nimport type { ESLint, Linter } from \"eslint\";\n\n/**\n * Angular TypeScript 源码与 HTML 模板检查的细分选项。\n *\n * @remarks\n * 该对象通过 `fastConfig({ angular: { ... } })` 传入。只要传入对象,Angular 支持就会\n * 被启用;未指定的字段继续使用各自默认值。Angular 配置始终包含框架 TypeScript 规则\n * 和外部 `.html` 模板基础规则,本接口只控制成本或迁移影响较高的可选部分。\n *\n * Angular 支持依赖顶层 `typescript` 能力,不能与 `typescript: false` 同时使用。\n * 这些选项不会修改 Angular 编译器、CLI 或模板类型检查配置。\n */\nexport interface AngularConfigOptions {\n\t/**\n\t * 是否使用 Angular 官方 processor,从 TypeScript 文件的\n\t * `@Component({ template: ... })` 元数据中提取内联 HTML 并复用模板规则进行检查。\n\t *\n\t * 关闭后仍会检查 Angular TypeScript 源码和外部 `.html` 模板,只是不再处理组件中的\n\t * 内联模板。大型项目若主要使用外部模板,或 processor 与其他工具发生冲突,可暂时关闭。\n\t * @defaultValue `true`\n\t */\n\tinlineTemplates?: boolean;\n\t/**\n\t * 是否在模板基础正确性规则之外启用 Angular 模板无障碍规则组。\n\t *\n\t * 该规则组检查替代文本、键盘交互、焦点、表单标签和 ARIA 等可访问性问题,适用于\n\t * 外部模板与已提取的内联模板。关闭后仍保留模板语法、严格比较和现代控制流等基础规则。\n\t * 对旧项目而言可能一次产生较多报告,建议在确认迁移计划后再决定是否临时关闭。\n\t * @defaultValue `true`\n\t */\n\ttemplateAccessibility?: boolean;\n}\n\n/**\n * 创建 Angular TypeScript、外部 HTML 模板与内联模板配置。\n *\n * @remarks\n * Angular 支持依赖工厂的 TypeScript 配置先注册 typescript-eslint 解析器;模板由\n * Angular 专用 parser 解析,内联模板通过官方 processor 复用同一套 HTML 规则。\n *\n * @param options - 控制内联模板处理与模板无障碍规则的 Angular 选项。\n * @returns 按 TypeScript 源码、外部模板顺序排列的 ESLint Flat Config 数组。\n */\nexport const createAngularConfigs = ({ inlineTemplates = true, templateAccessibility = true }: AngularConfigOptions = {}) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: inlineTemplates ? \"@fast-china/angular/typescript-with-inline-templates\" : \"@fast-china/angular/typescript\",\n\t\t\tfiles: [GLOB_ANGULAR_TYPESCRIPT],\n\t\t\tplugins: {\n\t\t\t\t\"@angular-eslint\": angularPlugin as unknown as ESLint.Plugin,\n\t\t\t},\n\t\t\t...(inlineTemplates\n\t\t\t\t? {\n\t\t\t\t\t\tprocessor: angularTemplatePlugin.processors[\"extract-inline-html\"] as Linter.Processor,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\trules: angularRules,\n\t\t},\n\t\t{\n\t\t\tname: templateAccessibility ? \"@fast-china/angular/template-accessibility\" : \"@fast-china/angular/template\",\n\t\t\tfiles: [GLOB_ANGULAR_TEMPLATE],\n\t\t\tlanguageOptions: {\n\t\t\t\tparser: angularTemplateParser as unknown as Linter.Parser,\n\t\t\t},\n\t\t\tplugins: {\n\t\t\t\t\"@angular-eslint/template\": angularTemplatePlugin as unknown as ESLint.Plugin,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t...angularTemplateRules,\n\t\t\t\t...(templateAccessibility ? angularTemplateAccessibilityRules : {}),\n\t\t\t},\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDA,MAAa,wBAAwB,EAAE,kBAAkB,MAAM,wBAAwB,SAA+B,CAAC,MACtH,aAAa,CACZ;CACC,MAAM,kBAAkB,yDAAyD;CACjF,OAAO,CAAC,uBAAuB;CAC/B,SAAS,EACR,mBAAmB,cACpB;CACA,GAAI,kBACD,EACA,WAAW,sBAAsB,WAAW,uBAC7C,IACC,CAAC;CACJ,OAAO;AACR,GACA;CACC,MAAM,wBAAwB,+CAA+C;CAC7E,OAAO,CAAC,qBAAqB;CAC7B,iBAAiB,EAChB,QAAQ,sBACT;CACA,SAAS,EACR,4BAA4B,sBAC7B;CACA,OAAO;EACN,GAAG;EACH,GAAI,wBAAwB,oCAAoC,CAAC;CAClE;AACD,CACD,CAAC"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建跨 JavaScript、TypeScript 与 Vue 脚本生效的通用配置。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 除公共规则外,这里还把无效的 `eslint-disable` 指令提升为错误,避免规则被移除后
|
|
6
7
|
* 留下长期失效的抑制注释。
|
|
8
|
+
*
|
|
9
|
+
* @param files - 应用公共规则的 ESLint glob 列表。
|
|
10
|
+
* @returns 包含公共规则与无效禁用指令检查的 Flat Config 数组。
|
|
7
11
|
*/
|
|
8
12
|
declare const createCommonConfigs: (files?: readonly string[]) => import("eslint/config").ConfigObject[];
|
|
9
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.mts","names":[],"sources":["../../src/configs/common.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.mts","names":[],"sources":["../../src/configs/common.ts"],"mappings":";;;;;;;;;;;cAea,sBAAuB,sDAAqC"}
|
package/dist/configs/common.mjs
CHANGED
|
@@ -5,8 +5,12 @@ import { defineConfig } from "eslint/config";
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建跨 JavaScript、TypeScript 与 Vue 脚本生效的通用配置。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 除公共规则外,这里还把无效的 `eslint-disable` 指令提升为错误,避免规则被移除后
|
|
9
10
|
* 留下长期失效的抑制注释。
|
|
11
|
+
*
|
|
12
|
+
* @param files - 应用公共规则的 ESLint glob 列表。
|
|
13
|
+
* @returns 包含公共规则与无效禁用指令检查的 Flat Config 数组。
|
|
10
14
|
*/
|
|
11
15
|
const createCommonConfigs = (files = GLOBS_CODE) => defineConfig([{
|
|
12
16
|
name: "@fast-china/common",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","names":[],"sources":["../../src/configs/common.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { commonRules } from \"../rules\";\n\n/**\n * 创建跨 JavaScript、TypeScript 与 Vue 脚本生效的通用配置。\n *\n * 除公共规则外,这里还把无效的 `eslint-disable` 指令提升为错误,避免规则被移除后\n * 留下长期失效的抑制注释。\n */\nexport const createCommonConfigs = (files: readonly string[] = GLOBS_CODE) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/common\",\n\t\t\tfiles: [...files],\n\t\t\tlinterOptions: {\n\t\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t\t},\n\t\t\trules: commonRules,\n\t\t},\n\t]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.mjs","names":[],"sources":["../../src/configs/common.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { commonRules } from \"../rules\";\n\n/**\n * 创建跨 JavaScript、TypeScript 与 Vue 脚本生效的通用配置。\n *\n * @remarks\n * 除公共规则外,这里还把无效的 `eslint-disable` 指令提升为错误,避免规则被移除后\n * 留下长期失效的抑制注释。\n *\n * @param files - 应用公共规则的 ESLint glob 列表。\n * @returns 包含公共规则与无效禁用指令检查的 Flat Config 数组。\n */\nexport const createCommonConfigs = (files: readonly string[] = GLOBS_CODE) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/common\",\n\t\t\tfiles: [...files],\n\t\t\tlinterOptions: {\n\t\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t\t},\n\t\t\trules: commonRules,\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,uBAAuB,QAA2B,eAC9D,aAAa,CACZ;CACC,MAAM;CACN,OAAO,CAAC,GAAG,KAAK;CAChB,eAAe,EACd,+BAA+B,QAChC;CACA,OAAO;AACR,CACD,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Linter } from "eslint";
|
|
2
2
|
//#region src/configs/environment.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* 应用源码可声明的运行时环境。
|
|
5
|
+
*
|
|
6
|
+
* - `"browser"` 仅提供浏览器全局变量。
|
|
7
|
+
* - `"node"` 仅提供 Node.js 全局变量。
|
|
8
|
+
* - `"universal"` 同时提供浏览器与 Node.js 全局变量。
|
|
9
|
+
*/
|
|
3
10
|
type RuntimeEnvironment = "browser" | "node" | "universal";
|
|
4
11
|
/**
|
|
5
12
|
* 运行时全局变量配置片段的选项。
|
|
6
13
|
*
|
|
14
|
+
* @remarks
|
|
7
15
|
* `fastConfig()` 会根据已启用的语言和框架计算 `files`、`nodeFiles`,再调用
|
|
8
16
|
* `createEnvironmentConfigs()`。该接口仍保持独立,以便环境片段的输入、默认值和文件
|
|
9
17
|
* 范围在源码中具有明确契约;直接组合配置片段时可从 `./configs` 子路径使用。
|
|
@@ -18,7 +26,7 @@ interface EnvironmentConfigOptions {
|
|
|
18
26
|
* `"browser"` 只注入浏览器全局变量,`"node"` 只注入 Node.js 全局变量,
|
|
19
27
|
* `"universal"` 同时注入两组。该值不会影响 `nodeFiles` 对应的工程文件;后者始终
|
|
20
28
|
* 使用 Node.js 全局变量。
|
|
21
|
-
* @
|
|
29
|
+
* @defaultValue `"browser"`
|
|
22
30
|
*/
|
|
23
31
|
environment?: RuntimeEnvironment;
|
|
24
32
|
/**
|
|
@@ -26,7 +34,7 @@ interface EnvironmentConfigOptions {
|
|
|
26
34
|
*
|
|
27
35
|
* 工厂会把当前启用的 JavaScript、TypeScript 和 Vue 文件范围传入这里。数组会复制到
|
|
28
36
|
* 生成配置中,不会在函数内部修改调用方传入的值。
|
|
29
|
-
* @
|
|
37
|
+
* @defaultValue {@link GLOBS_CODE}
|
|
30
38
|
*/
|
|
31
39
|
files?: readonly string[];
|
|
32
40
|
/**
|
|
@@ -35,7 +43,7 @@ interface EnvironmentConfigOptions {
|
|
|
35
43
|
* 每一项都会与内置的配置文件、脚本目录、测试文件和 CLI 文件模式组合为 ESLint
|
|
36
44
|
* Flat Config 的 AND 文件条件。例如顶层关闭 TypeScript 后,Node.js 工程片段也不会
|
|
37
45
|
* 因自身模式较宽而意外接管 `.ts` 文件。
|
|
38
|
-
* @
|
|
46
|
+
* @defaultValue {@link GLOBS_JAVASCRIPT}
|
|
39
47
|
*/
|
|
40
48
|
nodeFiles?: readonly string[];
|
|
41
49
|
/**
|
|
@@ -44,16 +52,20 @@ interface EnvironmentConfigOptions {
|
|
|
44
52
|
* 该记录在标准环境全局变量之后合并,所以同名条目可以覆盖预置权限。它应用于完整
|
|
45
53
|
* `files` 范围;其中属于 Node.js 工程文件的子集还会由后续片段追加标准 Node.js 全局
|
|
46
54
|
* 变量。值格式遵循 ESLint `Linter.Globals`。
|
|
47
|
-
* @
|
|
55
|
+
* @defaultValue `{}`
|
|
48
56
|
*/
|
|
49
57
|
globals?: Linter.Globals;
|
|
50
58
|
}
|
|
51
59
|
/**
|
|
52
60
|
* 创建运行时环境相关的 ESLint 配置。
|
|
53
61
|
*
|
|
62
|
+
* @remarks
|
|
54
63
|
* 返回两个相互独立的 Flat Config 片段:第一个为应用源码配置所选环境和项目级全局
|
|
55
64
|
* 变量;第二个仅命中配置、脚本、测试与 CLI 等工程文件,为它们配置 Node.js 全局变量
|
|
56
65
|
* 并允许使用 `console`。分离范围可以减少跨运行时的假阴性。
|
|
66
|
+
*
|
|
67
|
+
* @param options - 运行时环境、目标文件范围与项目级全局变量。
|
|
68
|
+
* @returns 依次包含应用运行时环境和 Node.js 工程文件环境的 Flat Config 数组。
|
|
57
69
|
*/
|
|
58
70
|
declare const createEnvironmentConfigs: ({ environment, files, nodeFiles, globals: projectGlobals }?: EnvironmentConfigOptions) => import("eslint/config").ConfigObject[];
|
|
59
71
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.mts","names":[],"sources":["../../src/configs/environment.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.mts","names":[],"sources":["../../src/configs/environment.ts"],"mappings":";;;;;;;;;KAcY;;;;;;;;;;;;UAaK;;;;;;;;;EAShB,cAAc;;;;;;;;EAQd;;;;;;;;;EASA;;;;;;;;;EASA,UAAU,OAAO;;;;;;;;;;;;;cAcL,6BAA4B,aAAA,OAAA,WAAA,SAAA,mBAKtC,qDAA6B"}
|
|
@@ -5,9 +5,13 @@ import globals from "globals";
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建运行时环境相关的 ESLint 配置。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 返回两个相互独立的 Flat Config 片段:第一个为应用源码配置所选环境和项目级全局
|
|
9
10
|
* 变量;第二个仅命中配置、脚本、测试与 CLI 等工程文件,为它们配置 Node.js 全局变量
|
|
10
11
|
* 并允许使用 `console`。分离范围可以减少跨运行时的假阴性。
|
|
12
|
+
*
|
|
13
|
+
* @param options - 运行时环境、目标文件范围与项目级全局变量。
|
|
14
|
+
* @returns 依次包含应用运行时环境和 Node.js 工程文件环境的 Flat Config 数组。
|
|
11
15
|
*/
|
|
12
16
|
const createEnvironmentConfigs = ({ environment = "browser", files = GLOBS_CODE, nodeFiles = GLOBS_JAVASCRIPT, globals: projectGlobals = {} } = {}) => {
|
|
13
17
|
const runtimeGlobals = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.mjs","names":[],"sources":["../../src/configs/environment.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport globals from \"globals\";\n\nimport { GLOBS_CODE, GLOBS_JAVASCRIPT, GLOBS_NODE_TOOLING } from \"../constants\";\n\nimport type { Linter } from \"eslint\";\n\nexport type RuntimeEnvironment = \"browser\" | \"node\" | \"universal\";\n\n/**\n * 运行时全局变量配置片段的选项。\n *\n * `fastConfig()` 会根据已启用的语言和框架计算 `files`、`nodeFiles`,再调用\n * `createEnvironmentConfigs()`。该接口仍保持独立,以便环境片段的输入、默认值和文件\n * 范围在源码中具有明确契约;直接组合配置片段时可从 `./configs` 子路径使用。\n *\n * 应用代码与 Node.js 工程文件使用两个独立 Flat Config 片段,避免浏览器源码无条件获得\n * `process`、`Buffer` 等 Node.js 全局变量,也避免配置文件误报这些合法全局变量未定义。\n */\nexport interface EnvironmentConfigOptions {\n\t/**\n\t * 应用代码实际运行的环境,决定 `files` 范围内注入哪组标准全局变量。\n\t *\n\t * `\"browser\"` 只注入浏览器全局变量,`\"node\"` 只注入 Node.js 全局变量,\n\t * `\"universal\"` 同时注入两组。该值不会影响 `nodeFiles` 对应的工程文件;后者始终\n\t * 使用 Node.js 全局变量。\n\t * @
|
|
1
|
+
{"version":3,"file":"environment.mjs","names":[],"sources":["../../src/configs/environment.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport globals from \"globals\";\n\nimport { GLOBS_CODE, GLOBS_JAVASCRIPT, GLOBS_NODE_TOOLING } from \"../constants\";\n\nimport type { Linter } from \"eslint\";\n\n/**\n * 应用源码可声明的运行时环境。\n *\n * - `\"browser\"` 仅提供浏览器全局变量。\n * - `\"node\"` 仅提供 Node.js 全局变量。\n * - `\"universal\"` 同时提供浏览器与 Node.js 全局变量。\n */\nexport type RuntimeEnvironment = \"browser\" | \"node\" | \"universal\";\n\n/**\n * 运行时全局变量配置片段的选项。\n *\n * @remarks\n * `fastConfig()` 会根据已启用的语言和框架计算 `files`、`nodeFiles`,再调用\n * `createEnvironmentConfigs()`。该接口仍保持独立,以便环境片段的输入、默认值和文件\n * 范围在源码中具有明确契约;直接组合配置片段时可从 `./configs` 子路径使用。\n *\n * 应用代码与 Node.js 工程文件使用两个独立 Flat Config 片段,避免浏览器源码无条件获得\n * `process`、`Buffer` 等 Node.js 全局变量,也避免配置文件误报这些合法全局变量未定义。\n */\nexport interface EnvironmentConfigOptions {\n\t/**\n\t * 应用代码实际运行的环境,决定 `files` 范围内注入哪组标准全局变量。\n\t *\n\t * `\"browser\"` 只注入浏览器全局变量,`\"node\"` 只注入 Node.js 全局变量,\n\t * `\"universal\"` 同时注入两组。该值不会影响 `nodeFiles` 对应的工程文件;后者始终\n\t * 使用 Node.js 全局变量。\n\t * @defaultValue `\"browser\"`\n\t */\n\tenvironment?: RuntimeEnvironment;\n\t/**\n\t * 需要获得所选运行时全局变量的应用代码 glob 列表。\n\t *\n\t * 工厂会把当前启用的 JavaScript、TypeScript 和 Vue 文件范围传入这里。数组会复制到\n\t * 生成配置中,不会在函数内部修改调用方传入的值。\n\t * @defaultValue {@link GLOBS_CODE}\n\t */\n\tfiles?: readonly string[];\n\t/**\n\t * 当前启用且允许作为 Node.js 工程文件执行的脚本扩展名 glob 列表。\n\t *\n\t * 每一项都会与内置的配置文件、脚本目录、测试文件和 CLI 文件模式组合为 ESLint\n\t * Flat Config 的 AND 文件条件。例如顶层关闭 TypeScript 后,Node.js 工程片段也不会\n\t * 因自身模式较宽而意外接管 `.ts` 文件。\n\t * @defaultValue {@link GLOBS_JAVASCRIPT}\n\t */\n\tnodeFiles?: readonly string[];\n\t/**\n\t * 追加到应用代码环境中的项目级全局变量及其读写权限。\n\t *\n\t * 该记录在标准环境全局变量之后合并,所以同名条目可以覆盖预置权限。它应用于完整\n\t * `files` 范围;其中属于 Node.js 工程文件的子集还会由后续片段追加标准 Node.js 全局\n\t * 变量。值格式遵循 ESLint `Linter.Globals`。\n\t * @defaultValue `{}`\n\t */\n\tglobals?: Linter.Globals;\n}\n\n/**\n * 创建运行时环境相关的 ESLint 配置。\n *\n * @remarks\n * 返回两个相互独立的 Flat Config 片段:第一个为应用源码配置所选环境和项目级全局\n * 变量;第二个仅命中配置、脚本、测试与 CLI 等工程文件,为它们配置 Node.js 全局变量\n * 并允许使用 `console`。分离范围可以减少跨运行时的假阴性。\n *\n * @param options - 运行时环境、目标文件范围与项目级全局变量。\n * @returns 依次包含应用运行时环境和 Node.js 工程文件环境的 Flat Config 数组。\n */\nexport const createEnvironmentConfigs = ({\n\tenvironment = \"browser\",\n\tfiles = GLOBS_CODE,\n\tnodeFiles = GLOBS_JAVASCRIPT,\n\tglobals: projectGlobals = {},\n}: EnvironmentConfigOptions = {}) => {\n\tconst runtimeGlobals = {\n\t\t...(environment !== \"node\" ? globals.browser : {}),\n\t\t...(environment !== \"browser\" ? globals.node : {}),\n\t\t...projectGlobals,\n\t};\n\tconst nodeToolingFiles = GLOBS_NODE_TOOLING.flatMap((nodeGlob) => nodeFiles.map((fileGlob) => [nodeGlob, fileGlob]));\n\n\treturn defineConfig([\n\t\t{\n\t\t\tname: `@fast-china/globals/${environment}`,\n\t\t\tfiles: [...files],\n\t\t\tlanguageOptions: {\n\t\t\t\tglobals: runtimeGlobals,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/globals/node-tooling\",\n\t\t\tfiles: nodeToolingFiles,\n\t\t\tlanguageOptions: {\n\t\t\t\tglobals: globals.node,\n\t\t\t},\n\t\t\trules: {\n\t\t\t\t\"no-console\": \"off\",\n\t\t\t},\n\t\t},\n\t]);\n};\n"],"mappings":";;;;;;;;;;;;;;;AA4EA,MAAa,4BAA4B,EACxC,cAAc,WACd,QAAQ,YACR,YAAY,kBACZ,SAAS,iBAAiB,CAAC,MACE,CAAC,MAAM;CACpC,MAAM,iBAAiB;EACtB,GAAI,gBAAgB,SAAS,QAAQ,UAAU,CAAC;EAChD,GAAI,gBAAgB,YAAY,QAAQ,OAAO,CAAC;EAChD,GAAG;CACJ;CACA,MAAM,mBAAmB,mBAAmB,SAAS,aAAa,UAAU,KAAK,aAAa,CAAC,UAAU,QAAQ,CAAC,CAAC;CAEnH,OAAO,aAAa,CACnB;EACC,MAAM,uBAAuB;EAC7B,OAAO,CAAC,GAAG,KAAK;EAChB,iBAAiB,EAChB,SAAS,eACV;CACD,GACA;EACC,MAAM;EACN,OAAO;EACP,iBAAiB,EAChB,SAAS,QAAQ,KAClB;EACA,OAAO,EACN,cAAc,MACf;CACD,CACD,CAAC;AACF"}
|
|
@@ -2,13 +2,27 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 默认忽略依赖、构建结果、缓存、生成文件和包管理器锁文件。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 不忽略 `src`、`public`、测试夹具或普通 Markdown 文档,避免共享配置静默漏检
|
|
6
7
|
* 应由项目维护的文件。
|
|
7
8
|
*/
|
|
8
9
|
declare const DEFAULT_IGNORE_PATTERNS: readonly string[];
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* 创建全局忽略配置,并在默认集合之后追加项目自定义模式。
|
|
12
|
+
*
|
|
13
|
+
* @param additionalPatterns - 追加到 {@link DEFAULT_IGNORE_PATTERNS} 之后的 ESLint 全局忽略模式。
|
|
14
|
+
* @returns 包含单个命名全局忽略片段的 Flat Config 数组。
|
|
15
|
+
*/
|
|
10
16
|
declare const createGlobalIgnores: (additionalPatterns?: readonly string[]) => import("eslint/config").ConfigObject[];
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* 创建读取项目 `.gitignore` 的全局忽略配置。
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* `.gitignore` 的查找位置由 `eslint-config-flat-gitignore` 根据 ESLint 当前工作目录确定。
|
|
22
|
+
* 未找到文件时不会抛错;该片段也不会替代 {@link createGlobalIgnores} 的内置模式。
|
|
23
|
+
*
|
|
24
|
+
* @returns 包含 `.gitignore` 转换结果的 Flat Config 数组。
|
|
25
|
+
*/
|
|
12
26
|
declare const createGitignoreConfigs: () => import("eslint/config").ConfigObject[];
|
|
13
27
|
//#endregion
|
|
14
28
|
export { DEFAULT_IGNORE_PATTERNS, createGitignoreConfigs, createGlobalIgnores };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignores.d.mts","names":[],"sources":["../../src/configs/ignores.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"ignores.d.mts","names":[],"sources":["../../src/configs/ignores.ts"],"mappings":";;;;;;;;cAYa;;;;;;;cAkBA,sBAAuB,mEAA0C;;;;;;;;;;cAYjE,sDAAsB"}
|
package/dist/configs/ignores.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import eslintConfigFlatGitignore from "eslint-config-flat-gitignore";
|
|
|
5
5
|
/**
|
|
6
6
|
* 默认忽略依赖、构建结果、缓存、生成文件和包管理器锁文件。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 不忽略 `src`、`public`、测试夹具或普通 Markdown 文档,避免共享配置静默漏检
|
|
9
10
|
* 应由项目维护的文件。
|
|
10
11
|
*/
|
|
@@ -19,9 +20,22 @@ const DEFAULT_IGNORE_PATTERNS = Object.freeze([
|
|
|
19
20
|
"**/components.d.ts",
|
|
20
21
|
...GLOBS_LOCKFILES
|
|
21
22
|
]);
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 创建全局忽略配置,并在默认集合之后追加项目自定义模式。
|
|
25
|
+
*
|
|
26
|
+
* @param additionalPatterns - 追加到 {@link DEFAULT_IGNORE_PATTERNS} 之后的 ESLint 全局忽略模式。
|
|
27
|
+
* @returns 包含单个命名全局忽略片段的 Flat Config 数组。
|
|
28
|
+
*/
|
|
23
29
|
const createGlobalIgnores = (additionalPatterns = []) => defineConfig([globalIgnores([...DEFAULT_IGNORE_PATTERNS, ...additionalPatterns], "@fast-china/ignores/global")]);
|
|
24
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* 创建读取项目 `.gitignore` 的全局忽略配置。
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* `.gitignore` 的查找位置由 `eslint-config-flat-gitignore` 根据 ESLint 当前工作目录确定。
|
|
35
|
+
* 未找到文件时不会抛错;该片段也不会替代 {@link createGlobalIgnores} 的内置模式。
|
|
36
|
+
*
|
|
37
|
+
* @returns 包含 `.gitignore` 转换结果的 Flat Config 数组。
|
|
38
|
+
*/
|
|
25
39
|
const createGitignoreConfigs = () => defineConfig([{
|
|
26
40
|
name: "@fast-china/ignores/git",
|
|
27
41
|
...eslintConfigFlatGitignore({ strict: false })
|
|
@@ -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\";\n\nimport { GLOBS_LOCKFILES } from \"../constants\";\n\n/**\n * 默认忽略依赖、构建结果、缓存、生成文件和包管理器锁文件。\n *\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
|
|
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\";\n\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":";;;;;;;;;;;AAYA,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"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建模块导入规则配置。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 共享库不猜测项目的路径别名或解析器,因此只继承 import-x 的推荐能力,
|
|
6
7
|
* 与 resolver 强耦合且容易误报的规则会在本地规则记录中显式关闭。
|
|
8
|
+
*
|
|
9
|
+
* @param files - 应用 import-x 推荐规则与本地覆盖规则的 ESLint glob 列表。
|
|
10
|
+
* @returns 包含 import-x 插件预置和本地规则的 Flat Config 数组。
|
|
7
11
|
*/
|
|
8
12
|
declare const createImportConfigs: (files?: readonly string[]) => import("eslint/config").ConfigObject[];
|
|
9
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.mts","names":[],"sources":["../../src/configs/import.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"import.d.mts","names":[],"sources":["../../src/configs/import.ts"],"mappings":";;;;;;;;;;;cAgBa,sBAAuB,sDAAqC"}
|
package/dist/configs/import.mjs
CHANGED
|
@@ -6,8 +6,12 @@ import eslintPluginImportX from "eslint-plugin-import-x";
|
|
|
6
6
|
/**
|
|
7
7
|
* 创建模块导入规则配置。
|
|
8
8
|
*
|
|
9
|
+
* @remarks
|
|
9
10
|
* 共享库不猜测项目的路径别名或解析器,因此只继承 import-x 的推荐能力,
|
|
10
11
|
* 与 resolver 强耦合且容易误报的规则会在本地规则记录中显式关闭。
|
|
12
|
+
*
|
|
13
|
+
* @param files - 应用 import-x 推荐规则与本地覆盖规则的 ESLint glob 列表。
|
|
14
|
+
* @returns 包含 import-x 插件预置和本地规则的 Flat Config 数组。
|
|
11
15
|
*/
|
|
12
16
|
const createImportConfigs = (files = GLOBS_CODE) => defineConfig([{
|
|
13
17
|
name: "@fast-china/import",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.mjs","names":[],"sources":["../../src/configs/import.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport eslintPluginImportX from \"eslint-plugin-import-x\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { importRules } from \"../rules\";\n\n/**\n * 创建模块导入规则配置。\n *\n * 共享库不猜测项目的路径别名或解析器,因此只继承 import-x 的推荐能力,\n * 与 resolver 强耦合且容易误报的规则会在本地规则记录中显式关闭。\n */\nexport const createImportConfigs = (files: readonly string[] = GLOBS_CODE) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/import\",\n\t\t\tfiles: [...files],\n\t\t\textends: [eslintPluginImportX.flatConfigs.recommended],\n\t\t\trules: importRules,\n\t\t},\n\t]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"import.mjs","names":[],"sources":["../../src/configs/import.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport eslintPluginImportX from \"eslint-plugin-import-x\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { importRules } from \"../rules\";\n\n/**\n * 创建模块导入规则配置。\n *\n * @remarks\n * 共享库不猜测项目的路径别名或解析器,因此只继承 import-x 的推荐能力,\n * 与 resolver 强耦合且容易误报的规则会在本地规则记录中显式关闭。\n *\n * @param files - 应用 import-x 推荐规则与本地覆盖规则的 ESLint glob 列表。\n * @returns 包含 import-x 插件预置和本地规则的 Flat Config 数组。\n */\nexport const createImportConfigs = (files: readonly string[] = GLOBS_CODE) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/import\",\n\t\t\tfiles: [...files],\n\t\t\textends: [eslintPluginImportX.flatConfigs.recommended],\n\t\t\trules: importRules,\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,uBAAuB,QAA2B,eAC9D,aAAa,CACZ;CACC,MAAM;CACN,OAAO,CAAC,GAAG,KAAK;CAChB,SAAS,CAAC,oBAAoB,YAAY,WAAW;CACrD,OAAO;AACR,CACD,CAAC"}
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建 JavaScript/JSX 配置。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* `@eslint/js` 提供基础正确性规则,本仓库只在其后补充有明确维护理由的规则。
|
|
7
|
+
* 普通 `.jsx` 文件会显式启用 JSX 语法解析,但不会因此自动启用 React 规则。
|
|
8
|
+
*
|
|
9
|
+
* @param files - 应用 JavaScript 基础规则的 ESLint glob 列表。
|
|
10
|
+
* @returns 包含 JavaScript 推荐预置、本地规则与 JSX 解析设置的 Flat Config 数组。
|
|
6
11
|
*/
|
|
7
12
|
declare const createJavaScriptConfigs: (files?: readonly string[]) => import("eslint/config").ConfigObject[];
|
|
8
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascript.d.mts","names":[],"sources":["../../src/configs/javascript.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"javascript.d.mts","names":[],"sources":["../../src/configs/javascript.ts"],"mappings":";;;;;;;;;;;cAgBa,0BAA2B,sDAA2C"}
|
|
@@ -6,7 +6,12 @@ import eslint from "@eslint/js";
|
|
|
6
6
|
/**
|
|
7
7
|
* 创建 JavaScript/JSX 配置。
|
|
8
8
|
*
|
|
9
|
+
* @remarks
|
|
9
10
|
* `@eslint/js` 提供基础正确性规则,本仓库只在其后补充有明确维护理由的规则。
|
|
11
|
+
* 普通 `.jsx` 文件会显式启用 JSX 语法解析,但不会因此自动启用 React 规则。
|
|
12
|
+
*
|
|
13
|
+
* @param files - 应用 JavaScript 基础规则的 ESLint glob 列表。
|
|
14
|
+
* @returns 包含 JavaScript 推荐预置、本地规则与 JSX 解析设置的 Flat Config 数组。
|
|
10
15
|
*/
|
|
11
16
|
const createJavaScriptConfigs = (files = GLOBS_JAVASCRIPT) => defineConfig([{
|
|
12
17
|
name: "@fast-china/javascript",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascript.mjs","names":[],"sources":["../../src/configs/javascript.ts"],"sourcesContent":["import eslint from \"@eslint/js\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_JAVASCRIPT } from \"../constants\";\nimport { javascriptRules } from \"../rules\";\n\n/**\n * 创建 JavaScript/JSX 配置。\n *\n * `@eslint/js` 提供基础正确性规则,本仓库只在其后补充有明确维护理由的规则。\n */\nexport const createJavaScriptConfigs = (files: readonly string[] = GLOBS_JAVASCRIPT) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/javascript\",\n\t\t\tfiles: [...files],\n\t\t\textends: [eslint.configs.recommended],\n\t\t\tlanguageOptions: {\n\t\t\t\tecmaVersion: \"latest\",\n\t\t\t\tparserOptions: {\n\t\t\t\t\tecmaFeatures: {\n\t\t\t\t\t\t// 普通 `.jsx` 文件需要显式开启 JSX 语法解析。\n\t\t\t\t\t\tjsx: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trules: javascriptRules,\n\t\t},\n\t]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"javascript.mjs","names":[],"sources":["../../src/configs/javascript.ts"],"sourcesContent":["import eslint from \"@eslint/js\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_JAVASCRIPT } from \"../constants\";\nimport { javascriptRules } from \"../rules\";\n\n/**\n * 创建 JavaScript/JSX 配置。\n *\n * @remarks\n * `@eslint/js` 提供基础正确性规则,本仓库只在其后补充有明确维护理由的规则。\n * 普通 `.jsx` 文件会显式启用 JSX 语法解析,但不会因此自动启用 React 规则。\n *\n * @param files - 应用 JavaScript 基础规则的 ESLint glob 列表。\n * @returns 包含 JavaScript 推荐预置、本地规则与 JSX 解析设置的 Flat Config 数组。\n */\nexport const createJavaScriptConfigs = (files: readonly string[] = GLOBS_JAVASCRIPT) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/javascript\",\n\t\t\tfiles: [...files],\n\t\t\textends: [eslint.configs.recommended],\n\t\t\tlanguageOptions: {\n\t\t\t\tecmaVersion: \"latest\",\n\t\t\t\tparserOptions: {\n\t\t\t\t\tecmaFeatures: {\n\t\t\t\t\t\t// 普通 `.jsx` 文件需要显式开启 JSX 语法解析。\n\t\t\t\t\t\tjsx: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trules: javascriptRules,\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,2BAA2B,QAA2B,qBAClE,aAAa,CACZ;CACC,MAAM;CACN,OAAO,CAAC,GAAG,KAAK;CAChB,SAAS,CAAC,OAAO,QAAQ,WAAW;CACpC,iBAAiB;EAChB,aAAa;EACb,eAAe,EACd,cAAc,EAEb,KAAK,KACN,EACD;CACD;CACA,OAAO;AACR,CACD,CAAC"}
|
package/dist/configs/json.d.mts
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建 JSON、JSONC 与 JSON5 配置。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 三种方言使用各自的官方推荐预置,避免严格 JSON 规则错误覆盖允许注释或尾随逗号的文件。
|
|
7
|
+
* VS Code 的 `.vscode/settings.json` 仍以 `.json` 结尾,因此额外允许其中出现注释。
|
|
8
|
+
*
|
|
9
|
+
* @returns 按 JSON、JSONC、JSON5 与 VS Code 设置覆盖顺序排列的 Flat Config 数组。
|
|
6
10
|
*/
|
|
7
11
|
declare const createJsonConfigs: () => import("eslint/config").ConfigObject[];
|
|
8
12
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.mts","names":[],"sources":["../../src/configs/json.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.d.mts","names":[],"sources":["../../src/configs/json.ts"],"mappings":";;;;;;;;;;cAca,iDAAiB"}
|
package/dist/configs/json.mjs
CHANGED
|
@@ -5,7 +5,11 @@ import eslintPluginJsonc from "eslint-plugin-jsonc";
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建 JSON、JSONC 与 JSON5 配置。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 三种方言使用各自的官方推荐预置,避免严格 JSON 规则错误覆盖允许注释或尾随逗号的文件。
|
|
10
|
+
* VS Code 的 `.vscode/settings.json` 仍以 `.json` 结尾,因此额外允许其中出现注释。
|
|
11
|
+
*
|
|
12
|
+
* @returns 按 JSON、JSONC、JSON5 与 VS Code 设置覆盖顺序排列的 Flat Config 数组。
|
|
9
13
|
*/
|
|
10
14
|
const createJsonConfigs = () => defineConfig([
|
|
11
15
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.mjs","names":[],"sources":["../../src/configs/json.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport eslintPluginJsonc from \"eslint-plugin-jsonc\";\n\nimport { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from \"../constants\";\n\n/**\n * 创建 JSON、JSONC 与 JSON5 配置。\n *\n * 三种方言使用各自的官方推荐预置,避免严格 JSON 规则错误覆盖允许注释或尾随逗号的文件。\n */\nexport const createJsonConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/json/json\",\n\t\t\tfiles: [GLOB_JSON],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-json\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/jsonc\",\n\t\t\tfiles: [GLOB_JSONC],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-jsonc\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/json5\",\n\t\t\tfiles: [GLOB_JSON5],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-json5\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/vscode-settings\",\n\t\t\tfiles: [\"**/.vscode/settings.json\"],\n\t\t\trules: {\n\t\t\t\t// VS Code 的 settings.json 使用带注释的 JSONC 方言。\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},\n\t]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.mjs","names":[],"sources":["../../src/configs/json.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\nimport eslintPluginJsonc from \"eslint-plugin-jsonc\";\n\nimport { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from \"../constants\";\n\n/**\n * 创建 JSON、JSONC 与 JSON5 配置。\n *\n * @remarks\n * 三种方言使用各自的官方推荐预置,避免严格 JSON 规则错误覆盖允许注释或尾随逗号的文件。\n * VS Code 的 `.vscode/settings.json` 仍以 `.json` 结尾,因此额外允许其中出现注释。\n *\n * @returns 按 JSON、JSONC、JSON5 与 VS Code 设置覆盖顺序排列的 Flat Config 数组。\n */\nexport const createJsonConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/json/json\",\n\t\t\tfiles: [GLOB_JSON],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-json\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/jsonc\",\n\t\t\tfiles: [GLOB_JSONC],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-jsonc\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/json5\",\n\t\t\tfiles: [GLOB_JSON5],\n\t\t\textends: [eslintPluginJsonc.configs[\"flat/recommended-with-json5\"]],\n\t\t},\n\t\t{\n\t\t\tname: \"@fast-china/json/vscode-settings\",\n\t\t\tfiles: [\"**/.vscode/settings.json\"],\n\t\t\trules: {\n\t\t\t\t// VS Code 的 settings.json 使用带注释的 JSONC 方言。\n\t\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t},\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,0BACZ,aAAa;CACZ;EACC,MAAM;EACN,OAAO,CAAC,SAAS;EACjB,SAAS,CAAC,kBAAkB,QAAQ,6BAA6B;CAClE;CACA;EACC,MAAM;EACN,OAAO,CAAC,UAAU;EAClB,SAAS,CAAC,kBAAkB,QAAQ,8BAA8B;CACnE;CACA;EACC,MAAM;EACN,OAAO,CAAC,UAAU;EAClB,SAAS,CAAC,kBAAkB,QAAQ,8BAA8B;CACnE;CACA;EACC,MAAM;EACN,OAAO,CAAC,0BAA0B;EAClC,OAAO,EAEN,qBAAqB,MACtB;CACD;AACD,CAAC"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
//#region src/configs/lodash.d.ts
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* 项目允许使用的 Lodash 静态导入来源。
|
|
4
|
+
*
|
|
5
|
+
* `"lodash"` 允许根入口及 `lodash/*` 子路径;`"lodash-unified"` 只允许统一入口。
|
|
6
|
+
*/
|
|
3
7
|
type LodashPreference = "lodash" | "lodash-unified";
|
|
4
8
|
/**
|
|
5
9
|
* 创建 Lodash 静态导入约束。
|
|
6
10
|
*
|
|
11
|
+
* @remarks
|
|
7
12
|
* 该配置使用 ESLint 核心规则,因此不依赖 import-x 开关或额外插件。
|
|
13
|
+
* 它只检查静态 `import` 与 `export ... from`,不会安装依赖或检查动态导入。
|
|
14
|
+
*
|
|
15
|
+
* @param preference - 项目唯一允许使用的 Lodash 包入口。
|
|
16
|
+
* @param files - 应用导入约束的 ESLint glob 列表。
|
|
17
|
+
* @returns 包含对应 Lodash 导入限制规则的 Flat Config 数组。
|
|
8
18
|
*/
|
|
9
19
|
declare const createLodashConfigs: (preference: LodashPreference, files?: readonly string[]) => import("eslint/config").ConfigObject[];
|
|
10
20
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.d.mts","names":[],"sources":["../../src/configs/lodash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lodash.d.mts","names":[],"sources":["../../src/configs/lodash.ts"],"mappings":";;;;;;KAUY;;;;;;;;;;;;cAaC,sBAAuB,YAAY,kBAAkB,sDAAqC"}
|
package/dist/configs/lodash.mjs
CHANGED
|
@@ -5,7 +5,13 @@ import { defineConfig } from "eslint/config";
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建 Lodash 静态导入约束。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 该配置使用 ESLint 核心规则,因此不依赖 import-x 开关或额外插件。
|
|
10
|
+
* 它只检查静态 `import` 与 `export ... from`,不会安装依赖或检查动态导入。
|
|
11
|
+
*
|
|
12
|
+
* @param preference - 项目唯一允许使用的 Lodash 包入口。
|
|
13
|
+
* @param files - 应用导入约束的 ESLint glob 列表。
|
|
14
|
+
* @returns 包含对应 Lodash 导入限制规则的 Flat Config 数组。
|
|
9
15
|
*/
|
|
10
16
|
const createLodashConfigs = (preference, files = GLOBS_CODE) => defineConfig([{
|
|
11
17
|
name: `@fast-china/lodash/${preference}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.mjs","names":[],"sources":["../../src/configs/lodash.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { preferLodashRules, preferLodashUnifiedRules } from \"../rules\";\n\n
|
|
1
|
+
{"version":3,"file":"lodash.mjs","names":[],"sources":["../../src/configs/lodash.ts"],"sourcesContent":["import { defineConfig } from \"eslint/config\";\n\nimport { GLOBS_CODE } from \"../constants\";\nimport { preferLodashRules, preferLodashUnifiedRules } from \"../rules\";\n\n/**\n * 项目允许使用的 Lodash 静态导入来源。\n *\n * `\"lodash\"` 允许根入口及 `lodash/*` 子路径;`\"lodash-unified\"` 只允许统一入口。\n */\nexport type LodashPreference = \"lodash\" | \"lodash-unified\";\n\n/**\n * 创建 Lodash 静态导入约束。\n *\n * @remarks\n * 该配置使用 ESLint 核心规则,因此不依赖 import-x 开关或额外插件。\n * 它只检查静态 `import` 与 `export ... from`,不会安装依赖或检查动态导入。\n *\n * @param preference - 项目唯一允许使用的 Lodash 包入口。\n * @param files - 应用导入约束的 ESLint glob 列表。\n * @returns 包含对应 Lodash 导入限制规则的 Flat Config 数组。\n */\nexport const createLodashConfigs = (preference: LodashPreference, files: readonly string[] = GLOBS_CODE) =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: `@fast-china/lodash/${preference}`,\n\t\t\tfiles: [...files],\n\t\t\trules: preference === \"lodash\" ? preferLodashRules : preferLodashUnifiedRules,\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAa,uBAAuB,YAA8B,QAA2B,eAC5F,aAAa,CACZ;CACC,MAAM,sBAAsB;CAC5B,OAAO,CAAC,GAAG,KAAK;CAChB,OAAO,eAAe,WAAW,oBAAoB;AACtD,CACD,CAAC"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建 Markdown 结构与语法检查配置。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 该配置检查 Markdown 文档本身;代码块是否接受额外语言规则由项目覆盖配置决定。
|
|
7
|
+
*
|
|
8
|
+
* @returns 包含 `@eslint/markdown` 推荐预置的 Flat Config 数组。
|
|
6
9
|
*/
|
|
7
10
|
declare const createMarkdownConfigs: () => import("eslint/config").ConfigObject[];
|
|
8
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.mts","names":[],"sources":["../../src/configs/markdown.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.mts","names":[],"sources":["../../src/configs/markdown.ts"],"mappings":";;;;;;;;;cAaa,qDAAqB"}
|
|
@@ -5,7 +5,10 @@ import eslintMarkdown from "@eslint/markdown";
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建 Markdown 结构与语法检查配置。
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
8
9
|
* 该配置检查 Markdown 文档本身;代码块是否接受额外语言规则由项目覆盖配置决定。
|
|
10
|
+
*
|
|
11
|
+
* @returns 包含 `@eslint/markdown` 推荐预置的 Flat Config 数组。
|
|
9
12
|
*/
|
|
10
13
|
const createMarkdownConfigs = () => defineConfig([{
|
|
11
14
|
name: "@fast-china/markdown",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.mjs","names":[],"sources":["../../src/configs/markdown.ts"],"sourcesContent":["import eslintMarkdown from \"@eslint/markdown\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOB_MARKDOWN } from \"../constants\";\n\n/**\n * 创建 Markdown 结构与语法检查配置。\n *\n * 该配置检查 Markdown 文档本身;代码块是否接受额外语言规则由项目覆盖配置决定。\n */\nexport const createMarkdownConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/markdown\",\n\t\t\tfiles: [GLOB_MARKDOWN],\n\t\t\textends: [eslintMarkdown.configs.recommended],\n\t\t},\n\t]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.mjs","names":[],"sources":["../../src/configs/markdown.ts"],"sourcesContent":["import eslintMarkdown from \"@eslint/markdown\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { GLOB_MARKDOWN } from \"../constants\";\n\n/**\n * 创建 Markdown 结构与语法检查配置。\n *\n * @remarks\n * 该配置检查 Markdown 文档本身;代码块是否接受额外语言规则由项目覆盖配置决定。\n *\n * @returns 包含 `@eslint/markdown` 推荐预置的 Flat Config 数组。\n */\nexport const createMarkdownConfigs = () =>\n\tdefineConfig([\n\t\t{\n\t\t\tname: \"@fast-china/markdown\",\n\t\t\tfiles: [GLOB_MARKDOWN],\n\t\t\textends: [eslintMarkdown.configs.recommended],\n\t\t},\n\t]);\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,8BACZ,aAAa,CACZ;CACC,MAAM;CACN,OAAO,CAAC,aAAa;CACrB,SAAS,CAAC,eAAe,QAAQ,WAAW;AAC7C,CACD,CAAC"}
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 创建 Prettier 兼容层。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 它只关闭与 Prettier 冲突的 ESLint 格式规则,不会在 ESLint 进程中执行 Prettier。
|
|
6
7
|
* 工厂始终把它放在内置配置之后,使上游预置的格式规则能够被正确覆盖。
|
|
8
|
+
*
|
|
9
|
+
* @returns 包含命名后的 `eslint-config-prettier` Flat Config 数组。
|
|
7
10
|
*/
|
|
8
11
|
declare const createPrettierConfigs: () => import("eslint/config").ConfigObject[];
|
|
9
12
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.mts","names":[],"sources":["../../src/configs/prettier.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prettier.d.mts","names":[],"sources":["../../src/configs/prettier.ts"],"mappings":";;;;;;;;;;cAYa,qDAAqB"}
|
|
@@ -4,8 +4,11 @@ import eslintConfigPrettierFlat from "eslint-config-prettier/flat";
|
|
|
4
4
|
/**
|
|
5
5
|
* 创建 Prettier 兼容层。
|
|
6
6
|
*
|
|
7
|
+
* @remarks
|
|
7
8
|
* 它只关闭与 Prettier 冲突的 ESLint 格式规则,不会在 ESLint 进程中执行 Prettier。
|
|
8
9
|
* 工厂始终把它放在内置配置之后,使上游预置的格式规则能够被正确覆盖。
|
|
10
|
+
*
|
|
11
|
+
* @returns 包含命名后的 `eslint-config-prettier` Flat Config 数组。
|
|
9
12
|
*/
|
|
10
13
|
const createPrettierConfigs = () => defineConfig([{
|
|
11
14
|
...eslintConfigPrettierFlat,
|