Yarn: Configure indentation style in yarn.lock file

Created on 25 Sep 2017  路  5Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
The yarn.lock file is created with an unconfigurable, hardcoded indentation of 2 spaces.
https://github.com/yarnpkg/yarn/blob/19b09975e9900640a3b3070a1e05efc5184e9bef/src/lockfile/stringify.js#L90

What is the expected behavior?
The indentation style should be configurable to cover other numbers of spaces or tabs. Alternatively the indentation style should be inferred from the indentation style in package.json. The latter is the approach taken by npm in version 5:

https://github.com/npm/npm/blob/20589f4b028d3e8a617800ac6289d27f39e548e8/lib/shrinkwrap.js#L171-L185

Please mention your node.js, yarn and operating system version.
Node v8.5.0
yarn v1.1.0
OSX v10.12.6

cat-feature

Most helpful comment

I think having a fixed style would be nice for this file since it would prevent potential confusion or inconsistencies across projects or even inside different versions of the same project so I'm 馃憥 for a change like this.

That said I'd like to hear what @yarnpkg/core thinks.

All 5 comments

Why is this important since the lock file is not intended to be modified by humans?

It's not really, but would provide a pleasing level of consistency across files.

I think having a fixed style would be nice for this file since it would prevent potential confusion or inconsistencies across projects or even inside different versions of the same project so I'm 馃憥 for a change like this.

That said I'd like to hear what @yarnpkg/core thinks.

I don't think this is something we should invest time in.

Closing since we don't intend to work on this and if this feature is implemented, it would bring unnecessary maintenance burden.

Was this page helpful?
0 / 5 - 0 ratings