aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
chore(deadcode): ratchet down the 85 pre-existing unused exports/types (follow-up to #607)
- Ngôn ngữ chính
- TypeScript
- Star
- 146
- Fork
- 46
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 24
Mô tả
Follow-up to #607 (PR #673).
After #673 re-greened the dead-code ratchet, the knip baseline holds at **85** — all of it pre-existing drift, no longer masked by the devDep/false-positive noise:
| category | count |
|---|---|
| \`exports\` | 44 |
| \`types\` | 41 |
## Why this matters
The ratchet job (\`check:deadcode-ratchet\`) is **advisory / non-blocking** today (\`continue-on-error: true\`). Its stated milestone is to *"flip to blocking once the baseline is driven to zero."* Because it is non-blocking, roughly 7 genuine unused export/type regressions drifted into \`main\` unnoticed inside the +13 that #607 reconciled. Every merge that adds dead code under a non-blocking gate pushes the flip-to-blocking milestone further out.
## Ask
Chip the 85 down over one or more scoped PRs, lowering \`knip-baseline.json\` \`count\` in the same PR each time to lock in the gain (per the baseline's own guidance). Removing unused exports/types requires per-symbol analysis — some may be public API surface or referenced dynamically — so this is deliberately **not** a single bulk-delete.
Reproduce the current list:
\`\`\`
node_modules/.bin/knip --reporter json | jq '[.issues[] | {file, exports: (.exports // [] | map(.name)), types: (.types // [] | map(.name))}] | map(select((.exports|length)>0 or (.types|length)>0))'
\`\`\`
Once the count reaches 0, drop \`continue-on-error: true\` from the ratchet CI job to make it blocking.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc knip-baseline.json và chạy lệnh knip được cung cấp để kiểm tra 85 export và type chưa được sử dụng. Xem xét các tham chiếu của từng symbol trước khi thay đổi tệp source sở hữu symbol đó, đồng thời cập nhật số lượng trong baseline sau mỗi lần dọn dẹp trong phạm vi xác định. Hoàn tất có nghĩa là số lượng đạt 0 và continue-on-error: true được xóa khỏi job CI ratchet.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github-actions, node.js, typescript
- Lĩnh vực
- ci-cd, tooling
- Loại issue
- Tái cấu trúc
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100