eslint-plugin-jsdoc 46.4.6 → 46.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +21 -10
  3. package/dist/index.js.map +1 -1
  4. package/dist/jsdocUtils.js +1 -1
  5. package/dist/jsdocUtils.js.map +1 -1
  6. package/dist/rules/matchDescription.js +1 -1
  7. package/dist/rules/matchDescription.js.map +1 -1
  8. package/package.json +14 -12
  9. package/dist/WarnSettings.d.ts +0 -17
  10. package/dist/WarnSettings.d.ts.map +0 -1
  11. package/dist/alignTransform.d.ts +0 -32
  12. package/dist/alignTransform.d.ts.map +0 -1
  13. package/dist/defaultTagOrder.d.ts +0 -5
  14. package/dist/defaultTagOrder.d.ts.map +0 -1
  15. package/dist/exportParser.d.ts +0 -41
  16. package/dist/exportParser.d.ts.map +0 -1
  17. package/dist/getDefaultTagStructureForMode.d.ts +0 -11
  18. package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
  19. package/dist/index.d.ts +0 -10
  20. package/dist/index.d.ts.map +0 -1
  21. package/dist/iterateJsdoc.d.ts +0 -460
  22. package/dist/iterateJsdoc.d.ts.map +0 -1
  23. package/dist/jsdocUtils.d.ts +0 -421
  24. package/dist/jsdocUtils.d.ts.map +0 -1
  25. package/dist/rules/checkAccess.d.ts +0 -3
  26. package/dist/rules/checkAccess.d.ts.map +0 -1
  27. package/dist/rules/checkAlignment.d.ts +0 -3
  28. package/dist/rules/checkAlignment.d.ts.map +0 -1
  29. package/dist/rules/checkExamples.d.ts +0 -4
  30. package/dist/rules/checkExamples.d.ts.map +0 -1
  31. package/dist/rules/checkIndentation.d.ts +0 -3
  32. package/dist/rules/checkIndentation.d.ts.map +0 -1
  33. package/dist/rules/checkLineAlignment.d.ts +0 -10
  34. package/dist/rules/checkLineAlignment.d.ts.map +0 -1
  35. package/dist/rules/checkParamNames.d.ts +0 -3
  36. package/dist/rules/checkParamNames.d.ts.map +0 -1
  37. package/dist/rules/checkPropertyNames.d.ts +0 -3
  38. package/dist/rules/checkPropertyNames.d.ts.map +0 -1
  39. package/dist/rules/checkSyntax.d.ts +0 -3
  40. package/dist/rules/checkSyntax.d.ts.map +0 -1
  41. package/dist/rules/checkTagNames.d.ts +0 -3
  42. package/dist/rules/checkTagNames.d.ts.map +0 -1
  43. package/dist/rules/checkTypes.d.ts +0 -3
  44. package/dist/rules/checkTypes.d.ts.map +0 -1
  45. package/dist/rules/checkValues.d.ts +0 -3
  46. package/dist/rules/checkValues.d.ts.map +0 -1
  47. package/dist/rules/emptyTags.d.ts +0 -3
  48. package/dist/rules/emptyTags.d.ts.map +0 -1
  49. package/dist/rules/implementsOnClasses.d.ts +0 -3
  50. package/dist/rules/implementsOnClasses.d.ts.map +0 -1
  51. package/dist/rules/importsAsDependencies.d.ts +0 -3
  52. package/dist/rules/importsAsDependencies.d.ts.map +0 -1
  53. package/dist/rules/informativeDocs.d.ts +0 -3
  54. package/dist/rules/informativeDocs.d.ts.map +0 -1
  55. package/dist/rules/matchDescription.d.ts +0 -3
  56. package/dist/rules/matchDescription.d.ts.map +0 -1
  57. package/dist/rules/matchName.d.ts +0 -3
  58. package/dist/rules/matchName.d.ts.map +0 -1
  59. package/dist/rules/multilineBlocks.d.ts +0 -3
  60. package/dist/rules/multilineBlocks.d.ts.map +0 -1
  61. package/dist/rules/noBadBlocks.d.ts +0 -3
  62. package/dist/rules/noBadBlocks.d.ts.map +0 -1
  63. package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
  64. package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
  65. package/dist/rules/noBlankBlocks.d.ts +0 -3
  66. package/dist/rules/noBlankBlocks.d.ts.map +0 -1
  67. package/dist/rules/noDefaults.d.ts +0 -3
  68. package/dist/rules/noDefaults.d.ts.map +0 -1
  69. package/dist/rules/noMissingSyntax.d.ts +0 -10
  70. package/dist/rules/noMissingSyntax.d.ts.map +0 -1
  71. package/dist/rules/noMultiAsterisks.d.ts +0 -3
  72. package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
  73. package/dist/rules/noRestrictedSyntax.d.ts +0 -3
  74. package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
  75. package/dist/rules/noTypes.d.ts +0 -3
  76. package/dist/rules/noTypes.d.ts.map +0 -1
  77. package/dist/rules/noUndefinedTypes.d.ts +0 -3
  78. package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
  79. package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
  80. package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
  81. package/dist/rules/requireDescription.d.ts +0 -3
  82. package/dist/rules/requireDescription.d.ts.map +0 -1
  83. package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
  84. package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
  85. package/dist/rules/requireExample.d.ts +0 -3
  86. package/dist/rules/requireExample.d.ts.map +0 -1
  87. package/dist/rules/requireFileOverview.d.ts +0 -3
  88. package/dist/rules/requireFileOverview.d.ts.map +0 -1
  89. package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
  90. package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
  91. package/dist/rules/requireJsdoc.d.ts +0 -9
  92. package/dist/rules/requireJsdoc.d.ts.map +0 -1
  93. package/dist/rules/requireParam.d.ts +0 -4
  94. package/dist/rules/requireParam.d.ts.map +0 -1
  95. package/dist/rules/requireParamDescription.d.ts +0 -3
  96. package/dist/rules/requireParamDescription.d.ts.map +0 -1
  97. package/dist/rules/requireParamName.d.ts +0 -3
  98. package/dist/rules/requireParamName.d.ts.map +0 -1
  99. package/dist/rules/requireParamType.d.ts +0 -3
  100. package/dist/rules/requireParamType.d.ts.map +0 -1
  101. package/dist/rules/requireProperty.d.ts +0 -3
  102. package/dist/rules/requireProperty.d.ts.map +0 -1
  103. package/dist/rules/requirePropertyDescription.d.ts +0 -3
  104. package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
  105. package/dist/rules/requirePropertyName.d.ts +0 -3
  106. package/dist/rules/requirePropertyName.d.ts.map +0 -1
  107. package/dist/rules/requirePropertyType.d.ts +0 -3
  108. package/dist/rules/requirePropertyType.d.ts.map +0 -1
  109. package/dist/rules/requireReturns.d.ts +0 -3
  110. package/dist/rules/requireReturns.d.ts.map +0 -1
  111. package/dist/rules/requireReturnsCheck.d.ts +0 -3
  112. package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
  113. package/dist/rules/requireReturnsDescription.d.ts +0 -3
  114. package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
  115. package/dist/rules/requireReturnsType.d.ts +0 -3
  116. package/dist/rules/requireReturnsType.d.ts.map +0 -1
  117. package/dist/rules/requireThrows.d.ts +0 -3
  118. package/dist/rules/requireThrows.d.ts.map +0 -1
  119. package/dist/rules/requireYields.d.ts +0 -3
  120. package/dist/rules/requireYields.d.ts.map +0 -1
  121. package/dist/rules/requireYieldsCheck.d.ts +0 -3
  122. package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
  123. package/dist/rules/sortTags.d.ts +0 -3
  124. package/dist/rules/sortTags.d.ts.map +0 -1
  125. package/dist/rules/tagLines.d.ts +0 -3
  126. package/dist/rules/tagLines.d.ts.map +0 -1
  127. package/dist/rules/textEscaping.d.ts +0 -3
  128. package/dist/rules/textEscaping.d.ts.map +0 -1
  129. package/dist/rules/validTypes.d.ts +0 -3
  130. package/dist/rules/validTypes.d.ts.map +0 -1
  131. package/dist/tagNames.d.ts +0 -16
  132. package/dist/tagNames.d.ts.map +0 -1
  133. package/dist/utils/hasReturnValue.d.ts +0 -20
  134. package/dist/utils/hasReturnValue.d.ts.map +0 -1
  135. package/docs/advanced.md +0 -102
  136. package/docs/rules/check-access.md +0 -193
  137. package/docs/rules/check-alignment.md +0 -169
  138. package/docs/rules/check-examples.md +0 -784
  139. package/docs/rules/check-indentation.md +0 -296
  140. package/docs/rules/check-line-alignment.md +0 -1002
  141. package/docs/rules/check-param-names.md +0 -1035
  142. package/docs/rules/check-property-names.md +0 -244
  143. package/docs/rules/check-syntax.md +0 -80
  144. package/docs/rules/check-tag-names.md +0 -1132
  145. package/docs/rules/check-types.md +0 -1198
  146. package/docs/rules/check-values.md +0 -409
  147. package/docs/rules/empty-tags.md +0 -220
  148. package/docs/rules/implements-on-classes.md +0 -219
  149. package/docs/rules/imports-as-dependencies.md +0 -99
  150. package/docs/rules/informative-docs.md +0 -400
  151. package/docs/rules/match-description.md +0 -1008
  152. package/docs/rules/match-name.md +0 -249
  153. package/docs/rules/multiline-blocks.md +0 -398
  154. package/docs/rules/no-bad-blocks.md +0 -174
  155. package/docs/rules/no-blank-block-descriptions.md +0 -91
  156. package/docs/rules/no-blank-blocks.md +0 -98
  157. package/docs/rules/no-defaults.md +0 -207
  158. package/docs/rules/no-missing-syntax.md +0 -275
  159. package/docs/rules/no-multi-asterisks.md +0 -278
  160. package/docs/rules/no-restricted-syntax.md +0 -383
  161. package/docs/rules/no-types.md +0 -168
  162. package/docs/rules/no-undefined-types.md +0 -789
  163. package/docs/rules/require-asterisk-prefix.md +0 -297
  164. package/docs/rules/require-description-complete-sentence.md +0 -820
  165. package/docs/rules/require-description.md +0 -585
  166. package/docs/rules/require-example.md +0 -390
  167. package/docs/rules/require-file-overview.md +0 -324
  168. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  169. package/docs/rules/require-jsdoc.md +0 -1857
  170. package/docs/rules/require-param-description.md +0 -238
  171. package/docs/rules/require-param-name.md +0 -163
  172. package/docs/rules/require-param-type.md +0 -227
  173. package/docs/rules/require-param.md +0 -1820
  174. package/docs/rules/require-property-description.md +0 -88
  175. package/docs/rules/require-property-name.md +0 -79
  176. package/docs/rules/require-property-type.md +0 -79
  177. package/docs/rules/require-property.md +0 -128
  178. package/docs/rules/require-returns-check.md +0 -1053
  179. package/docs/rules/require-returns-description.md +0 -181
  180. package/docs/rules/require-returns-type.md +0 -144
  181. package/docs/rules/require-returns.md +0 -1191
  182. package/docs/rules/require-throws.md +0 -326
  183. package/docs/rules/require-yields-check.md +0 -544
  184. package/docs/rules/require-yields.md +0 -823
  185. package/docs/rules/sort-tags.md +0 -635
  186. package/docs/rules/tag-lines.md +0 -551
  187. package/docs/rules/text-escaping.md +0 -177
  188. package/docs/rules/valid-types.md +0 -881
  189. package/docs/settings.md +0 -362
  190. package/tsconfig-prod.json +0 -20
  191. package/tsconfig.json +0 -21
package/docs/settings.md DELETED
@@ -1,362 +0,0 @@
1
- <a name="user-content-settings"></a>
2
- <a name="settings"></a>
3
- ## Settings
4
-
5
- * [Allow tags (`@private` or `@internal`) to disable rules for that comment block](#user-content-settings-allow-tags-private-or-internal-to-disable-rules-for-that-comment-block)
6
- * [`maxLines` and `minLines`](#user-content-settings-maxlines-and-minlines)
7
- * [Mode](#user-content-settings-mode)
8
- * [Alias Preference](#user-content-settings-alias-preference)
9
- * [Default Preferred Aliases](#user-content-settings-alias-preference-default-preferred-aliases)
10
- * [`@override`/`@augments`/`@extends`/`@implements`/`@ignore` Without Accompanying `@param`/`@description`/`@example`/`@returns`/`@throws`/`@yields`](#user-content-settings-override-augments-extends-implements-ignore-without-accompanying-param-description-example-returns-throws-yields)
11
- * [Settings to Configure `check-types` and `no-undefined-types`](#user-content-settings-settings-to-configure-check-types-and-no-undefined-types)
12
- * [`structuredTags`](#user-content-settings-structuredtags)
13
- * [`contexts`](#user-content-settings-contexts)
14
-
15
-
16
- <a name="user-content-settings-allow-tags-private-or-internal-to-disable-rules-for-that-comment-block"></a>
17
- <a name="settings-allow-tags-private-or-internal-to-disable-rules-for-that-comment-block"></a>
18
- ### Allow tags (<code>@private</code> or <code>@internal</code>) to disable rules for that comment block
19
-
20
- - `settings.jsdoc.ignorePrivate` - Disables all rules for the comment block
21
- on which a `@private` tag (or `@access private`) occurs. Defaults to
22
- `false`. Note: This has no effect with the rule `check-access` (whose
23
- purpose is to check access modifiers) or `empty-tags` (which checks
24
- `@private` itself).
25
- - `settings.jsdoc.ignoreInternal` - Disables all rules for the comment block
26
- on which a `@internal` tag occurs. Defaults to `false`. Note: This has no
27
- effect with the rule `empty-tags` (which checks `@internal` itself).
28
-
29
- <a name="user-content-settings-maxlines-and-minlines"></a>
30
- <a name="settings-maxlines-and-minlines"></a>
31
- ### <code>maxLines</code> and <code>minLines</code>
32
-
33
- One can use `minLines` and `maxLines` to indicate how many line breaks
34
- (if any) will be checked to find a jsdoc comment block before the given
35
- code block. These settings default to `0` and `1` respectively.
36
-
37
- In conjunction with the `require-jsdoc` rule, these settings can
38
- be enforced so as to report problems if a jsdoc block is not found within
39
- the specified boundaries. The settings are also used in the fixer to determine
40
- how many line breaks to add when a block is missing.
41
-
42
- <a name="user-content-settings-mode"></a>
43
- <a name="settings-mode"></a>
44
- ### Mode
45
-
46
- - `settings.jsdoc.mode` - Set to `typescript`, `closure`, or `jsdoc` (the
47
- default is now `typescript`).
48
- Note that if you do not wish to use separate `.eslintrc.*` files for a
49
- project containing both JavaScript and TypeScript, you can also use
50
- [`overrides`](https://eslint.org/docs/user-guide/configuring). You may also
51
- set to `"permissive"` to try to be as accommodating to any of the styles,
52
- but this is not recommended. Currently is used for the following:
53
- - `check-tag-names`: Determine valid tags and aliases
54
- - `no-undefined-types`: Only check `@template` for types in "closure" and
55
- "typescript" modes
56
- - `check-syntax`: determines aspects that may be enforced
57
- - `valid-types`: in non-Closure mode, `@extends`, `@package` and access tags
58
- (e.g., `@private`) with a bracketed type are reported as are missing
59
- names with `@typedef`
60
- - For type/namepath-checking rules, determine which tags will be checked for
61
- types/namepaths (Closure allows types on some tags which the others do not,
62
- so these tags will additionally be checked in "closure" mode)
63
- - For type-checking rules, impacts parsing of types (through
64
- [jsdoc-type-pratt-parser](https://github.com/simonseyock/jsdoc-type-pratt-parser)
65
- dependency)
66
- - Check preferred tag names
67
- - Disallows namepath on `@interface` for "closure" mode in `valid-types` (and
68
- avoids checking in other rules)
69
-
70
- Note that if you are using TypeScript syntax (and not just the TypeScript
71
- flavor of JSDoc which `mode` set to "typescript" implies), you may wish
72
- to use the `recommended-typescript` or `recommended-typescript-error`
73
- config. This will add rules such as `jsdoc/no-types` to expect you have
74
- no types expressed in JSDoc (since these can be added in TypeScript).
75
-
76
- <a name="user-content-settings-alias-preference"></a>
77
- <a name="settings-alias-preference"></a>
78
- ### Alias Preference
79
-
80
- Use `settings.jsdoc.tagNamePreference` to configure a preferred alias name for
81
- a JSDoc tag. The format of the configuration is:
82
- `<primary tag name>: <preferred alias name>`, e.g.
83
-
84
- ```json
85
- {
86
- "rules": {},
87
- "settings": {
88
- "jsdoc": {
89
- "tagNamePreference": {
90
- "param": "arg",
91
- "returns": "return"
92
- }
93
- }
94
- }
95
- }
96
- ```
97
-
98
- Note: ESLint does not allow settings to have keys which conflict with
99
- `Object.prototype` e.g. `'constructor'`. To work around this, you can use the
100
- key `'tag constructor'`.
101
-
102
- One may also use an object with a `message` and `replacement`.
103
-
104
- The following will report the message
105
- `@extends is to be used over @augments as it is more evocative of classes than @augments`
106
- upon encountering `@augments`.
107
-
108
- ```json
109
- {
110
- "rules": {},
111
- "settings": {
112
- "jsdoc": {
113
- "tagNamePreference": {
114
- "augments": {
115
- "message": "@extends is to be used over @augments as it is more evocative of classes than @augments",
116
- "replacement": "extends"
117
- }
118
- }
119
- }
120
- }
121
- }
122
- ```
123
-
124
- If one wishes to reject a normally valid tag, e.g., `@todo`, one may set the
125
- tag to `false`:
126
-
127
- ```json
128
- {
129
- "rules": {},
130
- "settings": {
131
- "jsdoc": {
132
- "tagNamePreference": {
133
- "todo": false
134
- }
135
- }
136
- }
137
- }
138
- ```
139
-
140
- A project wishing to ensure no blocks are left excluded from entering the
141
- documentation, might wish to prevent the `@ignore` tag in the above manner.
142
-
143
- Or one may set the targeted tag to an object with a custom `message`, but
144
- without a `replacement` property:
145
-
146
- ```json
147
- {
148
- "rules": {},
149
- "settings": {
150
- "jsdoc": {
151
- "tagNamePreference": {
152
- "todo": {
153
- "message": "We expect immediate perfection, so don't leave to-dos in your code."
154
- }
155
- }
156
- }
157
- }
158
- }
159
- ```
160
-
161
- Note that the preferred tags indicated in the
162
- `settings.jsdoc.tagNamePreference` map will be assumed to be defined by
163
- `check-tag-names`.
164
-
165
- See `check-tag-names` for how that fact can be used to set an alias to itself
166
- to allow both the alias and the default (since aliases are otherwise not
167
- permitted unless used in `tagNamePreference`).
168
-
169
- <a name="user-content-settings-alias-preference-default-preferred-aliases"></a>
170
- <a name="settings-alias-preference-default-preferred-aliases"></a>
171
- #### Default Preferred Aliases
172
-
173
- The defaults in `eslint-plugin-jsdoc` (for tags which offer
174
- aliases) are as follows:
175
-
176
- - `@abstract` (over `@virtual`)
177
- - `@augments` (over `@extends`)
178
- - `@class` (over `@constructor`)
179
- - `@constant` (over `@const`)
180
- - `@default` (over `@defaultvalue`)
181
- - `@description` (over `@desc`)
182
- - `@external` (over `@host`)
183
- - `@file` (over `@fileoverview`, `@overview`)
184
- - `@fires` (over `@emits`)
185
- - `@function` (over `@func`, `@method`)
186
- - `@member` (over `@var`)
187
- - `@param` (over `@arg`, `@argument`)
188
- - `@property` (over `@prop`)
189
- - `@returns` (over `@return`)
190
- - `@throws` (over `@exception`)
191
- - `@yields` (over `@yield`)
192
-
193
- This setting is utilized by the the rule for tag name checking
194
- (`check-tag-names`) as well as in the `@param` and `@require` rules:
195
-
196
- - `check-param-names`
197
- - `check-tag-names`
198
- - `require-hyphen-before-param-description`
199
- - `require-description`
200
- - `require-param`
201
- - `require-param-description`
202
- - `require-param-name`
203
- - `require-param-type`
204
- - `require-returns`
205
- - `require-returns-check`
206
- - `require-returns-description`
207
- - `require-returns-type`
208
-
209
- <a name="user-content-settings-override-augments-extends-implements-ignore-without-accompanying-param-description-example-returns-throws-yields"></a>
210
- <a name="settings-override-augments-extends-implements-ignore-without-accompanying-param-description-example-returns-throws-yields"></a>
211
- ### <code>@override</code>/<code>@augments</code>/<code>@extends</code>/<code>@implements</code>/<code>@ignore</code> Without Accompanying <code>@param</code>/<code>@description</code>/<code>@example</code>/<code>@returns</code>/<code>@throws</code>/<code>@yields</code>
212
-
213
- The following settings allows the element(s) they reference to be omitted
214
- on the JSDoc comment block of the function or that of its parent class
215
- for any of the "require" rules (i.e., `require-param`, `require-description`,
216
- `require-example`, `require-returns`, `require-throws`, `require-yields`).
217
-
218
- * `settings.jsdoc.ignoreReplacesDocs` (`@ignore`) - Defaults to `true`
219
- * `settings.jsdoc.overrideReplacesDocs` (`@override`) - Defaults to `true`
220
- * `settings.jsdoc.augmentsExtendsReplacesDocs` (`@augments` or its alias
221
- `@extends`) - Defaults to `false`.
222
- * `settings.jsdoc.implementsReplacesDocs` (`@implements`) - Defaults to `false`
223
-
224
- The format of the configuration is as follows:
225
-
226
- ```json
227
- {
228
- "rules": {},
229
- "settings": {
230
- "jsdoc": {
231
- "ignoreReplacesDocs": true,
232
- "overrideReplacesDocs": true,
233
- "augmentsExtendsReplacesDocs": true,
234
- "implementsReplacesDocs": true
235
- }
236
- }
237
- }
238
- ```
239
-
240
- <a name="user-content-settings-settings-to-configure-check-types-and-no-undefined-types"></a>
241
- <a name="settings-settings-to-configure-check-types-and-no-undefined-types"></a>
242
- ### Settings to Configure <code>check-types</code> and <code>no-undefined-types</code>
243
-
244
- - `settings.jsdoc.preferredTypes` An option map to indicate preferred
245
- or forbidden types (if default types are indicated here, these will
246
- have precedence over the default recommendations for `check-types`).
247
- The keys of this map are the types to be replaced (or forbidden).
248
- These keys may include:
249
- 1. The "ANY" type, `*`
250
- 1. The pseudo-type `[]` which we use to denote the parent (array)
251
- types used in the syntax `string[]`, `number[]`, etc.
252
- 1. The pseudo-type `.<>` (or `.`) to represent the format `Array.<value>`
253
- or `Object.<key, value>`
254
- 1. The pseudo-type `<>` to represent the format `Array<value>` or
255
- `Object<key, value>`
256
- 1. A plain string type, e.g., `MyType`
257
- 1. A plain string type followed by one of the above pseudo-types (except
258
- for `[]` which is always assumed to be an `Array`), e.g., `Array.`, or
259
- `SpecialObject<>`.
260
-
261
- If a bare pseudo-type is used, it will match all parent types of that form.
262
- If a pseudo-type prefixed with a type name is used, it will only match
263
- parent types of that form and type name.
264
-
265
- The values can be:
266
- - `false` to forbid the type
267
- - a string to indicate the type that should be preferred in its place
268
- (and which `fix` mode can replace); this can be one of the formats
269
- of the keys described above.
270
- - Note that the format will not be changed unless you use a pseudo-type
271
- in the replacement. (For example, `'Array.<>': 'MyArray'` will change
272
- `Array.<string>` to `MyArray.<string>`, preserving the dot. To get rid
273
- of the dot, you must use the pseudo-type with `<>`, i.e.,
274
- `'Array.<>': 'MyArray<>'`, which will change `Array.<string>` to
275
- `MyArray<string>`).
276
- - If you use a _bare_ pseudo-type in the replacement (e.g.,
277
- `'MyArray.<>': '<>'`), the type will be converted to the format
278
- of the pseudo-type without changing the type name. For example,
279
- `MyArray.<string>` will become `MyArray<string>` but `Array.<string>`
280
- will not be modified.
281
- - an object with:
282
- - the key `message` to provide a specific error message
283
- when encountering the discouraged type.
284
- - The message string will have the substrings with special meaning,
285
- `{{tagName}}` and `{{tagValue}}`, replaced with their
286
- corresponding value.
287
- - an optional key `replacement` with either of the following values:
288
- - a string type to be preferred in its place (and which `fix` mode
289
- can replace)
290
- - `false` (for forbidding the type)
291
- - an optional key `skipRootChecking` (for `check-types`) to allow for this
292
- type in the context of a root (i.e., a parent object of some child type)
293
-
294
- Note that the preferred types indicated as targets in
295
- `settings.jsdoc.preferredTypes` map will be assumed to be defined by
296
- `no-undefined-types`.
297
-
298
- See the option of `check-types`, `unifyParentAndChildTypeChecks`, for
299
- how the keys of `preferredTypes` may have `<>` or `.<>` (or just `.`)
300
- appended and its bearing on whether types are checked as parents/children
301
- only (e.g., to match `Array` if the type is `Array` vs. `Array.<string>`).
302
-
303
- Note that if a value is present both as a key and as a value, neither the
304
- key nor the value will be reported. Thus in `check-types`, this fact can
305
- be used to allow both `object` and `Object` if one has a `preferredTypes`
306
- key `object: 'Object'` and `Object: 'object'`.
307
-
308
- <a name="user-content-settings-structuredtags"></a>
309
- <a name="settings-structuredtags"></a>
310
- ### <code>structuredTags</code>
311
-
312
- An object indicating tags whose types and names/namepaths (whether defining or
313
- referencing namepaths) will be checked, subject to configuration. If the tags
314
- have predefined behavior or `allowEmptyNamepaths` behavior, this option will
315
- override that behavior for any specified tags, though this option can also be
316
- used for tags without predefined behavior. Its keys are tag names and its
317
- values are objects with the following optional properties:
318
- - `name` - String set to one of the following:
319
- - `"text"` - When a name is present, plain text will be allowed in the
320
- name position (non-whitespace immediately after the tag and whitespace),
321
- e.g., in `@throws This is an error`, "This" would normally be the name,
322
- but "text" allows non-name text here also. This is the default.
323
- - `"namepath-defining"` - As with `namepath-referencing`, but also
324
- indicates the tag adds a namepath to definitions, e.g., to prevent
325
- `no-undefined-types` from reporting references to that namepath.
326
- - `"namepath-referencing"` - This will cause any name position to be
327
- checked to ensure it is a valid namepath. You might use this to ensure
328
- that tags which normally allow free text, e.g., `@see` will instead
329
- require a namepath.
330
- - `"namepath-or-url-referencing"` - For inline tags which may point to
331
- a namepath or URL.
332
- - `false` - This will disallow any text in the name position.
333
- - `type`:
334
- - `true` - Allows valid types within brackets. This is the default.
335
- - `false` - Explicitly disallows any brackets or bracketed type. You
336
- might use this with `@throws` to suggest that only free form text
337
- is being input or with `@augments` (for jsdoc mode) to disallow
338
- Closure-style bracketed usage along with a required namepath.
339
- - (An array of strings) - A list of permissible types.
340
- - `required` - Array of one of the following (defaults to an empty array,
341
- meaning none are required):
342
- - One or both of the following strings (if both are included, then both
343
- are required):
344
- - `"name"` - Indicates that a name position is required (not just that
345
- if present, it is a valid namepath). You might use this with `see`
346
- to insist that a value (or namepath, depending on the `name` value)
347
- is always present.
348
- - `"type"` - Indicates that the type position (within curly brackets)
349
- is required (not just that if present, it is a valid type). You
350
- might use this with `@throws` or `@typedef` which might otherwise
351
- normally have their types optional. See the type groups 3-5 above.
352
- - `"typeOrNameRequired"` - Must have either type (e.g., `@throws {aType}`) or
353
- name (`@throws Some text`); does not require that both exist but
354
- disallows just an empty tag.
355
-
356
- <a name="user-content-settings-contexts"></a>
357
- <a name="settings-contexts"></a>
358
- ### <code>contexts</code>
359
-
360
- `settings.jsdoc.contexts` can be used as the default for any rules
361
- with a `contexts` property option. See the "AST and Selectors" section
362
- for more on this format.
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": ["es2022"],
4
- "moduleResolution": "node",
5
- "module": "NodeNext",
6
- "allowJs": true,
7
- "checkJs": true,
8
- "noEmit": false,
9
- "emitDeclarationOnly": true,
10
- "declaration": true,
11
- "declarationMap": true,
12
- "strict": true,
13
- "target": "es2017",
14
- "outDir": "dist"
15
- },
16
- "include": [
17
- "src/**/*.js"
18
- ],
19
- "exclude": ["node_modules", "src/bin/*.js"]
20
- }
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": ["es2022"],
4
- "moduleResolution": "node",
5
- "module": "NodeNext",
6
- "allowJs": true,
7
- "checkJs": true,
8
- "noEmit": true,
9
- "declaration": true,
10
- "declarationMap": true,
11
- "strict": true,
12
- "target": "es2017",
13
- "outDir": "dist"
14
- },
15
- "include": [
16
- "src/**/*.js",
17
- "test/**/*.js",
18
- "src/bin/gitdown.d.ts"
19
- ],
20
- "exclude": ["node_modules"]
21
- }