e6b987adf2e5d1a935068f074754e282be32d629
[webi-installers/.git] / prettier / install.sh
1 # title: Prettier
2 # homepage: https://prettier.io/
3 # tagline: Prettier is an opinionated code formatter.
4 # description: |
5 #   The core value of Prettier is not in what it gives, but in what it takes away: countless hours of bikeshedding over code style choices. Also, it makes git merges much nicer.
6 # examples: |
7 #   Prettify all web files in a project, recursively:
8 #   
9 #   ```bash
10 #   prettier --write '**/*{.md,.js,.html,.css}' --ignore ./dist
11 #   ```
12 #   
13 #   Tell Prettier which files to ignore every time
14 #   
15 #   ```bash
16 #   echo "./dist" >> .prettierignore
17 #   ```
18 #   
19 #   Tell Prettier which settings to use - do NOT use `package.json` when it's not necessary!
20 #   
21 #   **`.prettierrc`**:
22 #   
23 #   ```bash
24 #   {
25 #     "trailingComma": "none",
26 #     "tabWidth": 2,
27 #     "singleQuote": true,
28 #     "proseWrap": "always"
29 #   }
30 #   ```
31 #
32
33 if [ -z "$(npm --version 2>/dev/null)" ]; then
34     webi node
35     export PATH="$HOME/.local/opt/node/bin:$PATH"
36 fi
37 npm install -g prettier@latest