Skip to content

Commit 140b9c9

Browse files
authored
docs(package-json): note that line endings are inferred (#7382)
## What Per npm/json-parse-even-better-errors#3 (comment), npm will implicitly update line endings, spacing, etc of `package-lock.json` so that it matches `package.json` ## Why I'd like to add this documentation because it does not seem to be documented anywhere, and as it is an implicit and non-configurable behavior, it took me a long time to figure out the cause. ## References npm/json-parse-even-better-errors#3 (comment)
1 parent 9216d59 commit 140b9c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/lib/content/configuring-npm/package-lock-json.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ various purposes:
3131
picture of the package tree, reducing the need to read `package.json`
3232
files, and allowing for significant performance improvements.
3333

34+
When `npm` creates or updates `package-lock.json`, it will infer line endings and indentation from `package.json` so that the formatting of both files matches.
35+
3436
### `package-lock.json` vs `npm-shrinkwrap.json`
3537

3638
Both of these files have the same format, and perform similar functions in

0 commit comments

Comments
 (0)