eslint-plugin-jsdoc 46.4.5 → 46.5.0
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.
- package/README.md +31 -0
- package/dist/alignTransform.js +5 -5
- package/dist/alignTransform.js.map +1 -1
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +1 -1
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/rules/checkExamples.js +12 -6
- package/dist/rules/checkExamples.js.map +1 -1
- package/package.json +19 -15
- package/docs/advanced.md +0 -102
- package/docs/rules/check-access.md +0 -193
- package/docs/rules/check-alignment.md +0 -169
- package/docs/rules/check-examples.md +0 -784
- package/docs/rules/check-indentation.md +0 -296
- package/docs/rules/check-line-alignment.md +0 -1002
- package/docs/rules/check-param-names.md +0 -1035
- package/docs/rules/check-property-names.md +0 -244
- package/docs/rules/check-syntax.md +0 -80
- package/docs/rules/check-tag-names.md +0 -1132
- package/docs/rules/check-types.md +0 -1198
- package/docs/rules/check-values.md +0 -409
- package/docs/rules/empty-tags.md +0 -220
- package/docs/rules/implements-on-classes.md +0 -219
- package/docs/rules/imports-as-dependencies.md +0 -99
- package/docs/rules/informative-docs.md +0 -400
- package/docs/rules/match-description.md +0 -1008
- package/docs/rules/match-name.md +0 -249
- package/docs/rules/multiline-blocks.md +0 -398
- package/docs/rules/no-bad-blocks.md +0 -174
- package/docs/rules/no-blank-block-descriptions.md +0 -91
- package/docs/rules/no-blank-blocks.md +0 -98
- package/docs/rules/no-defaults.md +0 -207
- package/docs/rules/no-missing-syntax.md +0 -275
- package/docs/rules/no-multi-asterisks.md +0 -278
- package/docs/rules/no-restricted-syntax.md +0 -383
- package/docs/rules/no-types.md +0 -168
- package/docs/rules/no-undefined-types.md +0 -789
- package/docs/rules/require-asterisk-prefix.md +0 -297
- package/docs/rules/require-description-complete-sentence.md +0 -820
- package/docs/rules/require-description.md +0 -585
- package/docs/rules/require-example.md +0 -390
- package/docs/rules/require-file-overview.md +0 -324
- package/docs/rules/require-hyphen-before-param-description.md +0 -281
- package/docs/rules/require-jsdoc.md +0 -1857
- package/docs/rules/require-param-description.md +0 -238
- package/docs/rules/require-param-name.md +0 -163
- package/docs/rules/require-param-type.md +0 -227
- package/docs/rules/require-param.md +0 -1820
- package/docs/rules/require-property-description.md +0 -88
- package/docs/rules/require-property-name.md +0 -79
- package/docs/rules/require-property-type.md +0 -79
- package/docs/rules/require-property.md +0 -128
- package/docs/rules/require-returns-check.md +0 -1053
- package/docs/rules/require-returns-description.md +0 -181
- package/docs/rules/require-returns-type.md +0 -144
- package/docs/rules/require-returns.md +0 -1191
- package/docs/rules/require-throws.md +0 -326
- package/docs/rules/require-yields-check.md +0 -544
- package/docs/rules/require-yields.md +0 -823
- package/docs/rules/sort-tags.md +0 -635
- package/docs/rules/tag-lines.md +0 -551
- package/docs/rules/text-escaping.md +0 -177
- package/docs/rules/valid-types.md +0 -881
- package/docs/settings.md +0 -362
- package/tsconfig.json +0 -22
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
<a name="user-content-require-hyphen-before-param-description"></a>
|
|
2
|
-
<a name="require-hyphen-before-param-description"></a>
|
|
3
|
-
# <code>require-hyphen-before-param-description</code>
|
|
4
|
-
|
|
5
|
-
* [Fixer](#user-content-require-hyphen-before-param-description-fixer)
|
|
6
|
-
* [Options](#user-content-require-hyphen-before-param-description-options)
|
|
7
|
-
* [Context and settings](#user-content-require-hyphen-before-param-description-context-and-settings)
|
|
8
|
-
* [Failing examples](#user-content-require-hyphen-before-param-description-failing-examples)
|
|
9
|
-
* [Passing examples](#user-content-require-hyphen-before-param-description-passing-examples)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Requires (or disallows) a hyphen before the `@param` description.
|
|
13
|
-
|
|
14
|
-
<a name="user-content-require-hyphen-before-param-description-fixer"></a>
|
|
15
|
-
<a name="require-hyphen-before-param-description-fixer"></a>
|
|
16
|
-
## Fixer
|
|
17
|
-
|
|
18
|
-
(Todo)
|
|
19
|
-
|
|
20
|
-
<a name="user-content-require-hyphen-before-param-description-options"></a>
|
|
21
|
-
<a name="require-hyphen-before-param-description-options"></a>
|
|
22
|
-
## Options
|
|
23
|
-
|
|
24
|
-
This rule takes one optional string argument and an optional options object.
|
|
25
|
-
|
|
26
|
-
If the string is `"always"` then a problem is raised when there is no hyphen
|
|
27
|
-
before the description. If it is `"never"` then a problem is raised when there
|
|
28
|
-
is a hyphen before the description. The default value is `"always"`.
|
|
29
|
-
|
|
30
|
-
The options object may have the following properties to indicate behavior for
|
|
31
|
-
other tags besides the `@param` tag (or the `@arg` tag if so set):
|
|
32
|
-
|
|
33
|
-
- `tags` - Object whose keys indicate different tags to check for the
|
|
34
|
-
presence or absence of hyphens; the key value should be "always" or "never",
|
|
35
|
-
indicating how hyphens are to be applied, e.g., `{property: 'never'}`
|
|
36
|
-
to ensure `@property` never uses hyphens. A key can also be set as `*`, e.g.,
|
|
37
|
-
`'*': 'always'` to apply hyphen checking to any tag (besides the preferred
|
|
38
|
-
`@param` tag which follows the main string option setting and besides any
|
|
39
|
-
other `tags` entries).
|
|
40
|
-
|
|
41
|
-
<a name="user-content-require-hyphen-before-param-description-context-and-settings"></a>
|
|
42
|
-
<a name="require-hyphen-before-param-description-context-and-settings"></a>
|
|
43
|
-
## Context and settings
|
|
44
|
-
|
|
45
|
-
|||
|
|
46
|
-
|---|---|
|
|
47
|
-
|Context|everywhere|
|
|
48
|
-
|Tags|`param` and optionally other tags within `tags`|
|
|
49
|
-
|Aliases|`arg`, `argument`; potentially `prop` or other aliases|
|
|
50
|
-
|Recommended|false|
|
|
51
|
-
|Options|string ("always", "never") followed by object with `tags`|
|
|
52
|
-
|
|
53
|
-
<a name="user-content-require-hyphen-before-param-description-failing-examples"></a>
|
|
54
|
-
<a name="require-hyphen-before-param-description-failing-examples"></a>
|
|
55
|
-
## Failing examples
|
|
56
|
-
|
|
57
|
-
The following patterns are considered problems:
|
|
58
|
-
|
|
59
|
-
````js
|
|
60
|
-
/**
|
|
61
|
-
* @param foo Foo.
|
|
62
|
-
*/
|
|
63
|
-
function quux () {
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always"]
|
|
67
|
-
// Message: There must be a hyphen before @param description.
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @param foo Foo.
|
|
71
|
-
*/
|
|
72
|
-
function quux () {
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"*":"never"}}]
|
|
76
|
-
// Message: There must be a hyphen before @param description.
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @param foo Foo.
|
|
80
|
-
* @returns {SomeType} - Hyphen here.
|
|
81
|
-
*/
|
|
82
|
-
function quux () {
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"*":"never","returns":"always"}}]
|
|
86
|
-
// Message: There must be a hyphen before @param description.
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* @param foo Foo.
|
|
90
|
-
*/
|
|
91
|
-
function quux () {
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
// Message: There must be a hyphen before @param description.
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @param foo - Foo.
|
|
98
|
-
*/
|
|
99
|
-
function quux () {
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never"]
|
|
103
|
-
// Message: There must be no hyphen before @param description.
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @param foo - Foo.
|
|
107
|
-
*/
|
|
108
|
-
function quux () {
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never"]
|
|
112
|
-
// Message: There must be no hyphen before @param description.
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @param foo - foo
|
|
116
|
-
* @param foo foo
|
|
117
|
-
*/
|
|
118
|
-
function quux () {
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always"]
|
|
122
|
-
// Message: There must be a hyphen before @param description.
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @param foo foo
|
|
126
|
-
* bar
|
|
127
|
-
* @param bar - bar
|
|
128
|
-
*/
|
|
129
|
-
function quux () {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always"]
|
|
133
|
-
// Message: There must be a hyphen before @param description.
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @param foo
|
|
137
|
-
*/
|
|
138
|
-
function quux (foo) {
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"param":false}}}
|
|
142
|
-
// Message: Unexpected tag `@param`
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @typedef {SomeType} ATypeDefName
|
|
146
|
-
* @property foo Foo.
|
|
147
|
-
*/
|
|
148
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"property":"always"}}]
|
|
149
|
-
// Message: There must be a hyphen before @property description.
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @template TempA, TempB A desc.
|
|
153
|
-
*/
|
|
154
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"template":"always"}}]
|
|
155
|
-
// Message: There must be a hyphen before @template description.
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @typedef {SomeType} ATypeDefName
|
|
159
|
-
* @property foo - Foo.
|
|
160
|
-
*/
|
|
161
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never",{"tags":{"property":"never"}}]
|
|
162
|
-
// Message: There must be no hyphen before @property description.
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @param foo Foo.
|
|
166
|
-
* @returns {SomeType} - A description.
|
|
167
|
-
*/
|
|
168
|
-
function quux () {
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"returns":"never"}}]
|
|
172
|
-
// Message: There must be a hyphen before @param description.
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Split a unit to metric prefix and basic unit.
|
|
176
|
-
*
|
|
177
|
-
* @param {string} unit - Unit to split.
|
|
178
|
-
* @param {string} [basicUnit] - Basic unit regardless of the metric prefix.
|
|
179
|
-
* If omitted, basic unit will be inferred by trying to remove the metric
|
|
180
|
-
* prefix in `unit`.
|
|
181
|
-
*
|
|
182
|
-
* @returns {{ prefix: string, basicUnit: string }} - Split result.
|
|
183
|
-
* If `unit` does not have a metric prefix, `''` is returned for `prefix`.
|
|
184
|
-
* If `unit` does not have a basic unit, `''` is returned for `basicUnit`.
|
|
185
|
-
*/
|
|
186
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"*":"never","property":"always"}}]
|
|
187
|
-
// Message: There must be no hyphen before @returns description.
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @returns {{
|
|
191
|
-
* prefix: string, basicUnit: string
|
|
192
|
-
* }} - Split result.
|
|
193
|
-
*/
|
|
194
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"*":"never","property":"always"}}]
|
|
195
|
-
// Message: There must be no hyphen before @returns description.
|
|
196
|
-
````
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<a name="user-content-require-hyphen-before-param-description-passing-examples"></a>
|
|
201
|
-
<a name="require-hyphen-before-param-description-passing-examples"></a>
|
|
202
|
-
## Passing examples
|
|
203
|
-
|
|
204
|
-
The following patterns are not considered problems:
|
|
205
|
-
|
|
206
|
-
````js
|
|
207
|
-
/**
|
|
208
|
-
* @param foo - Foo.
|
|
209
|
-
*/
|
|
210
|
-
function quux () {
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always"]
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* @param foo - Foo.
|
|
217
|
-
*/
|
|
218
|
-
function quux () {
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always"]
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* @param foo - Foo.
|
|
225
|
-
* @returns {SomeType} A description.
|
|
226
|
-
*/
|
|
227
|
-
function quux () {
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"returns":"never"}}]
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @param foo Foo.
|
|
234
|
-
*/
|
|
235
|
-
function quux () {
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never"]
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @param foo
|
|
242
|
-
*/
|
|
243
|
-
function quux () {
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
*/
|
|
250
|
-
function quux () {
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"*":"always"}}]
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* @typedef {SomeType} ATypeDefName
|
|
257
|
-
* @property foo - Foo.
|
|
258
|
-
*/
|
|
259
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"property":"always"}}]
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @typedef {SomeType} ATypeDefName
|
|
263
|
-
* @property foo Foo.
|
|
264
|
-
*/
|
|
265
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never",{"tags":{"property":"never"}}]
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* @typedef {SomeType} ATypeDefName
|
|
269
|
-
* @property foo - Foo.
|
|
270
|
-
*/
|
|
271
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never",{"tags":{"*":"always"}}]
|
|
272
|
-
|
|
273
|
-
/** Entry point for module.
|
|
274
|
-
*
|
|
275
|
-
* @param {!Array<string>} argv Command-line arguments.
|
|
276
|
-
*/
|
|
277
|
-
function main(argv) {
|
|
278
|
-
};
|
|
279
|
-
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never"]
|
|
280
|
-
````
|
|
281
|
-
|