diff --git a/docs/cli.md b/docs/cli.md index 84e6d6fab..e779614d2 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -71,7 +71,7 @@ Console output if some of the files require re-formatting: Checking formatting... [warn] src/fileA.js [warn] src/fileB.js -[warn] Code style issues found in 2 files. Run Prettier to fix. +[warn] Code style issues found in 2 files. Run Prettier with --write to fix. ``` The command will return exit code `1` in the second case, which is helpful inside the CI pipelines. diff --git a/src/cli/format.js b/src/cli/format.js index 320925c07..13b2e5e5d 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -492,7 +492,7 @@ async function formatFiles(context) { context.logger.warn( context.argv.write ? `Code style issues fixed in ${files}.` - : `Code style issues found in ${files}. Run Prettier to fix.`, + : `Code style issues found in ${files}. Run Prettier with --write to fix.`, ); } } diff --git a/tests/integration/__tests__/__snapshots__/check.js.snap b/tests/integration/__tests__/__snapshots__/check.js.snap index eb16520ca..1c64b954c 100644 --- a/tests/integration/__tests__/__snapshots__/check.js.snap +++ b/tests/integration/__tests__/__snapshots__/check.js.snap @@ -3,7 +3,7 @@ exports[`--checks should print the number of files that need formatting (stderr) 1`] = ` "[warn] unformatted.js [warn] unformatted2.js -[warn] Code style issues found in 2 files. Run Prettier to fix." +[warn] Code style issues found in 2 files. Run Prettier with --write to fix." `; exports[`--checks should print the number of files that need formatting (stdout) 1`] = `"Checking formatting..."`; @@ -12,12 +12,12 @@ exports[`--checks should print the number of files that need formatting (write) exports[`--checks works in CI just as in a non-TTY mode (stderr) 1`] = ` "[warn] unformatted.js -[warn] Code style issues found in the above file. Run Prettier to fix." +[warn] Code style issues found in the above file. Run Prettier with --write to fix." `; exports[`--checks works in CI just as in a non-TTY mode (stderr) 2`] = ` "[warn] unformatted.js -[warn] Code style issues found in the above file. Run Prettier to fix." +[warn] Code style issues found in the above file. Run Prettier with --write to fix." `; exports[`--checks works in CI just as in a non-TTY mode (stdout) 1`] = `"Checking formatting..."`; diff --git a/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap b/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap index 0c48d151e..23f58051d 100644 --- a/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap +++ b/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap @@ -26,7 +26,7 @@ override.as-js-file" exports[`ignore-unknown check (stderr) 1`] = ` "[warn] javascript.js [warn] override.as-js-file -[warn] Code style issues found in 2 files. Run Prettier to fix." +[warn] Code style issues found in 2 files. Run Prettier with --write to fix." `; exports[`ignore-unknown check (stdout) 1`] = `"Checking formatting..."`; diff --git a/tests/integration/__tests__/__snapshots__/infer-parser.js.snap b/tests/integration/__tests__/__snapshots__/infer-parser.js.snap index a589e48c8..08d876da4 100644 --- a/tests/integration/__tests__/__snapshots__/infer-parser.js.snap +++ b/tests/integration/__tests__/__snapshots__/infer-parser.js.snap @@ -3,7 +3,7 @@ exports[`--check with unknown path and no parser multiple files (stderr) 1`] = ` "[error] No parser could be inferred for file "/infer-parser/FOO". [warn] foo.js -[warn] Code style issues found in the above file. Run Prettier to fix." +[warn] Code style issues found in the above file. Run Prettier with --write to fix." `; exports[`--check with unknown path and no parser multiple files (stdout) 1`] = `"Checking formatting..."`; diff --git a/website/blog/2023-07-05-3.0.0.md b/website/blog/2023-07-05-3.0.0.md index a28947510..4310428be 100644 --- a/website/blog/2023-07-05-3.0.0.md +++ b/website/blog/2023-07-05-3.0.0.md @@ -2060,7 +2060,7 @@ UndefinedParserError: No parser and no file path given, couldn't infer a parser. #### Updated failure message to be more informative ([#11369](https://github.com/prettier/prettier/pull/11369) by [@webark](https://github.com/webark)) -Updated the "Forgot to run Prettier?" to "Run Prettier to fix." +Updated the "Forgot to run Prettier?" to "Run Prettier with --write to fix." This keeps the same spirit of the message, but is less likely to be misinterpreted as it's a more formal message rather than being diff --git a/website/versioned_docs/version-stable/cli.md b/website/versioned_docs/version-stable/cli.md index 1893ed591..772f9e697 100644 --- a/website/versioned_docs/version-stable/cli.md +++ b/website/versioned_docs/version-stable/cli.md @@ -72,7 +72,7 @@ Console output if some of the files require re-formatting: Checking formatting... [warn] src/fileA.js [warn] src/fileB.js -[warn] Code style issues found in 2 files. Run Prettier to fix. +[warn] Code style issues found in 2 files. Run Prettier with --write to fix. ``` The command will return exit code `1` in the second case, which is helpful inside the CI pipelines.