refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / prettier / README.md
1 ---
2 title: Prettier
3 homepage: https://prettier.io/
4 tagline: |
5   Prettier is an opinionated code formatter.
6 ---
7
8 ## Updating `prettier`
9
10 ```bash
11 npm install -g prettier@latest
12 ```
13
14 ## Cheat Sheet
15
16 > The core value of Prettier is not in what it gives, but in what it takes away:
17 > countless hours of bikeshedding over code style choices. Also, it makes git
18 > merges much nicer.
19
20 Prettify all web files in a project, recursively:
21
22 ```bash
23 prettier --write '**/*{.md,.js,.html,.css}'
24 ```
25
26 Tell Prettier which files to ignore every time
27
28 ```bash
29 echo "dist/" >> .prettierignore
30 ```
31
32 Tell Prettier which settings to use - do NOT use `package.json` when it's not
33 necessary!
34
35 **`.prettierrc`**:
36
37 ```bash
38 {
39   "trailingComma": "none",
40   "tabWidth": 2,
41   "singleQuote": true,
42   "proseWrap": "always"
43 }
44 ```