From 68589a93d7d1fedf09d7cf85dd7c1d07c143d599 Mon Sep 17 00:00:00 2001 From: Erik Williamson Date: Tue, 16 Apr 2024 17:13:46 -0400 Subject: [PATCH] Update package-lock-json.md Per https://github.com/npm/json-parse-even-better-errors/issues/3#issuecomment-1668728929, npm will implicitly update line endings, spacing, etc of `package-lock.json` so that it matches `package.json` 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. --- docs/lib/content/configuring-npm/package-lock-json.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/lib/content/configuring-npm/package-lock-json.md b/docs/lib/content/configuring-npm/package-lock-json.md index d540dd0e7228b..f3b012175fa0e 100644 --- a/docs/lib/content/configuring-npm/package-lock-json.md +++ b/docs/lib/content/configuring-npm/package-lock-json.md @@ -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