## 版本内容 ### 分享审计保留与清理 - 审计记录保留与清理能力:终态会话由所有者整体清空(写入墓碑事件保留追责线索)或导出完整 JSON 归档;终态满默认 90 天由 alarm 自动清理 - 审计保留期创建时自定义(7–365 天,白名单校验,默认 90) - 清理留痕集中展示:清理时间与方式(手动/自动)同步用户库(`audit_purged_at`/`audit_purge_type`),折叠面板展示;已清理分享等同删除效果,不再提供查看审计入口 - 手动清空后取消已排期的自动清理闹钟;保留期服务端校验统一为 7–365 天;修复闹钟设置失败导致"有排期无闹钟"的幽灵状态 ### 工程与质量 - 新增审计清理回归测试 8 用例(墓碑隔离、归属/终态校验、同步失败容错、排期回滚、留痕接缝、迁移幂等) - UserDBDO SQL 查询类型化封装(`query<T>`/`one<T>`),消除 22 处 `as unknown as` - 测试类型检查纳入门禁:`tests/` 拆分 `tsconfig.worker`/`tsconfig.frontend`(workers-types 与 DOM lib 的 Element 接口冲突无法单配置共存) - 弱随机数加固(会话名 `crypto.randomUUID`);pnpm 供应链策略(`blockExoticSubdeps`/`minimumReleaseAge` 7 天/`no-downgrade`);CI 权限收敛 `contents: read`;`.gitleaks.toml` 误报豁免 - pi-lens 项目策略口径(AGENTS.md #31):XSS 类规则刻意不做项目级禁用,仅行内逐处豁免 ## 提交列表 - 1c38c7a `release: 发布 v1.12.0 分享审计保留与清理完善版本` - 4dd7c63 `feat: 审计清理回归测试、UserDBDO 类型化查询与测试类型门禁` - 50389f3 `fix: 消除 pi-lens 剩余告警——SAFETY 注释/测试类型/XSS 抑制/空 catch 说明` - 23a3e8e `chore: 代码质量审查整改——弱随机数/测试类型检查/供应链加固等 7 项` - 1cf0ef9 `chore: 配置 pi-lens 项目策略降低风格类噪音并清理用户库遗留项` - 0f27a50 `fix: 审计清理后完全隐藏分享卡片,仅保留集中式清理记录` - 7c42e8e `feat: 审计清理改为删除效果并新增集中式清理记录留痕区` - a3847ee `fix: 审计清理后改用折叠面板展示清理记录并补齐中英文词条` - b730219 `fix: 审计保留期服务端校验统一为 7–365 天并修复清理闹钟静默失败` - a68a6c8 `feat: 分享审计保留期支持创建时自定义(7–365 天)` - 158b205 `fix: 手动清空审计后取消已排期的自动清理唤醒` - 618f63c `feat: 分享审计记录保留与清理能力(清空/导出/自动保留期)` ## 验证结果 - typecheck 全绿(src + tests.worker + tests.frontend + frontend 四段) - 全量测试 644/644(54 文件) - build:frontend 构建成功并内联 - 关联 Issue/PR:无(基于 v1.11.0 #102) --------- Co-authored-by: TanXin <tanxin@example.com>
94 lines
2.1 KiB
JSON
94 lines
2.1 KiB
JSON
{
|
|
"vcs": {
|
|
"enabled": false
|
|
},
|
|
"formatter": {
|
|
"enabled": true,
|
|
"indentWidth": 2,
|
|
"lineWidth": 100,
|
|
"indentStyle": "space"
|
|
},
|
|
"linter": {
|
|
"enabled": true,
|
|
"rules": {
|
|
"recommended": true,
|
|
"correctness": {
|
|
"noUnusedVariables": "error",
|
|
"noUnusedImports": "error",
|
|
"noUndeclaredVariables": "warn"
|
|
},
|
|
"style": {
|
|
"useConst": "error",
|
|
"useTemplate": "error",
|
|
"noNegationElse": "error",
|
|
"noNestedTernary": "error",
|
|
"noParameterAssign": "error",
|
|
"noNonNullAssertion": "warn",
|
|
"useBlockStatements": "warn",
|
|
"useCollapsedElseIf": "warn"
|
|
},
|
|
"complexity": {
|
|
"noForEach": "error",
|
|
"noExcessiveCognitiveComplexity": {
|
|
"level": "warn",
|
|
"options": {
|
|
"maxAllowedComplexity": 20
|
|
}
|
|
},
|
|
"useOptionalChain": "warn",
|
|
"noAdjacentSpacesInRegex": "warn"
|
|
},
|
|
"performance": {
|
|
"noAccumulatingSpread": "warn",
|
|
"noBarrelFile": "warn"
|
|
},
|
|
"security": {
|
|
"noBlankTarget": "error",
|
|
"noDangerouslySetInnerHtml": "error",
|
|
"noGlobalEval": "error"
|
|
},
|
|
"a11y": {
|
|
"recommended": true
|
|
},
|
|
"suspicious": {
|
|
"recommended": true,
|
|
"noDebugger": "error",
|
|
"noDoubleEquals": "error",
|
|
"noEmptyInterface": "warn",
|
|
"noExplicitAny": "warn"
|
|
},
|
|
"nursery": {
|
|
"useSortedClasses": "off"
|
|
}
|
|
}
|
|
},
|
|
"javascript": {
|
|
"formatter": {
|
|
"quoteStyle": "single",
|
|
"trailingCommas": "es5",
|
|
"semicolons": "always",
|
|
"bracketSpacing": true
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
"includes": [
|
|
"**/*.{test,spec}.{ts,tsx,js,jsx}"
|
|
],
|
|
"linter": {
|
|
"rules": {
|
|
"suspicious": {
|
|
"noConsole": "off",
|
|
"noExplicitAny": "off"
|
|
},
|
|
"complexity": {
|
|
"noExcessiveCognitiveComplexity": "off"
|
|
}
|
|
}
|
|
},
|
|
"formatter": {
|
|
"enabled": false
|
|
}
|
|
}
|
|
]
|
|
} |