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.
Files changed (66) hide show
  1. package/README.md +31 -0
  2. package/dist/alignTransform.js +5 -5
  3. package/dist/alignTransform.js.map +1 -1
  4. package/dist/index.js +21 -10
  5. package/dist/index.js.map +1 -1
  6. package/dist/iterateJsdoc.js +1 -1
  7. package/dist/iterateJsdoc.js.map +1 -1
  8. package/dist/rules/checkExamples.js +12 -6
  9. package/dist/rules/checkExamples.js.map +1 -1
  10. package/package.json +19 -15
  11. package/docs/advanced.md +0 -102
  12. package/docs/rules/check-access.md +0 -193
  13. package/docs/rules/check-alignment.md +0 -169
  14. package/docs/rules/check-examples.md +0 -784
  15. package/docs/rules/check-indentation.md +0 -296
  16. package/docs/rules/check-line-alignment.md +0 -1002
  17. package/docs/rules/check-param-names.md +0 -1035
  18. package/docs/rules/check-property-names.md +0 -244
  19. package/docs/rules/check-syntax.md +0 -80
  20. package/docs/rules/check-tag-names.md +0 -1132
  21. package/docs/rules/check-types.md +0 -1198
  22. package/docs/rules/check-values.md +0 -409
  23. package/docs/rules/empty-tags.md +0 -220
  24. package/docs/rules/implements-on-classes.md +0 -219
  25. package/docs/rules/imports-as-dependencies.md +0 -99
  26. package/docs/rules/informative-docs.md +0 -400
  27. package/docs/rules/match-description.md +0 -1008
  28. package/docs/rules/match-name.md +0 -249
  29. package/docs/rules/multiline-blocks.md +0 -398
  30. package/docs/rules/no-bad-blocks.md +0 -174
  31. package/docs/rules/no-blank-block-descriptions.md +0 -91
  32. package/docs/rules/no-blank-blocks.md +0 -98
  33. package/docs/rules/no-defaults.md +0 -207
  34. package/docs/rules/no-missing-syntax.md +0 -275
  35. package/docs/rules/no-multi-asterisks.md +0 -278
  36. package/docs/rules/no-restricted-syntax.md +0 -383
  37. package/docs/rules/no-types.md +0 -168
  38. package/docs/rules/no-undefined-types.md +0 -789
  39. package/docs/rules/require-asterisk-prefix.md +0 -297
  40. package/docs/rules/require-description-complete-sentence.md +0 -820
  41. package/docs/rules/require-description.md +0 -585
  42. package/docs/rules/require-example.md +0 -390
  43. package/docs/rules/require-file-overview.md +0 -324
  44. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  45. package/docs/rules/require-jsdoc.md +0 -1857
  46. package/docs/rules/require-param-description.md +0 -238
  47. package/docs/rules/require-param-name.md +0 -163
  48. package/docs/rules/require-param-type.md +0 -227
  49. package/docs/rules/require-param.md +0 -1820
  50. package/docs/rules/require-property-description.md +0 -88
  51. package/docs/rules/require-property-name.md +0 -79
  52. package/docs/rules/require-property-type.md +0 -79
  53. package/docs/rules/require-property.md +0 -128
  54. package/docs/rules/require-returns-check.md +0 -1053
  55. package/docs/rules/require-returns-description.md +0 -181
  56. package/docs/rules/require-returns-type.md +0 -144
  57. package/docs/rules/require-returns.md +0 -1191
  58. package/docs/rules/require-throws.md +0 -326
  59. package/docs/rules/require-yields-check.md +0 -544
  60. package/docs/rules/require-yields.md +0 -823
  61. package/docs/rules/sort-tags.md +0 -635
  62. package/docs/rules/tag-lines.md +0 -551
  63. package/docs/rules/text-escaping.md +0 -177
  64. package/docs/rules/valid-types.md +0 -881
  65. package/docs/settings.md +0 -362
  66. package/tsconfig.json +0 -22
@@ -1,174 +0,0 @@
1
- <a name="user-content-no-bad-blocks"></a>
2
- <a name="no-bad-blocks"></a>
3
- ### <code>no-bad-blocks</code>
4
-
5
-
6
-
7
- This rule checks for multi-line-style comments which fail to meet the
8
- criteria of a jsdoc block, namely that it should begin with two and only two
9
- asterisks, but which appear to be intended as jsdoc blocks due to the presence
10
- of whitespace followed by whitespace or asterisks, and
11
- an at-sign (`@`) and some non-whitespace (as with a jsdoc block tag).
12
-
13
- <a name="user-content-fixer"></a>
14
- <a name="fixer"></a>
15
- ## Fixer
16
-
17
- (TODO)
18
-
19
- <a name="user-content-options"></a>
20
- <a name="options"></a>
21
- ## Options
22
-
23
- Takes an optional options object with the following.
24
-
25
- <a name="user-content-options-ignore"></a>
26
- <a name="options-ignore"></a>
27
- ### <code>ignore</code>
28
-
29
- An array of directives that will not be reported if present at the beginning of
30
- a multi-comment block and at-sign `/* @`.
31
-
32
- Defaults to `['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck']`
33
- (some directives [used by TypeScript](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check)).
34
-
35
- <a name="user-content-options-preventallmultiasteriskblocks"></a>
36
- <a name="options-preventallmultiasteriskblocks"></a>
37
- ### <code>preventAllMultiAsteriskBlocks</code>
38
-
39
- A boolean (defaulting to `false`) which if `true` will prevent all
40
- JSDoc-like blocks with more than two initial asterisks even those without
41
- apparent tag content.
42
-
43
- <a name="user-content-context-and-settings"></a>
44
- <a name="context-and-settings"></a>
45
- ## Context and settings
46
-
47
- |||
48
- |---|---|
49
- |Context|Everywhere|
50
- |Tags|N/A|
51
- |Recommended|false|
52
- |Options|`ignore`, `preventAllMultiAsteriskBlocks`|
53
-
54
- <a name="user-content-failing-examples"></a>
55
- <a name="failing-examples"></a>
56
- ## Failing examples
57
-
58
- The following patterns are considered problems:
59
-
60
- ````js
61
- /*
62
- * @param foo
63
- */
64
- function quux (foo) {
65
-
66
- }
67
- // Message: Expected JSDoc-like comment to begin with two asterisks.
68
-
69
- /*
70
- * @property foo
71
- */
72
- // Message: Expected JSDoc-like comment to begin with two asterisks.
73
-
74
- function quux() {
75
-
76
- }
77
- // Settings: {"jsdoc":{"structuredTags":{"see":{"name":false,"required":["name"]}}}}
78
- // Message: Cannot add "name" to `require` with the tag's `name` set to `false`
79
-
80
- /* @ts-ignore */
81
- // "jsdoc/no-bad-blocks": ["error"|"warn", {"ignore":[]}]
82
- // Message: Expected JSDoc-like comment to begin with two asterisks.
83
-
84
- /*
85
- * Some description.
86
- *
87
- * @returns {string} Some string
88
- */
89
- function echo() {
90
- return 'Something';
91
- }
92
- // Message: Expected JSDoc-like comment to begin with two asterisks.
93
-
94
- /***
95
- * @param foo
96
- */
97
- function quux (foo) {
98
-
99
- }
100
- // Message: Expected JSDoc-like comment to begin with two asterisks.
101
-
102
- /***
103
- *
104
- */
105
- function quux (foo) {
106
-
107
- }
108
- // "jsdoc/no-bad-blocks": ["error"|"warn", {"preventAllMultiAsteriskBlocks":true}]
109
- // Message: Expected JSDoc-like comment to begin with two asterisks.
110
- ````
111
-
112
-
113
-
114
- <a name="user-content-passing-examples"></a>
115
- <a name="passing-examples"></a>
116
- ## Passing examples
117
-
118
- The following patterns are not considered problems:
119
-
120
- ````js
121
- /**
122
- * @property foo
123
- */
124
-
125
- /**
126
- * @param foo
127
- */
128
- function quux () {
129
-
130
- }
131
-
132
- function quux () {
133
-
134
- }
135
-
136
- /* This could just be intended as a regular multiline comment,
137
- so don't report this */
138
- function quux () {
139
-
140
- }
141
-
142
- /* Just a regular multiline comment with an `@` but not appearing
143
- like a tag in a jsdoc-block, so don't report */
144
- function quux () {
145
-
146
- }
147
-
148
- /* @ts-check */
149
-
150
- /* @ts-expect-error */
151
-
152
- /* @ts-ignore */
153
-
154
- /* @ts-nocheck */
155
-
156
- /* */
157
-
158
- /** */
159
-
160
- /* @custom */
161
- // "jsdoc/no-bad-blocks": ["error"|"warn", {"ignore":["custom"]}]
162
-
163
- /***
164
- * This is not JSDoc because of the 3 asterisks, but
165
- * is allowed without `preventAllMultiAsteriskBlocks`, as
166
- * some might wish normal multiline comments.
167
- */
168
- function quux (foo) {
169
-
170
- }
171
-
172
- /***/
173
- ````
174
-
@@ -1,91 +0,0 @@
1
- <a name="user-content-no-blank-block-descriptions"></a>
2
- <a name="no-blank-block-descriptions"></a>
3
- ### <code>no-blank-block-descriptions</code>
4
-
5
-
6
-
7
- If tags are present, this rule will prevent empty lines in the
8
- block description.
9
-
10
- If no tags are present, this rule will prevent extra empty lines
11
- in the block description.
12
-
13
- <a name="user-content-fixer"></a>
14
- <a name="fixer"></a>
15
- ## Fixer
16
-
17
- (TODO)
18
-
19
- <a name="user-content-context-and-settings"></a>
20
- <a name="context-and-settings"></a>
21
- ## Context and settings
22
-
23
- |||
24
- |---|---|
25
- |Context|everywhere|
26
- |Tags|(Block description)|
27
- |Recommended|false|
28
- |Settings||
29
- |Options||
30
-
31
- <a name="user-content-failing-examples"></a>
32
- <a name="failing-examples"></a>
33
- ## Failing examples
34
-
35
- The following patterns are considered problems:
36
-
37
- ````js
38
- /**
39
- *
40
- * @param {number} x
41
- */
42
- function functionWithClearName(x) {}
43
- // Message: There should be no blank lines in block descriptions followed by tags.
44
-
45
- /**
46
- *
47
- *
48
- */
49
- function functionWithClearName() {}
50
- // Message: There should be no extra blank lines in block descriptions not followed by tags.
51
- ````
52
-
53
-
54
-
55
- <a name="user-content-passing-examples"></a>
56
- <a name="passing-examples"></a>
57
- ## Passing examples
58
-
59
- The following patterns are not considered problems:
60
-
61
- ````js
62
- /**
63
- * Non-empty description
64
- * @param {number} x
65
- */
66
- function functionWithClearName(x) {}
67
-
68
- /**
69
- * @param {number} x
70
- */
71
- function functionWithClearName(x) {}
72
-
73
- /**
74
- *
75
- */
76
- function functionWithClearName() {}
77
-
78
- /**
79
- */
80
- function functionWithClearName() {}
81
-
82
- /** */
83
- function functionWithClearName() {}
84
-
85
- /** Some desc. */
86
- function functionWithClearName() {}
87
-
88
- /** @someTag */
89
- function functionWithClearName() {}
90
- ````
91
-
@@ -1,98 +0,0 @@
1
- <a name="user-content-no-blank-blocks"></a>
2
- <a name="no-blank-blocks"></a>
3
- # <code>no-blank-blocks</code>
4
-
5
- * [Fixer](#user-content-no-blank-blocks-fixer)
6
- * [Failing examples](#user-content-no-blank-blocks-failing-examples)
7
- * [Passing examples](#user-content-no-blank-blocks-passing-examples)
8
-
9
-
10
- Reports and optionally removes blocks with whitespace only.
11
-
12
- <a name="user-content-no-blank-blocks-fixer"></a>
13
- <a name="no-blank-blocks-fixer"></a>
14
- ## Fixer
15
-
16
- (TODO)
17
-
18
- <a name="user-content-no-blank-blocks-fixer-options"></a>
19
- <a name="no-blank-blocks-fixer-options"></a>
20
- #### Options
21
-
22
- <a name="user-content-no-blank-blocks-fixer-options-enablefixer"></a>
23
- <a name="no-blank-blocks-fixer-options-enablefixer"></a>
24
- ##### <code>enableFixer</code>
25
-
26
- Whether or not to auto-remove the blank block. Defaults to `false`.
27
-
28
- |||
29
- |---|---|
30
- |Context|everywhere|
31
- |Tags|N/A|
32
- |Recommended|false|
33
- |Settings||
34
- |Options|`enableFixer`|
35
-
36
- <a name="user-content-no-blank-blocks-failing-examples"></a>
37
- <a name="no-blank-blocks-failing-examples"></a>
38
- ## Failing examples
39
-
40
- The following patterns are considered problems:
41
-
42
- ````js
43
- /** */
44
- // "jsdoc/no-blank-blocks": ["error"|"warn", {"enableFixer":true}]
45
- // Message: No empty blocks
46
-
47
- /**
48
- */
49
- // "jsdoc/no-blank-blocks": ["error"|"warn", {"enableFixer":true}]
50
- // Message: No empty blocks
51
-
52
- /**
53
- *
54
- */
55
- // "jsdoc/no-blank-blocks": ["error"|"warn", {"enableFixer":true}]
56
- // Message: No empty blocks
57
-
58
- /**
59
- *
60
- *
61
- */
62
- // "jsdoc/no-blank-blocks": ["error"|"warn", {"enableFixer":true}]
63
- // Message: No empty blocks
64
-
65
- /**
66
- *
67
- *
68
- */
69
- // "jsdoc/no-blank-blocks": ["error"|"warn", {"enableFixer":false}]
70
- // Message: No empty blocks
71
-
72
- /**
73
- *
74
- *
75
- */
76
- // Message: No empty blocks
77
- ````
78
-
79
-
80
-
81
- <a name="user-content-no-blank-blocks-passing-examples"></a>
82
- <a name="no-blank-blocks-passing-examples"></a>
83
- ## Passing examples
84
-
85
- The following patterns are not considered problems:
86
-
87
- ````js
88
- /** @tag */
89
-
90
- /**
91
- * Text
92
- */
93
-
94
- /**
95
- * @tag
96
- */
97
- ````
98
-
@@ -1,207 +0,0 @@
1
- <a name="user-content-no-defaults"></a>
2
- <a name="no-defaults"></a>
3
- # <code>no-defaults</code>
4
-
5
- * [Fixer](#user-content-no-defaults-fixer)
6
- * [Options](#user-content-no-defaults-options)
7
- * [`noOptionalParamNames`](#user-content-no-defaults-options-nooptionalparamnames)
8
- * [`contexts`](#user-content-no-defaults-options-contexts)
9
- * [Context and settings](#user-content-no-defaults-context-and-settings)
10
- * [Failing examples](#user-content-no-defaults-failing-examples)
11
- * [Passing examples](#user-content-no-defaults-passing-examples)
12
-
13
-
14
- This rule reports defaults being used on the relevant portion of `@param`
15
- or `@default`. It also optionally reports the presence of the
16
- square-bracketed optional arguments at all.
17
-
18
- The rule is intended to prevent the indication of defaults on tags where
19
- this would be redundant with ES6 default parameters (or for `@default`,
20
- where it would be redundant with the context to which the `@default`
21
- tag is attached).
22
-
23
- Unless your `@default` is on a function, you will need to set `contexts`
24
- to an appropriate context, including, if you wish, "any".
25
-
26
- <a name="user-content-no-defaults-fixer"></a>
27
- <a name="no-defaults-fixer"></a>
28
- ## Fixer
29
-
30
- (TODO)
31
-
32
- <a name="user-content-no-defaults-options"></a>
33
- <a name="no-defaults-options"></a>
34
- ## Options
35
-
36
- <a name="user-content-no-defaults-options-nooptionalparamnames"></a>
37
- <a name="no-defaults-options-nooptionalparamnames"></a>
38
- ### <code>noOptionalParamNames</code>
39
-
40
- Set this to `true` to report the presence of optional parameters. May be
41
- used if the project is insisting on optionality being indicated by
42
- the presence of ES6 default parameters (bearing in mind that such
43
- "defaults" are only applied when the supplied value is missing or
44
- `undefined` but not for `null` or other "falsey" values).
45
-
46
- <a name="user-content-no-defaults-options-contexts"></a>
47
- <a name="no-defaults-options-contexts"></a>
48
- ### <code>contexts</code>
49
-
50
- Set this to an array of strings representing the AST context (or an object with
51
- `context` and `comment` properties) where you wish the rule to be applied.
52
- Overrides the default contexts (see below). Set to `"any"` if you want
53
- the rule to apply to any jsdoc block throughout your files (as is necessary
54
- for finding function blocks not attached to a function declaration or
55
- expression, i.e., `@callback` or `@function` (or its aliases `@func` or
56
- `@method`) (including those associated with an `@interface`).
57
-
58
- See the ["AST and Selectors"](#user-content-eslint-plugin-jsdoc-advanced-ast-and-selectors)
59
- section of our README for more on the expected format.
60
-
61
- <a name="user-content-no-defaults-context-and-settings"></a>
62
- <a name="no-defaults-context-and-settings"></a>
63
- ## Context and settings
64
-
65
- |||
66
- |---|---|
67
- |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
68
- |Tags|`param`, `default`|
69
- |Aliases|`arg`, `argument`, `defaultvalue`|
70
- |Recommended|false|
71
- |Options|`contexts`, `noOptionalParamNames`|
72
-
73
- <a name="user-content-no-defaults-failing-examples"></a>
74
- <a name="no-defaults-failing-examples"></a>
75
- ## Failing examples
76
-
77
- The following patterns are considered problems:
78
-
79
- ````js
80
- /**
81
- * @param {number} [foo="7"]
82
- */
83
- function quux (foo) {
84
-
85
- }
86
- // Message: Defaults are not permitted on @param.
87
-
88
- class Test {
89
- /**
90
- * @param {number} [foo="7"]
91
- */
92
- quux (foo) {
93
-
94
- }
95
- }
96
- // Message: Defaults are not permitted on @param.
97
-
98
- /**
99
- * @param {number} [foo="7"]
100
- */
101
- function quux (foo) {
102
-
103
- }
104
- // "jsdoc/no-defaults": ["error"|"warn", {"noOptionalParamNames":true}]
105
- // Message: Optional param names are not permitted on @param.
106
-
107
- /**
108
- * @arg {number} [foo="7"]
109
- */
110
- function quux (foo) {
111
-
112
- }
113
- // Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
114
- // Message: Defaults are not permitted on @arg.
115
-
116
- /**
117
- * @param {number} [foo="7"]
118
- */
119
- function quux (foo) {
120
-
121
- }
122
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
123
- // Message: Defaults are not permitted on @param.
124
-
125
- /**
126
- * @function
127
- * @param {number} [foo="7"]
128
- */
129
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
130
- // Message: Defaults are not permitted on @param.
131
-
132
- /**
133
- * @callback
134
- * @param {number} [foo="7"]
135
- */
136
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
137
- // Message: Defaults are not permitted on @param.
138
-
139
- /**
140
- * @default {}
141
- */
142
- const a = {};
143
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
144
- // Message: Default values are not permitted on @default.
145
-
146
- /**
147
- * @defaultvalue {}
148
- */
149
- const a = {};
150
- // Settings: {"jsdoc":{"tagNamePreference":{"default":"defaultvalue"}}}
151
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
152
- // Message: Default values are not permitted on @defaultvalue.
153
- ````
154
-
155
-
156
-
157
- <a name="user-content-no-defaults-passing-examples"></a>
158
- <a name="no-defaults-passing-examples"></a>
159
- ## Passing examples
160
-
161
- The following patterns are not considered problems:
162
-
163
- ````js
164
- /**
165
- * @param foo
166
- */
167
- function quux (foo) {
168
-
169
- }
170
-
171
- /**
172
- * @param {number} foo
173
- */
174
- function quux (foo) {
175
-
176
- }
177
-
178
- /**
179
- * @param foo
180
- */
181
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
182
-
183
- /**
184
- * @function
185
- * @param {number} foo
186
- */
187
-
188
- /**
189
- * @callback
190
- * @param {number} foo
191
- */
192
-
193
- /**
194
- * @param {number} foo
195
- */
196
- function quux (foo) {
197
-
198
- }
199
- // "jsdoc/no-defaults": ["error"|"warn", {"noOptionalParamNames":true}]
200
-
201
- /**
202
- * @default
203
- */
204
- const a = {};
205
- // "jsdoc/no-defaults": ["error"|"warn", {"contexts":["any"]}]
206
- ````
207
-