my-code-style 1.8.3 → 1.8.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 CHANGED
@@ -1,29 +1,38 @@
1
1
  ## 变更日志
2
2
 
3
+ ## [1.8.5](https://github.com/myvn/codeStyle/compare/v1.8.4...v1.8.5) (2026-09-22)
4
+
5
+ ### 🐛 Bug Fixes | Bug 修复
6
+
7
+ - **stylelint:** Less 线关闭 declaration-property-value-no-unknown,修复 rpx 误报 ([ba7dda0](https://github.com/myvn/codeStyle/commit/ba7dda0d99988f1cab4b1d7ff1f73707c611a4f2))
8
+
9
+ ## [1.8.4](https://github.com/myvn/codeStyle/compare/v1.8.3...v1.8.4) (2026-09-22)
10
+
11
+ ### 🐛 Bug Fixes | Bug 修复
12
+
13
+ - NIT-012 规则分叉了结 + 发布工具防失控(BUG-028)+ CI 工件冒烟 ([1f24451](https://github.com/myvn/codeStyle/commit/1f24451d114ae396eb935bec9227ce93873b7cf1))
14
+
3
15
  ## [1.8.3](https://github.com/myvn/codeStyle/compare/v1.8.2...v1.8.3) (2026-09-21)
4
16
 
5
17
  ### 🐛 Bug Fixes | Bug 修复
6
18
 
7
- * 校准 peer 范围,修复 eslint 10 组合被 npm 拒装(BUG-027) ([33d211d](https://github.com/myvn/codeStyle/commit/33d211dcbdb24b2e67962c6c32d02628d13cec32))
19
+ - 校准 peer 范围,修复 eslint 10 组合被 npm 拒装(BUG-027) ([33d211d](https://github.com/myvn/codeStyle/commit/33d211dcbdb24b2e67962c6c32d02628d13cec32))
8
20
 
9
21
  ## [1.8.2](https://github.com/myvn/codeStyle/compare/v1.8.1...v1.8.2) (2026-09-21)
10
22
 
11
-
12
23
  ### 🐛 Bug Fixes | Bug 修复
13
24
 
14
- * versionrc 静默压优先级警告 + CHANGELOG 结构修复 + 发布工具迁移 catv@12 ([d1b8abf](https://github.com/myvn/codeStyle/commit/d1b8abfcccb595c33d4b9490e87b0599fe37b6bc))
25
+ - versionrc 静默压优先级警告 + CHANGELOG 结构修复 + 发布工具迁移 catv@12 ([d1b8abf](https://github.com/myvn/codeStyle/commit/d1b8abfcccb595c33d4b9490e87b0599fe37b6bc))
15
26
 
16
27
  ### [1.8.1](https://github.com/myvn/codeStyle/compare/v1.8.0...v1.8.1) (2026-09-20)
17
28
 
18
-
19
29
  ### 🐛 Bug Fixes | Bug 修复
20
30
 
21
- * **init:** 安装命令里的版本范围加引号,粘贴不再被 shell 截断 ([9abaf1d](https://github.com/myvn/codeStyle/commit/9abaf1d76ea3aff05f0d26d11a43e8661ed6221a))
22
-
31
+ - **init:** 安装命令里的版本范围加引号,粘贴不再被 shell 截断 ([9abaf1d](https://github.com/myvn/codeStyle/commit/9abaf1d76ea3aff05f0d26d11a43e8661ed6221a))
23
32
 
24
33
  ### ✨ Features | 新功能
25
34
 
26
- * **init:** 输出步骤化为固定六步,dry-run 全流程预览 ([f14ca47](https://github.com/myvn/codeStyle/commit/f14ca47449b7d3e8f9a381b6e145e99232586886))
35
+ - **init:** 输出步骤化为固定六步,dry-run 全流程预览 ([f14ca47](https://github.com/myvn/codeStyle/commit/f14ca47449b7d3e8f9a381b6e145e99232586886))
27
36
 
28
37
  ## [1.8.0](https://github.com/myvn/codeStyle/compare/v1.7.2...v1.8.0) (2026-09-20)
29
38
 
package/README.md CHANGED
@@ -240,12 +240,12 @@ npx my-code-style-init [--dry-run] [--backup] [--version|-v] [--help|-h]
240
240
  ## 测试套件
241
241
 
242
242
  ```bash
243
- npm run test:all # 全量运行 180 项:用例明细 + 分类统计 + 最慢文件定位
243
+ npm run test:all # 全量运行 184 项:用例明细 + 分类统计 + 最慢文件定位
244
244
  npm run diagnose # 换机器后先跑它:进程 / git / 文件系统 / hooks 各占多少
245
245
  npm run sweep # 给本机找最佳文件级并发(扫 integration 套件)
246
246
  npm test # 只跑基础 CLI 与配置矩阵(86 项)
247
247
  npm run test:integration:setup # 安装现代化隔离依赖运行环境
248
- npm run test:integration # Flat Config、真实 Husky 及提交链路测试(59 项)
248
+ npm run test:integration # Flat Config、真实 Husky 及提交链路测试(63 项)
249
249
  npm run test:legacy:setup # 安装 ESLint 8 隔离运行环境
250
250
  npm run test:legacy # ESLint 8.57.0 兼容性回归测试(27 项)
251
251
  npm run test:stylelint17:setup # 安装 Stylelint 17 隔离运行环境
@@ -267,11 +267,11 @@ npm run test:stylelint17 # Stylelint 17 生态兼容性回归(8 项)
267
267
  …
268
268
  ✓ 通过 86 · 3.6s · 最慢文件 init-matrix.test.cjs 3.2s
269
269
 
270
- ▶ [2/4] 现代工具链与提交链 (共 59 项,23 文件 · 3 文件并发(自动:2 核 / 内存 4G))
270
+ ▶ [2/4] 现代工具链与提交链 (共 63 项,24 文件 · 3 文件并发(自动:2 核 / 内存 4G))
271
271
  ✓ 完整提交链:JS/TS/Vue/nvue/CSS/less 自动修复及二次复检 · 10.4s
272
272
  ✓ 发布防呆:HEAD 已有 v* tag 时拦截(此时 release 工具会静默抬版并写出空 CHANGELOG) · 609ms
273
273
  …
274
- ✓ 通过 59 · 41.0s · 最慢文件 commit-chain-both.test.cjs 10.6s
274
+ ✓ 通过 63 · 40.2s · 最慢文件 commit-chain-both.test.cjs 10.7s
275
275
 
276
276
  ▶ [3/4] ESLint 8 兼容性 (共 27 项,1 文件 · 3 文件并发(自动:2 核 / 内存 4G))
277
277
  ✓ 独立运行 ESLint 8 支持下限而非 ESLint 9 · 1ms
@@ -289,16 +289,16 @@ npm run test:stylelint17 # Stylelint 17 生态兼容性回归(8 项)
289
289
  套件 通过 失败 跳过 用时
290
290
  ──────────────────────────────────────────────────────
291
291
  基础 CLI 与配置矩阵 86 0 - 3.6s
292
- 现代工具链与提交链 59 0 - 40.7s
292
+ 现代工具链与提交链 63 0 - 40.2s
293
293
  ESLint 8 兼容性 27 0 - 18.7s
294
294
  Stylelint 17 兼容性 8 0 - 7.3s
295
295
  ──────────────────────────────────────────────────────
296
- 合计 180 0 - 70.3s
296
+ 合计 184 0 - 69.1s
297
297
  ──────────────────────────────────────────────────────
298
298
 
299
- ⏱ 最慢文件:eslint8.test.cjs 18.3s · commit-chain-both.test.cjs 10.6s · commit-chain-scss.test.cjs 10.6s
299
+ ⏱ 最慢文件:eslint8.test.cjs 18.0s · commit-chain-less.test.cjs 11.4s · commit-chain-both.test.cjs 11.3s
300
300
 
301
- ✅ 全部通过:180/180 项,用时 70.3s
301
+ ✅ 全部通过:184/184 项,用时 69.1s
302
302
  ```
303
303
 
304
304
  终端里每个套件下方还有一条实时进度条(`██████░░░░ 38/66 失败 0 4.0s`)。附加参数:
@@ -376,7 +376,7 @@ npm run test:all -- --profile # 看每个测试文件耗时,定位瓶颈
376
376
  | `npm run test:integration`(运行器调度,自动并发 3) | 30.6s(只看集成套件那一段) |
377
377
  | 串行套件 + 文件级并发 23(全部一波) | ✗ 3.8G 内存沙箱被 OOM 压垮(19 项 SIGKILL) |
378
378
 
379
- 同机复测(180 项,同一台 2 核沙箱连续跑;绝对秒数随机器负载波动,相对关系稳定):串行套件 + 文件级并发 1 = 72.7s、默认自动并发 3 = 70.3s、`--parallel` 四套件 = 71.1s、`npm run test:integration` = 43.1s、`node --test demo-test/integration/*.test.cjs` = 71.6s。
379
+ 同机复测(184 项,同一台 2 核沙箱连续跑;绝对秒数随机器负载波动,相对关系稳定):串行套件 + 文件级并发 1 = 72.3s、默认自动并发 3 = 69.1s、`--parallel` 四套件 = 64.0s、`npm run test:integration` = 43.3s、`node --test demo-test/integration/*.test.cjs` = 62.4s(部分为 182 项时实测,本轮仅集成套件 +2 用例,差值在秒级)。
380
380
 
381
381
  (2 核沙箱里并行收益被 CPU 争抢吃掉大半,`--concurrency=1` 时单个文件只要 0.7–4.2s;
382
382
  16 核机器上集成套件那段 ≈ 最慢子文件,即"一次真实提交"的量级。)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-code-style",
3
- "version": "1.8.3",
3
+ "version": "1.8.5",
4
4
  "description": "Lint/Format/Git 配置工程化 npm 包(ESLint + Prettier + Stylelint + Commitlint + Husky + standard-version)",
5
5
  "type": "commonjs",
6
6
  "main": "src/eslint/uniapp.cjs",
@@ -45,6 +45,7 @@
45
45
  "scripts": {
46
46
  "test": "node --test tests/*.test.cjs demo-test/*.test.cjs",
47
47
  "test:demo": "node --test demo-test/*.test.cjs",
48
+ "test:count": "node scripts/count-tests.cjs demo-test/*.test.cjs",
48
49
  "test:integration:setup": "node demo-test/setup-integration.cjs",
49
50
  "test:integration": "node scripts/test-all.cjs --suite=integration",
50
51
  "test:legacy:setup": "node demo-test/setup-legacy.cjs",
@@ -36,7 +36,13 @@ export const commonRules = {
36
36
 
37
37
  // Import rules (using import-x for flat config compatibility)
38
38
  "import-x/no-unresolved": "off",
39
- "import-x/extensions": "off",
39
+ // 与 legacy 的 import/extensions 对齐(NIT-012):相对导入的 js/jsx/ts/tsx 不带
40
+ // 扩展名;mjs/cjs 未列出、按规则默认要求带扩展名(与本仓 .mjs 互引一致)
41
+ "import-x/extensions": [
42
+ "error",
43
+ "ignorePackages",
44
+ { js: "never", jsx: "never", ts: "never", tsx: "never" },
45
+ ],
40
46
  "import-x/prefer-default-export": "off",
41
47
  "import-x/no-extraneous-dependencies": "off",
42
48
 
@@ -9,7 +9,8 @@ export default [
9
9
 
10
10
  // Add uni-app globals
11
11
  {
12
- files: ["**/*.{vue,ts,js,nvue}"],
12
+ // 覆盖 base 配置的全部语言文件(此前漏了 mjs/cjs/mts/cts/jsx/tsx,NIT-012)
13
+ files: ["**/*.{vue,ts,js,mjs,cjs,mts,cts,jsx,tsx,nvue}"],
13
14
  languageOptions: {
14
15
  globals: uniappGlobals,
15
16
  },
@@ -44,6 +44,11 @@ module.exports = {
44
44
  "function-no-unknown": null,
45
45
  // 允许小程序单位 rpx
46
46
  "unit-no-unknown": [true, { ignoreUnits: ["rpx"] }],
47
+ // 关闭属性-值匹配校验:stylelint-config-recommended 默认开启它,会把
48
+ // `width: 750rpx` 报成 unknown value( Less 线没有 scss 配置包那层关闭,
49
+ // BUG-029 深测实测);SCSS 线上游(recommended-scss)本就将其置 null,
50
+ // 这里对齐,保证 uni-app Less 项目 rpx 写法不误报。
51
+ "declaration-property-value-no-unknown": null,
47
52
  // 允许小程序 page 标签
48
53
  "selector-type-no-unknown": [true, { ignoreTypes: ["page"] }],
49
54
  "comment-empty-line-before": "never",