mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
prettier: add page (#6192)
This commit is contained in:
parent
d5f22be326
commit
37e4ef7696
1 changed files with 24 additions and 0 deletions
24
pages/common/prettier.md
Normal file
24
pages/common/prettier.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# prettier
|
||||
|
||||
> An opinionated code formatter for JavaScript, JSON, CSS, YAML, and more.
|
||||
> More information: <https://prettier.io/>.
|
||||
|
||||
- Format a file and print the result to stdout:
|
||||
|
||||
`prettier {{path/to/file}}`
|
||||
|
||||
- Check if a specific file has been formatted:
|
||||
|
||||
`prettier --check {{path/to/file}}`
|
||||
|
||||
- Run with a specific configuration file:
|
||||
|
||||
`prettier --config {{path/to/config_file}} {{path/to/file}}`
|
||||
|
||||
- Format a file or directory, replacing the original:
|
||||
|
||||
`prettier --write {{path/to/file_or_directory}}`
|
||||
|
||||
- Format files or directories recursively using single quotes and no trailing commas:
|
||||
|
||||
`prettier --single-quote --trailing-comma {{none}} --write {{path/to/file_or_directory}}`
|
Loading…
Add table
Reference in a new issue