You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Copy file name to clipboardExpand all lines: docs/lib/content/configuring-npm/package-lock-json.md
+2
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ various purposes:
31
31
picture of the package tree, reducing the need to read `package.json`
32
32
files, and allowing for significant performance improvements.
33
33
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
+
34
36
### `package-lock.json` vs `npm-shrinkwrap.json`
35
37
36
38
Both of these files have the same format, and perform similar functions in
0 commit comments