diff --git a/src/cli/constant.js b/src/cli/constant.js index d13e92ce341d..21ee34d35dbc 100644 --- a/src/cli/constant.js +++ b/src/cli/constant.js @@ -88,8 +88,7 @@ const options = { }, ], default: "metadata", - describe: - "Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. ", + description: "Strategy for the cache to use for detecting changed files.", type: "choice", }, check: { diff --git a/tests/integration/__tests__/__snapshots__/early-exit.js.snap b/tests/integration/__tests__/__snapshots__/early-exit.js.snap index 5fc0a518af28..1fa8e6fd7bb2 100644 --- a/tests/integration/__tests__/__snapshots__/early-exit.js.snap +++ b/tests/integration/__tests__/__snapshots__/early-exit.js.snap @@ -141,6 +141,9 @@ Other options: --cache Only format changed files. Cannot use with --stdin-filepath. Defaults to false. + --cache-strategy + Strategy for the cache to use for detecting changed files. + Defaults to metadata. --no-color Do not colorize error messages. --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched. @@ -313,6 +316,9 @@ Other options: --cache Only format changed files. Cannot use with --stdin-filepath. Defaults to false. + --cache-strategy + Strategy for the cache to use for detecting changed files. + Defaults to metadata. --no-color Do not colorize error messages. --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched. diff --git a/tests/integration/__tests__/__snapshots__/help-options.js.snap b/tests/integration/__tests__/__snapshots__/help-options.js.snap index 0a6c0074b077..490c8ec5e211 100644 --- a/tests/integration/__tests__/__snapshots__/help-options.js.snap +++ b/tests/integration/__tests__/__snapshots__/help-options.js.snap @@ -57,6 +57,24 @@ Default: false exports[`show detailed usage with --help cache (write) 1`] = `[]`; +exports[`show detailed usage with --help cache-strategy (stderr) 1`] = `""`; + +exports[`show detailed usage with --help cache-strategy (stdout) 1`] = ` +"--cache-strategy + + Strategy for the cache to use for detecting changed files. + +Valid options: + + metadata Use the file metadata such as timestamps as cache keys + content Use the file content as cache keys + +Default: metadata +" +`; + +exports[`show detailed usage with --help cache-strategy (write) 1`] = `[]`; + exports[`show detailed usage with --help check (stderr) 1`] = `""`; exports[`show detailed usage with --help check (stdout) 1`] = `