mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-22 06:20:10 +00:00
fix: restore missing files (package.json etc) and fix sync script logic
This commit is contained in:
28
docs/zh-TW/commands/refactor-clean.md
Normal file
28
docs/zh-TW/commands/refactor-clean.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# 重構清理
|
||||
|
||||
透過測試驗證安全地識別和移除無用程式碼:
|
||||
|
||||
1. 執行無用程式碼分析工具:
|
||||
- knip:找出未使用的 exports 和檔案
|
||||
- depcheck:找出未使用的相依性
|
||||
- ts-prune:找出未使用的 TypeScript exports
|
||||
|
||||
2. 在 .reports/dead-code-analysis.md 產生完整報告
|
||||
|
||||
3. 依嚴重性分類發現:
|
||||
- 安全:測試檔案、未使用的工具
|
||||
- 注意:API 路由、元件
|
||||
- 危險:設定檔、主要進入點
|
||||
|
||||
4. 只提議安全的刪除
|
||||
|
||||
5. 每次刪除前:
|
||||
- 執行完整測試套件
|
||||
- 驗證測試通過
|
||||
- 套用變更
|
||||
- 重新執行測試
|
||||
- 如果測試失敗則回滾
|
||||
|
||||
6. 顯示已清理項目的摘要
|
||||
|
||||
在執行測試前絕不刪除程式碼!
|
||||
Reference in New Issue
Block a user