A parser library (JSONC, YAML, TOML) should optionally let you parse comments — what you do with them is your prerogative.
Yes, your job is to parse
52.7%
No, throw comments away
15%
It's complicated
32.3%
Poll ended at .
@fasterthanlime I most often ignore them, but sometimes I want to update a value while keeping the comments intact

@TheConstructor @fasterthanlime this is a common use case for me, but in that case it’s a lot wider: it’s „keep all formatting intact, whitespace and indent and all, including comments”. Comments are just a part of keeping the meaningless formatting intact.

A parser/serializer that lets me make programmatic semantic changes to a file created and edited by humans without mangling it and generates a minimal text-level diff is *golden*.