Skip to content

Why does 'yarn install' rewrite package.json? #2636

Answered by arcanis
rdicroce asked this question in Q&A
Discussion options

You must be logged in to vote

So: should any of this be considered a bug in Yarn? IMO rewriting package.json for no reason feels like a bug. The sorting behavior also feels unintended, and ideally I'd like for Yarn to preserve the order, but I'd settle for not modifying the file unnecessarily.

Not keeping the dependencies in alphabetical order leads to harder-to-maintain projects as you lose the ability to quickly see which dependencies are in use. That they are enforced in a consistent order is intended 🙂

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rdicroce
Comment options

@arcanis
Comment options

@jeffrson
Comment options

@martinal
Comment options

Answer selected by arcanis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants