From 265bb8621cd83f2a1498d48815f37c2efa523128 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 26 Apr 2024 14:47:04 +0200 Subject: [PATCH] add comment --- tools/lint-lockfiles.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/lint-lockfiles.js b/tools/lint-lockfiles.js index b13d48783f..a74d445515 100755 --- a/tools/lint-lockfiles.js +++ b/tools/lint-lockfiles.js @@ -12,6 +12,9 @@ const files = [ const rootPath = fileURLToPath(new URL('..', import.meta.url)); let hadErrors = false; +// This checks that all "resolved" URLs in package-lock.json point to the official npm registry. +// If a user is using a npm proxy (private or public), they would write that proxy's URL into +// the file which we do not want because it could cause issues during installation. for (const file of files.map((file) => fileURLToPath(new URL(file, import.meta.url)))) { const data = JSON.parse(readFileSync(file)); for (const [pkg, {resolved}] of Object.entries(data.packages)) {