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
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,10 @@ To configure JSDoc to use the plugin, add the following to the JSDoc configurati
14
14
"plugins": [
15
15
"jsdoc-plugin-typescript"
16
16
],
17
-
"typescript": {
18
-
"moduleRoot":"src"// optional
19
-
}
20
17
```
21
18
22
19
See http://usejsdoc.org/about-configuring-jsdoc.html for more details on how to configure JSDoc.
23
20
24
-
If `typescript.moduleRoot` is specified, the plugin will assume module ids are relative to that directory and format them as such. For example, `@type {import("./folder/file").Class}` will be converted to `@type {module:folder/file.Class}`. The file extension is removed along with any leading `../` segments (if the referenced module is outside `moduleRoot`).
25
-
26
-
In the absence of `typescript.moduleRoot`, the plugin will mirror the method JSDoc uses to assign module ids:
27
-
28
-
1. Parse the referenced module for an `@module` tag.
29
-
2. If a tag is found and it has an explicit id, use that.
30
-
3. If a tag is found, but it doesn't have an explicit id, use the module's file path relative to the nearest shared parent directory, and remove the file extension.
31
-
32
21
## What this plugin does
33
22
34
23
When using the `class` keyword for defining classes (required by TypeScript), JSDoc requires `@classdesc` and `@extends` annotations. With this plugin, no `@classdesc` and `@extends` annotations are needed.
@@ -121,6 +110,14 @@ This syntax is also used when referring to types of `@typedef`s and `@enum`s.
121
110
*/
122
111
```
123
112
113
+
## Module id resolution
114
+
115
+
For resolving module ids, this plugin mirrors the method used by JSDoc:
116
+
117
+
1. Parse the referenced module for an `@module` tag.
118
+
2. If a tag is found and it has an explicit id, use that.
119
+
3. If a tag is found, but it doesn't have an explicit id, use the module's file path relative to the nearest shared parent directory, and remove the file extension.
120
+
124
121
## Contributing
125
122
126
123
If you are interested in making a contribution to the project, please see the [contributing page](./contributing.md) for details on getting your development environment set up.
0 commit comments