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 9 replies

Comment options

You must be logged in to vote
9 replies
@IgnisDa
Comment options

@Zhengqbbb
Comment options

@vecerek
Comment options

@pandeiro
Comment options

@hanseltime
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
9 participants