@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/dist/rules/lodash.d.mts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 统一使用 `lodash-unified` 的可选导入策略。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 该规则只约束静态 import/export 的模块来源,不会安装依赖,也不会检查动态
|
|
6
7
|
* `import()` 或 CommonJS `require()`。选择此策略的项目应自行安装 `lodash-unified`。
|
|
7
8
|
*/
|
|
@@ -20,6 +21,7 @@ declare const preferLodashUnifiedRules: {
|
|
|
20
21
|
/**
|
|
21
22
|
* 统一使用 `lodash` 的可选导入策略。
|
|
22
23
|
*
|
|
24
|
+
* @remarks
|
|
23
25
|
* 根入口和 `lodash/*` 子路径都允许使用;规则只负责避免与 `lodash-es` 或
|
|
24
26
|
* `lodash-unified` 混用,不替项目决定整包导入或按方法导入。
|
|
25
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.d.mts","names":[],"sources":["../../src/rules/lodash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lodash.d.mts","names":[],"sources":["../../src/rules/lodash.ts"],"mappings":";;;;;;;;cASa;;;;;;;;;;;;;;;;;;;cAgCA"}
|
package/dist/rules/lodash.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 统一使用 `lodash-unified` 的可选导入策略。
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* 该规则只约束静态 import/export 的模块来源,不会安装依赖,也不会检查动态
|
|
6
7
|
* `import()` 或 CommonJS `require()`。选择此策略的项目应自行安装 `lodash-unified`。
|
|
7
8
|
*/
|
|
@@ -21,6 +22,7 @@ const preferLodashUnifiedRules = { "no-restricted-imports": ["error", {
|
|
|
21
22
|
/**
|
|
22
23
|
* 统一使用 `lodash` 的可选导入策略。
|
|
23
24
|
*
|
|
25
|
+
* @remarks
|
|
24
26
|
* 根入口和 `lodash/*` 子路径都允许使用;规则只负责避免与 `lodash-es` 或
|
|
25
27
|
* `lodash-unified` 混用,不替项目决定整包导入或按方法导入。
|
|
26
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.mjs","names":[],"sources":["../../src/rules/lodash.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * 统一使用 `lodash-unified` 的可选导入策略。\n *\n * 该规则只约束静态 import/export 的模块来源,不会安装依赖,也不会检查动态\n * `import()` 或 CommonJS `require()`。选择此策略的项目应自行安装 `lodash-unified`。\n */\nexport const preferLodashUnifiedRules = {\n\t// [高影响][按需启用] 禁止混用 lodash 与 lodash-es,避免同一项目维护多套等价依赖入口。\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash\",\n\t\t\t\t\tmessage: 'Use \"lodash-unified\" consistently instead of \"lodash\".',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-es\",\n\t\t\t\t\tmessage: 'Use \"lodash-unified\" consistently instead of \"lodash-es\".',\n\t\t\t\t},\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash/*\", \"lodash-es/*\"],\n\t\t\t\t\tmessage: 'Use exports from \"lodash-unified\" instead of Lodash subpath imports.',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n} satisfies RuleOptions;\n\n/**\n * 统一使用 `lodash` 的可选导入策略。\n *\n * 根入口和 `lodash/*` 子路径都允许使用;规则只负责避免与 `lodash-es` 或\n * `lodash-unified` 混用,不替项目决定整包导入或按方法导入。\n */\nexport const preferLodashRules = {\n\t// [高影响][按需启用] 禁止混用 lodash-es 与 lodash-unified,保持运行时和类型来源一致。\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-es\",\n\t\t\t\t\tmessage: 'Use \"lodash\" consistently instead of \"lodash-es\".',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-unified\",\n\t\t\t\t\tmessage: 'Use \"lodash\" consistently instead of \"lodash-unified\".',\n\t\t\t\t},\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash-es/*\", \"lodash-unified/*\"],\n\t\t\t\t\tmessage: 'Use \"lodash\" or a \"lodash/*\" subpath consistently.',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lodash.mjs","names":[],"sources":["../../src/rules/lodash.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * 统一使用 `lodash-unified` 的可选导入策略。\n *\n * @remarks\n * 该规则只约束静态 import/export 的模块来源,不会安装依赖,也不会检查动态\n * `import()` 或 CommonJS `require()`。选择此策略的项目应自行安装 `lodash-unified`。\n */\nexport const preferLodashUnifiedRules = {\n\t// [高影响][按需启用] 禁止混用 lodash 与 lodash-es,避免同一项目维护多套等价依赖入口。\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash\",\n\t\t\t\t\tmessage: 'Use \"lodash-unified\" consistently instead of \"lodash\".',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-es\",\n\t\t\t\t\tmessage: 'Use \"lodash-unified\" consistently instead of \"lodash-es\".',\n\t\t\t\t},\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash/*\", \"lodash-es/*\"],\n\t\t\t\t\tmessage: 'Use exports from \"lodash-unified\" instead of Lodash subpath imports.',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n} satisfies RuleOptions;\n\n/**\n * 统一使用 `lodash` 的可选导入策略。\n *\n * @remarks\n * 根入口和 `lodash/*` 子路径都允许使用;规则只负责避免与 `lodash-es` 或\n * `lodash-unified` 混用,不替项目决定整包导入或按方法导入。\n */\nexport const preferLodashRules = {\n\t// [高影响][按需启用] 禁止混用 lodash-es 与 lodash-unified,保持运行时和类型来源一致。\n\t\"no-restricted-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tpaths: [\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-es\",\n\t\t\t\t\tmessage: 'Use \"lodash\" consistently instead of \"lodash-es\".',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"lodash-unified\",\n\t\t\t\t\tmessage: 'Use \"lodash\" consistently instead of \"lodash-unified\".',\n\t\t\t\t},\n\t\t\t],\n\t\t\tpatterns: [\n\t\t\t\t{\n\t\t\t\t\tgroup: [\"lodash-es/*\", \"lodash-unified/*\"],\n\t\t\t\t\tmessage: 'Use \"lodash\" or a \"lodash/*\" subpath consistently.',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;AASA,MAAa,2BAA2B,EAEvC,yBAAyB,CACxB,SACA;CACC,OAAO,CACN;EACC,MAAM;EACN,SAAS;CACV,GACA;EACC,MAAM;EACN,SAAS;CACV,CACD;CACA,UAAU,CACT;EACC,OAAO,CAAC,YAAY,aAAa;EACjC,SAAS;CACV,CACD;AACD,CACD,EACD;;;;;;;;AASA,MAAa,oBAAoB,EAEhC,yBAAyB,CACxB,SACA;CACC,OAAO,CACN;EACC,MAAM;EACN,SAAS;CACV,GACA;EACC,MAAM;EACN,SAAS;CACV,CACD;CACA,UAAU,CACT;EACC,OAAO,CAAC,eAAe,kBAAkB;EACzC,SAAS;CACV,CACD;AACD,CACD,EACD"}
|
package/dist/rules/react.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.mts","names":[],"sources":["../../src/rules/react.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.d.mts","names":[],"sources":["../../src/rules/react.ts"],"mappings":";;;;;;;;;cAUa"}
|
package/dist/rules/react.mjs
CHANGED
package/dist/rules/react.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.mjs","names":[],"sources":["../../src/rules/react.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * React 本地覆写规则。\n *\n * `@eslint-react/recommended*` 负责组件、JSX、DOM 与 Web API 正确性,\n * `react-hooks/recommended` 负责 React 官方 Hooks 与 Compiler 诊断。这里关闭两套\n * 预置间的重复诊断,并补充少量明确的 DOM 安全约束。\n */\nexport const reactRules = {\n\t// React 官方 Hooks 插件提供更完整的 Error Boundary/Compiler 诊断,避免同一问题重复报告。\n\t\"@eslint-react/error-boundaries\": \"off\",\n\t// 依赖数组由 React 官方 exhaustive-deps 规则统一检查,避免重复警告。\n\t\"@eslint-react/exhaustive-deps\": \"off\",\n\t// 纯函数约束交给 React 官方 Compiler 规则维护,确保与 React 版本同步。\n\t\"@eslint-react/purity\": \"off\",\n\t// Hooks 调用顺序由 React 官方规则作为唯一来源,避免编辑器显示两个相同错误。\n\t\"@eslint-react/rules-of-hooks\": \"off\",\n\t// Effect 内同步更新状态由 React 官方 Compiler 规则判断,避免两套实现严重级别不一致。\n\t\"@eslint-react/set-state-in-effect\": \"off\",\n\t// 渲染期间更新状态由 React 官方 Compiler 规则判断,避免重复错误。\n\t\"@eslint-react/set-state-in-render\": \"off\",\n\t// 组件引用稳定性由 React 官方 Compiler 规则统一检查。\n\t\"@eslint-react/static-components\": \"off\",\n\t// Compiler 不支持的语法由 React 官方规则统一报告。\n\t\"@eslint-react/unsupported-syntax\": \"off\",\n\t// memoization 建议由 React 官方 Compiler 规则统一报告。\n\t\"@eslint-react/use-memo\": \"off\",\n\n\t// button 缺少 type 时在表单内默认为 submit,显式声明可避免意外提交。\n\t\"@eslint-react/dom-no-missing-button-type\": \"error\",\n\t// [安全关注] 未受限 iframe 权限面较大;以 warn 提醒评估可信来源和 sandbox 策略。\n\t\"@eslint-react/dom-no-missing-iframe-sandbox\": \"warn\",\n\t// JSX 属性拼写错误会被 React 忽略或错误透传到 DOM,应在提交前阻断。\n\t\"@eslint-react/dom-no-unknown-property\": \"error\",\n\t// [安全关注] target=\"_blank\" 未隔离 opener 时可能允许目标页控制来源页。\n\t\"@eslint-react/dom-no-unsafe-target-blank\": \"error\",\n} satisfies RuleOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.mjs","names":[],"sources":["../../src/rules/react.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * React 本地覆写规则。\n *\n * @remarks\n * `@eslint-react/recommended*` 负责组件、JSX、DOM 与 Web API 正确性,\n * `react-hooks/recommended` 负责 React 官方 Hooks 与 Compiler 诊断。这里关闭两套\n * 预置间的重复诊断,并补充少量明确的 DOM 安全约束。\n */\nexport const reactRules = {\n\t// React 官方 Hooks 插件提供更完整的 Error Boundary/Compiler 诊断,避免同一问题重复报告。\n\t\"@eslint-react/error-boundaries\": \"off\",\n\t// 依赖数组由 React 官方 exhaustive-deps 规则统一检查,避免重复警告。\n\t\"@eslint-react/exhaustive-deps\": \"off\",\n\t// 纯函数约束交给 React 官方 Compiler 规则维护,确保与 React 版本同步。\n\t\"@eslint-react/purity\": \"off\",\n\t// Hooks 调用顺序由 React 官方规则作为唯一来源,避免编辑器显示两个相同错误。\n\t\"@eslint-react/rules-of-hooks\": \"off\",\n\t// Effect 内同步更新状态由 React 官方 Compiler 规则判断,避免两套实现严重级别不一致。\n\t\"@eslint-react/set-state-in-effect\": \"off\",\n\t// 渲染期间更新状态由 React 官方 Compiler 规则判断,避免重复错误。\n\t\"@eslint-react/set-state-in-render\": \"off\",\n\t// 组件引用稳定性由 React 官方 Compiler 规则统一检查。\n\t\"@eslint-react/static-components\": \"off\",\n\t// Compiler 不支持的语法由 React 官方规则统一报告。\n\t\"@eslint-react/unsupported-syntax\": \"off\",\n\t// memoization 建议由 React 官方 Compiler 规则统一报告。\n\t\"@eslint-react/use-memo\": \"off\",\n\n\t// button 缺少 type 时在表单内默认为 submit,显式声明可避免意外提交。\n\t\"@eslint-react/dom-no-missing-button-type\": \"error\",\n\t// [安全关注] 未受限 iframe 权限面较大;以 warn 提醒评估可信来源和 sandbox 策略。\n\t\"@eslint-react/dom-no-missing-iframe-sandbox\": \"warn\",\n\t// JSX 属性拼写错误会被 React 忽略或错误透传到 DOM,应在提交前阻断。\n\t\"@eslint-react/dom-no-unknown-property\": \"error\",\n\t// [安全关注] target=\"_blank\" 未隔离 opener 时可能允许目标页控制来源页。\n\t\"@eslint-react/dom-no-unsafe-target-blank\": \"error\",\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;;;AAUA,MAAa,aAAa;CAEzB,kCAAkC;CAElC,iCAAiC;CAEjC,wBAAwB;CAExB,gCAAgC;CAEhC,qCAAqC;CAErC,qCAAqC;CAErC,mCAAmC;CAEnC,oCAAoC;CAEpC,0BAA0B;CAG1B,4CAA4C;CAE5C,+CAA+C;CAE/C,yCAAyC;CAEzC,4CAA4C;AAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-package.d.mts","names":[],"sources":["../../src/rules/sort-package.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sort-package.d.mts","names":[],"sources":["../../src/rules/sort-package.ts"],"mappings":";;;;;;;;cASa"}
|
|
@@ -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 * `[高影响][可自动修复]`:仅在 `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":"
|
|
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.d.mts","names":[],"sources":["../../src/rules/sort-tsconfig.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sort-tsconfig.d.mts","names":[],"sources":["../../src/rules/sort-tsconfig.ts"],"mappings":";;;;;;;;cASa"}
|
|
@@ -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 * `[高影响][可自动修复]`:仅在 `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":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/rules/typescript.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/rules/typescript.ts"],"mappings":";;;;;;;cAQa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","names":[],"sources":["../../src/rules/typescript.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * TypeScript 本地覆写规则。\n * 这里补充 typescript-eslint 预置;高影响规则需同步维护风险文档。\n */\nexport const typescriptRules = {\n\t// 使用 TypeScript 版本避免核心规则误判声明合并、类型和值的同名声明。\n\t\"@typescript-eslint/no-redeclare\": \"error\",\n\t// [高影响][可自动修复] 未使用符号视为错误;以下划线开头可显式表示参数或变量被有意忽略。\n\t\"@typescript-eslint/no-unused-vars\": [\n\t\t\"error\",\n\t\t{\n\t\t\targs: \"after-used\",\n\t\t\targsIgnorePattern: \"^_\",\n\t\t\tcaughtErrors: \"all\",\n\t\t\tcaughtErrorsIgnorePattern: \"^_\",\n\t\t\tignoreRestSiblings: true,\n\t\t\tvarsIgnorePattern: \"^_\",\n\t\t},\n\t],\n\t// [默认关闭] 声明文件、全局扩展和部分 SDK 仍需要 namespace。\n\t\"@typescript-eslint/no-namespace\": \"off\",\n\t// any 会绕过类型检查,但在第三方边界和渐进式类型完善中有合理用途,因此只警告。\n\t\"@typescript-eslint/no-explicit-any\": \"warn\",\n\t// [高影响] 默认要求 ESM import;CommonJS、动态加载或工具链互操作代码可能需要按文件关闭。\n\t\"@typescript-eslint/no-require-imports\": \"error\",\n\t// 使用 TS 版本识别类型断言等语法;允许常见的短路和三元表达式调用模式。\n\t\"@typescript-eslint/no-unused-expressions\": [\n\t\t\"error\",\n\t\t{\n\t\t\tallowShortCircuit: true,\n\t\t\tallowTernary: true,\n\t\t},\n\t],\n\t// [可自动修复] 删除可由 TypeScript 明确推断的原始值类型标注,减少重复信息。\n\t\"@typescript-eslint/no-inferrable-types\": \"error\",\n\t// 非空断言可能隐藏空值缺陷;以警告提示逐步消除,避免一次性产生大量阻断错误。\n\t\"@typescript-eslint/no-non-null-assertion\": \"warn\",\n\t// 可选链之后再做非空断言逻辑矛盾,通常表示边界条件设计有误。\n\t\"@typescript-eslint/no-non-null-asserted-optional-chain\": \"error\",\n\t// [高影响][可自动修复] 类型依赖改用内联 type import;需复核仅靠 import 触发的模块副作用。\n\t\"@typescript-eslint/consistent-type-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tdisallowTypeAnnotations: false,\n\t\t\tfixStyle: \"inline-type-imports\",\n\t\t\tprefer: \"type-imports\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.mjs","names":[],"sources":["../../src/rules/typescript.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * TypeScript 本地覆写规则。\n *\n * @remarks\n * 这里补充 typescript-eslint 预置;高影响规则需同步维护风险文档。\n */\nexport const typescriptRules = {\n\t// 使用 TypeScript 版本避免核心规则误判声明合并、类型和值的同名声明。\n\t\"@typescript-eslint/no-redeclare\": \"error\",\n\t// [高影响][可自动修复] 未使用符号视为错误;以下划线开头可显式表示参数或变量被有意忽略。\n\t\"@typescript-eslint/no-unused-vars\": [\n\t\t\"error\",\n\t\t{\n\t\t\targs: \"after-used\",\n\t\t\targsIgnorePattern: \"^_\",\n\t\t\tcaughtErrors: \"all\",\n\t\t\tcaughtErrorsIgnorePattern: \"^_\",\n\t\t\tignoreRestSiblings: true,\n\t\t\tvarsIgnorePattern: \"^_\",\n\t\t},\n\t],\n\t// [默认关闭] 声明文件、全局扩展和部分 SDK 仍需要 namespace。\n\t\"@typescript-eslint/no-namespace\": \"off\",\n\t// any 会绕过类型检查,但在第三方边界和渐进式类型完善中有合理用途,因此只警告。\n\t\"@typescript-eslint/no-explicit-any\": \"warn\",\n\t// [高影响] 默认要求 ESM import;CommonJS、动态加载或工具链互操作代码可能需要按文件关闭。\n\t\"@typescript-eslint/no-require-imports\": \"error\",\n\t// 使用 TS 版本识别类型断言等语法;允许常见的短路和三元表达式调用模式。\n\t\"@typescript-eslint/no-unused-expressions\": [\n\t\t\"error\",\n\t\t{\n\t\t\tallowShortCircuit: true,\n\t\t\tallowTernary: true,\n\t\t},\n\t],\n\t// [可自动修复] 删除可由 TypeScript 明确推断的原始值类型标注,减少重复信息。\n\t\"@typescript-eslint/no-inferrable-types\": \"error\",\n\t// 非空断言可能隐藏空值缺陷;以警告提示逐步消除,避免一次性产生大量阻断错误。\n\t\"@typescript-eslint/no-non-null-assertion\": \"warn\",\n\t// 可选链之后再做非空断言逻辑矛盾,通常表示边界条件设计有误。\n\t\"@typescript-eslint/no-non-null-asserted-optional-chain\": \"error\",\n\t// [高影响][可自动修复] 类型依赖改用内联 type import;需复核仅靠 import 触发的模块副作用。\n\t\"@typescript-eslint/consistent-type-imports\": [\n\t\t\"error\",\n\t\t{\n\t\t\tdisallowTypeAnnotations: false,\n\t\t\tfixStyle: \"inline-type-imports\",\n\t\t\tprefer: \"type-imports\",\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;AAQA,MAAa,kBAAkB;CAE9B,mCAAmC;CAEnC,qCAAqC,CACpC,SACA;EACC,MAAM;EACN,mBAAmB;EACnB,cAAc;EACd,2BAA2B;EAC3B,oBAAoB;EACpB,mBAAmB;CACpB,CACD;CAEA,mCAAmC;CAEnC,sCAAsC;CAEtC,yCAAyC;CAEzC,4CAA4C,CAC3C,SACA;EACC,mBAAmB;EACnB,cAAc;CACf,CACD;CAEA,0CAA0C;CAE1C,4CAA4C;CAE5C,0DAA0D;CAE1D,8CAA8C,CAC7C,SACA;EACC,yBAAyB;EACzB,UAAU;EACV,QAAQ;CACT,CACD;AACD"}
|
package/dist/rules/vue.d.mts
CHANGED
package/dist/rules/vue.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.mts","names":[],"sources":["../../src/rules/vue.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue.d.mts","names":[],"sources":["../../src/rules/vue.ts"],"mappings":";;;;;;;cAQa"}
|
package/dist/rules/vue.mjs
CHANGED
package/dist/rules/vue.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.mjs","names":[],"sources":["../../src/rules/vue.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * Vue SFC 本地覆写规则。\n * 上游 `flat/recommended` 已覆盖基础正确性,这里只记录项目取舍与附加约束。\n */\nexport const vueRules = {\n\t// [安全关注] v-html 可能引入 XSS;保留 warn 以兼容经过净化的富文本场景。\n\t\"vue/no-v-html\": \"warn\",\n\t// [默认关闭] TypeScript 类型 props 和 required 声明已能表达可选性,不强制每个可选 prop 提供默认值。\n\t\"vue/require-default-prop\": \"off\",\n\t// [高影响] 组件必须声明对外事件;首次启用时会暴露未建模的公共事件 API。\n\t\"vue/require-explicit-emits\": \"error\",\n\t// [默认关闭] 允许 App、Layout 等约定俗成的单词组件名。\n\t\"vue/multi-word-component-names\": \"off\",\n\t// 优先从 vue 入口导入由 Vue 重新导出的 API,避免依赖内部包边界。\n\t\"vue/prefer-import-from-vue\": \"warn\",\n\n\t// 防止 props、data、computed、methods 等组件命名空间出现冲突。\n\t\"vue/no-dupe-keys\": \"error\",\n\t// [高影响] 禁止组件直接修改 props,要求通过事件或本地状态维持单向数据流。\n\t\"vue/no-mutating-props\": \"error\",\n\t// 避免自定义组件名与 Vue 内置组件冲突。\n\t\"vue/no-reserved-component-names\": \"error\",\n\t// [安全关注] 禁止在组件节点上使用 v-text/v-html,避免覆盖组件内容和模糊数据边界。\n\t\"vue/no-v-text-v-html-on-component\": \"error\",\n\t// 统一模板与脚本中的自定义事件名称为 camelCase。\n\t\"vue/custom-event-name-casing\": [\"error\", \"camelCase\"],\n\t// [默认关闭] 允许在一个 SFC 中声明仅供当前文件使用的小型辅助组件。\n\t\"vue/one-component-per-file\": \"off\",\n\t// [高影响][可自动修复] 统一模板属性分组;首次启用可能产生大量仅排序的模板差异。\n\t\"vue/attributes-order\": [\n\t\t\"error\",\n\t\t{\n\t\t\torder: [\"DEFINITION\", \"LIST_RENDERING\", \"CONDITIONALS\", \"RENDER_MODIFIERS\", \"GLOBAL\", \"UNIQUE\", \"OTHER_ATTR\", \"EVENTS\", \"CONTENT\"],\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue.mjs","names":[],"sources":["../../src/rules/vue.ts"],"sourcesContent":["import type { RuleOptions } from \"../typegen\";\n\n/**\n * Vue SFC 本地覆写规则。\n *\n * @remarks\n * 上游 `flat/recommended` 已覆盖基础正确性,这里只记录项目取舍与附加约束。\n */\nexport const vueRules = {\n\t// [安全关注] v-html 可能引入 XSS;保留 warn 以兼容经过净化的富文本场景。\n\t\"vue/no-v-html\": \"warn\",\n\t// [默认关闭] TypeScript 类型 props 和 required 声明已能表达可选性,不强制每个可选 prop 提供默认值。\n\t\"vue/require-default-prop\": \"off\",\n\t// [高影响] 组件必须声明对外事件;首次启用时会暴露未建模的公共事件 API。\n\t\"vue/require-explicit-emits\": \"error\",\n\t// [默认关闭] 允许 App、Layout 等约定俗成的单词组件名。\n\t\"vue/multi-word-component-names\": \"off\",\n\t// 优先从 vue 入口导入由 Vue 重新导出的 API,避免依赖内部包边界。\n\t\"vue/prefer-import-from-vue\": \"warn\",\n\n\t// 防止 props、data、computed、methods 等组件命名空间出现冲突。\n\t\"vue/no-dupe-keys\": \"error\",\n\t// [高影响] 禁止组件直接修改 props,要求通过事件或本地状态维持单向数据流。\n\t\"vue/no-mutating-props\": \"error\",\n\t// 避免自定义组件名与 Vue 内置组件冲突。\n\t\"vue/no-reserved-component-names\": \"error\",\n\t// [安全关注] 禁止在组件节点上使用 v-text/v-html,避免覆盖组件内容和模糊数据边界。\n\t\"vue/no-v-text-v-html-on-component\": \"error\",\n\t// 统一模板与脚本中的自定义事件名称为 camelCase。\n\t\"vue/custom-event-name-casing\": [\"error\", \"camelCase\"],\n\t// [默认关闭] 允许在一个 SFC 中声明仅供当前文件使用的小型辅助组件。\n\t\"vue/one-component-per-file\": \"off\",\n\t// [高影响][可自动修复] 统一模板属性分组;首次启用可能产生大量仅排序的模板差异。\n\t\"vue/attributes-order\": [\n\t\t\"error\",\n\t\t{\n\t\t\torder: [\"DEFINITION\", \"LIST_RENDERING\", \"CONDITIONALS\", \"RENDER_MODIFIERS\", \"GLOBAL\", \"UNIQUE\", \"OTHER_ATTR\", \"EVENTS\", \"CONTENT\"],\n\t\t},\n\t],\n} satisfies RuleOptions;\n"],"mappings":";;;;;;;AAQA,MAAa,WAAW;CAEvB,iBAAiB;CAEjB,4BAA4B;CAE5B,8BAA8B;CAE9B,kCAAkC;CAElC,8BAA8B;CAG9B,oBAAoB;CAEpB,yBAAyB;CAEzB,mCAAmC;CAEnC,qCAAqC;CAErC,gCAAgC,CAAC,SAAS,WAAW;CAErD,8BAA8B;CAE9B,wBAAwB,CACvB,SACA,EACC,OAAO;EAAC;EAAc;EAAkB;EAAgB;EAAoB;EAAU;EAAU;EAAc;EAAU;CAAS,EAClI,CACD;AACD"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
审查日期:2026-08-02
|
|
4
4
|
|
|
5
|
-
审查对象:`@fast-china/eslint-config` 2.0.
|
|
5
|
+
审查对象:`@fast-china/eslint-config` 2.0.5 工作区
|
|
6
6
|
|
|
7
7
|
## 结论
|
|
8
8
|
|
|
@@ -82,7 +82,10 @@ pnpm pack --dry-run
|
|
|
82
82
|
3. TypeScript 源码类型检查。
|
|
83
83
|
4. ESLint 全仓检查。
|
|
84
84
|
5. Prettier 格式检查。
|
|
85
|
-
6.
|
|
85
|
+
6. 消费者类型契约测试。
|
|
86
|
+
7. 运行时配置集成测试。
|
|
87
|
+
8. 规则注释与风险文档治理测试。
|
|
88
|
+
9. 发布元数据、入口文件和声明文件契约测试。
|
|
86
89
|
|
|
87
90
|
发布归档必须包含根入口和 `./configs`、`./constants`、`./rules` 子入口的 JavaScript 与声明文件,以及生成的 JavaScript、声明 source map;且不得包含源码缓存、测试缓存或本地依赖目录。
|
|
88
91
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fast-china/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
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": [
|
|
@@ -75,9 +75,12 @@
|
|
|
75
75
|
"lint:fix": "eslint . --fix",
|
|
76
76
|
"format": "prettier --write .",
|
|
77
77
|
"format:check": "prettier --check .",
|
|
78
|
-
"test": "pnpm run test:types &&
|
|
78
|
+
"test": "pnpm run build && pnpm run test:types && pnpm run test:runtime && pnpm run test:rules && pnpm run test:package",
|
|
79
79
|
"test:types": "tsc --noEmit --project tests/tsconfig.json",
|
|
80
|
-
"
|
|
80
|
+
"test:runtime": "node --test tests/config.test.mjs",
|
|
81
|
+
"test:rules": "node --test tests/rules.test.mjs",
|
|
82
|
+
"test:package": "node --test tests/package.test.mjs",
|
|
83
|
+
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run format:check",
|
|
81
84
|
"prepack": "pnpm run check"
|
|
82
85
|
},
|
|
83
86
|
"peerDependencies": {
|