Docs: Add info on ignore file to "Ignoring Code" (#3458)
* docs(ignore): mention ignore file in Ignoring Code While working on #3321, I needed to ignore an entire file, but the "Ignoring Code" section of the docs only describes how to ignore blocks of code, so I wasn't aware of the default ignore file. (The `.prettierignore` file is mentioned in the CLI section, but easily overlooked there.) This commit extends the introduction sentence of the "Ignoring Code" section and adds a new subsection to explain how to ignore files. https://github.com/prettier/prettier/issues/3321#issuecomment-350072566 * docs(cli): fix nesting error in heading hierarchy The `--ignore-path` option currently appears as a third-level subsection of `--find-config-path` and `--config`, but this looks like an error. This commit promotes the `--ignore-path` heading to the same (H2) level as the other CLI options.
This commit is contained in:
1 parent
d00d09bb87
commit
5065608f73
2 files changed
+6
-2
No files matched your search
+5
-1
@@ -3,7 +3,11 @@ id: ignore
|
||||
title: Ignoring Code
|
||||
---
|
||||
|
||||
Prettier offers an escape hatch to ignore a block of code from being formatted.
|
||||
Prettier offers an escape hatch to ignore a block of code or prevent entire files from being formatted.
|
||||
|
||||
## Ignoring Files
|
||||
|
||||
To exclude files from formatting, add entries to a `.prettierignore` file in the project root or set the `--ignore-path` [CLI](cli.md) option.
|
||||
|
||||
## JavaScript
|
||||
|
||||
|
||||
Reference in new issue
Block a user