Commit 384efa8
bgagent
fix(cdk): restore exhaustiveness guard + correct knip ratchet keys (#282)
Addresses PR review (ayushtr-aws):
1. validation.ts: the `void (true as _AssertAttachmentExhaustive)` form
silently defeated the AttachmentType exhaustiveness guard — a type
assertion never errors, whereas the original ASSIGNMENT to a `never`
type is the actual compile-time check. Restored the assignment and
consume the binding with `void` so it survives noUnusedLocals and
no-unused-vars without weakening the guard. Verified: tsc errors when
a member is missing from ATTACHMENT_TYPE_LIST, compiles clean when
exhaustive.
2. check-deadcode-ratchet.mjs: COUNTED_KEYS used non-existent knip 6.x
keys (classMembers, nsExports, nsTypes) and counted unused files from
a non-existent top-level report.files. Switched to the real keys
(namespaceMembers, catalog) and count files from issues[].files[] so
unused files actually move the ratchet. Count unchanged at 78.1 parent ea6d75a commit 384efa8
2 files changed
Lines changed: 21 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
292 | 297 | | |
293 | 298 | | |
294 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
53 | | - | |
54 | | - | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
0 commit comments