Files
everything-claude-code/docs/zh-CN/commands/refactor-clean.md
zdoc 88054de673 docs: Add Chinese (zh-CN) translations for all documentation
* docs: add Chinese versions docs

* update

---------

Co-authored-by: neo <neo.dowithless@gmail.com>
2026-02-05 05:57:54 -08:00

29 lines
774 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 重构清理
通过测试验证安全识别并删除无用代码:
1. 运行无用代码分析工具:
* knip查找未使用的导出和文件
* depcheck查找未使用的依赖项
* ts-prune查找未使用的 TypeScript 导出
2. 在 .reports/dead-code-analysis.md 中生成综合报告
3. 按严重程度对发现进行分类:
* 安全:测试文件、未使用的工具函数
* 注意API 路由、组件
* 危险:配置文件、主要入口点
4. 仅建议安全的删除操作
5. 每次删除前:
* 运行完整的测试套件
* 验证测试通过
* 应用更改
* 重新运行测试
* 如果测试失败则回滚
6. 显示已清理项目的摘要
切勿在不首先运行测试的情况下删除代码!