From e90c6feeacdf9ad010d4d73b65d7dd7d3b86efe2 Mon Sep 17 00:00:00 2001 From: milaninfy <111582375+milaninfy@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:48:11 -0500 Subject: [PATCH] docs: depth flag default value (#8051) documentation of `ls` command specifies that `depth` flag if not set defaults to `1` but as per code it uses 0 as default value. https://github.com/npm/cli/blob/dc31c1bdc6658ab69554adcf2988ee99a615c409/lib/commands/ls.js#L113-L116 fixes: https://github.com/npm/cli/issues/7979 --- tap-snapshots/test/lib/docs.js.test.cjs | 2 +- workspaces/config/lib/definitions/definitions.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index baceb5dcd3e3c..ba84dda4fe399 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -405,7 +405,7 @@ are same as \`cpu\` field of package.json, which comes from \`process.arch\`. #### \`depth\` -* Default: \`Infinity\` if \`--all\` is set, otherwise \`1\` +* Default: \`Infinity\` if \`--all\` is set, otherwise \`0\` * Type: null or Number The depth to go when recursing packages for \`npm ls\`. diff --git a/workspaces/config/lib/definitions/definitions.js b/workspaces/config/lib/definitions/definitions.js index cbad7c7354cb0..4c404524fd7dc 100644 --- a/workspaces/config/lib/definitions/definitions.js +++ b/workspaces/config/lib/definitions/definitions.js @@ -461,7 +461,7 @@ const definitions = { depth: new Definition('depth', { default: null, defaultDescription: ` - \`Infinity\` if \`--all\` is set, otherwise \`1\` + \`Infinity\` if \`--all\` is set, otherwise \`0\` `, type: [null, Number], description: `