I’m reopening #2250 which was closed a bit too hastily. I just hit the use case of wanting to read yarn.lock from Python (as an introspection step), and although I thought yarn.lock was yaml, it’s actually not. It’s almost yaml.
Pipenv, which is heavily inspired by yarn, uses json for its lockfile which makes it very easy to parse.
I suggest either using json or yaml for the lockfile v2. If yaml’s large featureset is an issue, I know there’s “strict yaml” subsets (at least here for Python, I don’t know for JS). JSON would make the most sense but that does mean comments would no longer be available.