From 9a7bd7a14a5064895dd9a0e8c943f1b56936e12b Mon Sep 17 00:00:00 2001 From: cs10086 <1291454411@qq.com> Date: Mon, 14 Sep 2026 02:25:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(P2-1):=20hx=5Fpage.html=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E4=BA=A7=E7=89=A9=E7=BC=96=E7=A0=81=E5=AE=A1=E8=AE=A1=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95(10->9=E8=AD=A6=E5=91=8A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/audit-project.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/audit-project.js b/tools/audit-project.js index 0696cc8..8ccb473 100644 --- a/tools/audit-project.js +++ b/tools/audit-project.js @@ -18,6 +18,8 @@ const ROOT = path.resolve(__dirname, '..'); // tools/ 是检查器自身,内部必然包含 importObject 等模式字符串, // 当成业务代码审计只会产生假阳性;.zcode/ 是工具链运行产物。 const IGNORE_DIRS = new Set(['.git', 'node_modules', 'unpackage', '.hbuilderx', '.trae', 'git', 'tools', '.zcode']); +// P2-1: 已被 .gitignore 忽略的构建产物不参与编码审计(hx_page.html 的 UTF-8 BOM 是 HBuilderX 生成器行为,非源码问题)。 +const IGNORE_FILES = new Set(['hx_page.html']); const SOURCE_EXT = new Set(['.vue', '.js', '.ts', '.json', '.scss', '.css', '.md', '.html']); const JSON_OUT = process.argv.includes('--json'); @@ -50,6 +52,7 @@ function walk(dir, out = []) { if (IGNORE_DIRS.has(e.name)) continue; walk(path.join(dir, e.name), out); } else if (e.isFile()) { + if (IGNORE_FILES.has(e.name)) continue; out.push(path.join(dir, e.name)); } }