Description
Repos that commit tsc-generated declarations (types/**/*.d.mts, *.d.ts) end up with fix-headers and tsc rewriting each other.
tsc copies the source file's header into the declaration, so types/src/index.d.mts comes out with @Filename: /src/index.mts. fix-headers then treats it as a normal file and rewrites it to @Filename: /types/src/index.d.mts (plus a new @Last modified time). The next types:build puts /src/index.mts back, and so on. Every run of either tool leaves a diff.
Seen in CLDMV/lib-sqlite-wasm with 2.3.0: a full run touched 32 files under types/ with nothing but this. Worked around there with "excludeFolders": ["types"] in .configs/fix-headers.json (CLDMV/lib-sqlite-wasm@a3d0f34), but every repo with committed types would need the same thing.
Suggested fix: leave a declaration file (.d.ts, .d.mts, .d.cts) alone when its existing header's @Filename names a different file, i.e. it's a copy of a source header that the source run already maintains. Adding types to the excludeFolders default in @cldmv/configs/fix-headers.json would also work, but only for repos that use that folder name.
Activity
fix: leave declaration files that carry tsc's copy of the source head…
cldmv-bot commentedon Nov 25, 2026
Marked
status: implemented— resolved by #196, merged intonext. This issue closes automatically when that work ships to the default branch.release: v2.4.0 - write @filename without a leading slash