From c50f2bbe3075757840bbd7ed941647a9bde84266 Mon Sep 17 00:00:00 2001 From: Szymon Dzialowski Date: Tue, 12 Apr 2022 10:47:07 +0100 Subject: [PATCH] Please describe what prettier ignores by default (#12626) Co-authored-by: Szymon Dzialowski Co-authored-by: Szymon Dzialowski Co-authored-by: fisker Cheung --- docs/ignore.md | 21 +++++++++++++++++++ .../versioned_docs/version-stable/ignore.md | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/ignore.md b/docs/ignore.md index 1cca65e41..2b5b7504f 100644 --- a/docs/ignore.md +++ b/docs/ignore.md @@ -24,6 +24,27 @@ coverage It’s recommended to have a `.prettierignore` in your project! This way you can run `prettier --write .` to make sure that everything is formatted (without mangling files you don’t want, or choking on generated files). And – your editor will know which files _not_ to format! +By default prettier ignores files in version control systems directories (".git", ".svn" and ".hg") and `node_modules` (if [`--with-node-modules` CLI option](cli.md#--with-node-modules) not specified) + +So by default it will be + +```js +**/.git +**/.svn +**/.hg +**/node_modules +``` + +and + +```js +**/.git +**/.svn +**/.hg +``` + +if [`--with-node-modules` CLI option](cli.md#--with-node-modules) provided + (See also the [`--ignore-path` CLI option](cli.md#--ignore-path).) ## JavaScript diff --git a/website/versioned_docs/version-stable/ignore.md b/website/versioned_docs/version-stable/ignore.md index f62f11492..24ae1b3e4 100644 --- a/website/versioned_docs/version-stable/ignore.md +++ b/website/versioned_docs/version-stable/ignore.md @@ -25,6 +25,27 @@ coverage It’s recommended to have a `.prettierignore` in your project! This way you can run `prettier --write .` to make sure that everything is formatted (without mangling files you don’t want, or choking on generated files). And – your editor will know which files _not_ to format! +By default prettier ignores files in version control systems directories (".git", ".svn" and ".hg") and `node_modules` (if [`--with-node-modules` CLI option](cli.md#--with-node-modules) not specified) + +So by default it will be + +```js +**/.git +**/.svn +**/.hg +**/node_modules +``` + +and + +```js +**/.git +**/.svn +**/.hg +``` + +if [`--with-node-modules` CLI option](cli.md#--with-node-modules) provided + (See also the [`--ignore-path` CLI option](cli.md#--ignore-path).) ## JavaScript