You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add knip: detect dead files, exports, types across the project
Adds knip@6 with flat config in knip.json. Declares runtime entry
points (index.ts, workers, mllp, BAR services, v2-to-fhir processor),
script entries (scripts/**), and test entries.
Cleanup to reach 0 findings:
- Deleted 8 unused barrel files: src/bar/index.ts, src/code-mapping/
index.ts, src/mllp/index.ts, src/v2-to-fhir/index.ts,
src/v2-to-fhir/{code-mapping,datatypes,messages,segments}/index.ts.
Nothing imported them — were likely leftovers from an earlier
extraction plan.
- Removed 23 redundant `export default` lines from converter modules
(adt-a01/a03/a08, oru-r01, vxu-v04, pid-patient, SAD/ST/XAD/XCN/XON/
XPN/XTN datatype converters, NK1/DG1/AL1/IN1 segment converters).
All had both a named export and a default for the same function;
default was never imported.
- De-exported 49 unused named exports across ~26 files
(made file-private by dropping the `export` keyword).
- De-exported 91 unused exported types/interfaces across ~36 files
(same pattern — kept as internal types for readability).
- Deleted genuinely dead code: getValidValuesWithDisplay +
getDisplayForCode (mapping-type-options), convertXPNArrayToHumanNames
(xpn-humanname), fetchConceptMap (concept-map/service — shadowed by
test-local helper), plus a couple of dead re-exports.
Also wire `bun run knip` into test:local and test:all. Any new dead
file, export, or redundant export breaks the test loop.
Typecheck + lint stay at 0 errors/warnings. Unit tests unchanged
(1878 pass / 17 todo / 74 preexisting failures).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Nikita Sintsev <nikita.sintsev@health-samurai.io>
0 commit comments