You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,49 @@ A [Prettier](https://prettier.io) plugin to format [JSDoc](https://jsdoc.app) bl
10
10
11
11
> If you are wondering why I built this, go to the [Motivation](#motivation) section.
12
12
13
+
- 📦 [Installation](#-Installation)
13
14
- ⚙️ [Options](#%EF%B8%8F-options)
14
15
- 🚫 [Ignoring blocks](#-ignoring-blocks)
15
16
- ⚡️ [Modifying the functionality](#%EF%B8%8F-modifying-the-functionality)
16
17
- 📖 [Troubleshooting](#-troubleshooting)
17
18
- 🤘 [Development](#-development)
18
19
- 🐞 [Validating bugs](#-validating-bugs)
19
20
21
+
### 📦 Installation
22
+
23
+
First, please check the [official documentation](https://prettier.io/docs/plugins#using-plugins) on how plugins are used.
24
+
25
+
Just to recap, and focusing in the configuration file approach, there are two ways in which you are probably going to be using this plugin:
26
+
27
+
#### 1. Adding it to your existing configuration
28
+
29
+
The simplest use case: you have a configuration with your rules, and you want to add the plugin. You'd need to define the `plugins` array, if you don't have it already, and add the plugin name to it:
30
+
31
+
```json
32
+
{
33
+
"tabWidth": 90,
34
+
"plugins": ["@homer0/prettier-plugin-jsdoc"]
35
+
}
36
+
```
37
+
38
+
#### 2. Extending an existing configuration and adding the plugin
39
+
40
+
This is kind of confusing in the official docs, because it's not linked in the "using plugins" section, but rather in the ["using a shareable config"](https://prettier.io/docs/sharing-configurations#using-a-shareable-config) section.
41
+
42
+
Unfortunately, Prettier doesn't have a way to use and extend an existing configuration with a JSON syntax, so you have to change to a JavaScript file:
0 commit comments