Skip to content

Commit

Permalink
docs(package-json): note that line endings are inferred (#7382)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
ertw committed Apr 16, 2024
1 parent 9216d59 commit 140b9c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/lib/content/configuring-npm/package-lock-json.md
Expand Up @@ -31,6 +31,8 @@ various purposes:
picture of the package tree, reducing the need to read `package.json`
files, and allowing for significant performance improvements.

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.

### `package-lock.json` vs `npm-shrinkwrap.json`

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

0 comments on commit 140b9c9

Please sign in to comment.