mirror of
https://github.com/mikaela/mikaela.github.io/
synced 2024-11-25 13:59:25 +01:00
n/prettier.md: add a section on configuration
This commit is contained in:
parent
35d791778f
commit
ef27f940b2
@ -19,6 +19,7 @@ excerpt: I use them both directly, and within pre-commit
|
||||
|
||||
- [The packages](#the-packages)
|
||||
- [Installation](#installation)
|
||||
- [Configuration](#configuration)
|
||||
- [`.pre-commit-config.yaml`](#pre-commit-configyaml)
|
||||
- [Offline](#offline)
|
||||
- [Online](#online)
|
||||
@ -44,6 +45,19 @@ excerpt: I use them both directly, and within pre-commit
|
||||
1. If they don't exist already `echo "{}" > .prettierrc && touch .prettierignore`
|
||||
1. `pnpm exec prettier . --write` or `pnpm exec prettier . --check`
|
||||
|
||||
## Configuration
|
||||
|
||||
I do with `.editorconfig` what I can, but for example this site's `.prettierrc` looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@prettier/plugin-xml"],
|
||||
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }]
|
||||
}
|
||||
```
|
||||
|
||||
at the time of writing. It's directly from documentation excluding the plugin name, but I will want it everywhere.
|
||||
|
||||
## `.pre-commit-config.yaml`
|
||||
|
||||
This is the file that controls [`pre-commit`]s behaviour.
|
||||
|
Loading…
Reference in New Issue
Block a user