From 285c15ef08a7422dc31eedcd206680ac582ce1da Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 24 Feb 2021 21:47:07 +0200 Subject: [PATCH] docs: how to ignore files using negative patterns (#10400) --- docs/ignore.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/ignore.md b/docs/ignore.md index ca0d9fb1c..1cca65e41 100644 --- a/docs/ignore.md +++ b/docs/ignore.md @@ -159,3 +159,13 @@ hello: world {{/my-crazy-component}} ``` + +## Command Line File Patterns + +For one-off commands, when you want to exclude some files without adding them to `.prettierignore`, negative patterns can come in handy: + +```bash +prettier --write . '!**/*.{js,jsx,vue}' +``` + +See [fast-glob](https://prettier.io/docs/en/cli.html#file-patterns) to learn more about advanced glob syntax.