Skip to content

Commit 7209fe0

Browse files
committed
fix(require-yields-check): remove exemptedBy option
BREAKING CHANGE: Removes `exemptedBy` from `require-yields-check`. Should not be needed. Also: - docs: create options dynamically from schemas
1 parent 1cf93b5 commit 7209fe0

File tree

163 files changed

+5747
-3054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+5747
-3054
lines changed

.README/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,10 @@ non-default-recommended fixer).
380380
|||[check-examples](./docs/rules/check-examples.md#readme)|Linting of JavaScript within `@example`|
381381
|||[check-indentation](./docs/rules/check-indentation.md#readme)|Checks for invalid padding inside JSDoc blocks|
382382
||:wrench:|[check-line-alignment](./docs/rules/check-line-alignment.md#readme)|Reports invalid alignment of JSDoc block lines.|
383-
|:heavy_check_mark:|:wrench:|[check-param-names](./docs/rules/check-param-names.md#readme)|Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match jsdoc param names.|
383+
|:heavy_check_mark:|:wrench:|[check-param-names](./docs/rules/check-param-names.md#readme)|Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.|
384384
|:heavy_check_mark:|:wrench:|[check-property-names](./docs/rules/check-property-names.md#readme)|Checks for dupe `@property` names, that nested property names have roots|
385385
|||[check-syntax](./docs/rules/check-syntax.md#readme)|Reports use against current mode (currently only prohibits Closure-specific syntax)|
386-
|:heavy_check_mark:|:wrench:|[check-tag-names](./docs/rules/check-tag-names.md#readme)|Reports invalid jsdoc (block) tag names|
386+
|:heavy_check_mark:|:wrench:|[check-tag-names](./docs/rules/check-tag-names.md#readme)|Reports invalid JSDoc (block) tag names|
387387
| || [check-template-names](./docs/rules/check-template-names.md#readme)|Checks that any `@template` names are actually used in the connected `@typedef` or type alias.
388388
|:heavy_check_mark:|:wrench:|[check-types](./docs/rules/check-types.md#readme)|Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements)|
389389
|:heavy_check_mark:||[check-values](./docs/rules/check-values.md#readme)|Checks for expected content within some miscellaneous tags (`@version`, `@since`, `@license`, `@author`)|
@@ -394,8 +394,8 @@ non-default-recommended fixer).
394394
|||[lines-before-block](./docs/rules/lines-before-block.md#readme)|Enforces minimum number of newlines before JSDoc comment blocks|
395395
|||[match-description](./docs/rules/match-description.md#readme)|Defines customizable regular expression rules for your tag descriptions|
396396
||:wrench:|[match-name](./docs/rules/match-name.md#readme)|Reports the name portion of a JSDoc tag if matching or not matching a given regular expression|
397-
|:heavy_check_mark:|:wrench:|[multiline-blocks](./docs/rules/multiline-blocks.md#readme)|Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks|
398-
||:wrench:|[no-bad-blocks](./docs/rules/no-bad-blocks.md#readme)|This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block|
397+
|:heavy_check_mark:|:wrench:|[multiline-blocks](./docs/rules/multiline-blocks.md#readme)|Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks|
398+
||:wrench:|[no-bad-blocks](./docs/rules/no-bad-blocks.md#readme)|This rule checks for multi-line-style comments which fail to meet the criteria of a JSDoc block|
399399
||:wrench:|[no-blank-block-descriptions](./docs/rules/no-blank-block-descriptions.md#readme)|If tags are present, this rule will prevent empty lines in the block description. If no tags are present, this rule will prevent extra empty lines in the block description.|
400400
||:wrench:|[no-blank-blocks](./docs/rules/no-blank-blocks.md#readme)|Reports and optionally removes blocks with whitespace only|
401401
|:heavy_check_mark:|:wrench:|[no-defaults](./docs/rules/no-defaults.md#readme)|This rule reports defaults being used on the relevant portion of `@param` or `@default`|
@@ -412,7 +412,7 @@ non-default-recommended fixer).
412412
||:wrench:|[require-example](./docs/rules/require-example.md#readme)|Requires that all functions (and potentially other contexts) have examples.|
413413
|||[require-file-overview](./docs/rules/require-file-overview.md#readme)|By default, requires a single `@file` tag at the beginning of each linted file|
414414
||:wrench:|[require-hyphen-before-param-description](./docs/rules/require-hyphen-before-param-description.md#readme)|Requires a hyphen before `@param` descriptions (and optionally before `@property` descriptions)|
415-
|:heavy_check_mark:|:wrench:|[require-jsdoc](./docs/rules/require-jsdoc.md#readme)|Checks for presence of jsdoc comments, on functions and potentially other contexts (optionally limited to exports).|
415+
|:heavy_check_mark:|:wrench:|[require-jsdoc](./docs/rules/require-jsdoc.md#readme)|Checks for presence of JSDoc comments, on functions and potentially other contexts (optionally limited to exports).|
416416
|:heavy_check_mark:||[require-next-type](./docs/rules/require-next-type.md#readme)|Requires a type on the (non-standard) `@next` tag.|
417417
|:heavy_check_mark:|:wrench:|[require-param](./docs/rules/require-param.md#readme)|Requires that all function parameters are documented with a `@param` tag.|
418418
|:heavy_check_mark:||[require-param-description](./docs/rules/require-param-description.md#readme)|Requires that each `@param` tag has a `description` value.|
@@ -423,7 +423,7 @@ non-default-recommended fixer).
423423
|:heavy_check_mark:||[require-property-name](./docs/rules/require-property-name.md#readme)|Requires that all `@property` tags have names.|
424424
|:heavy_check_mark: (off in TS)||[require-property-type](./docs/rules/require-property-type.md#readme)|Requires that each `@property` tag has a type value (within curly brackets).|
425425
|:heavy_check_mark:||[require-returns](./docs/rules/require-returns.md#readme)|Requires that return statements are documented.|
426-
|:heavy_check_mark:||[require-returns-check](./docs/rules/require-returns-check.md#readme)|Requires a return statement be present in a function body if a `@returns` tag is specified in the jsdoc comment block (and reports if multiple `@returns` tags are present).|
426+
|:heavy_check_mark:||[require-returns-check](./docs/rules/require-returns-check.md#readme)|Requires a return statement be present in a function body if a `@returns` tag is specified in the JSDoc comment block (and reports if multiple `@returns` tags are present).|
427427
|:heavy_check_mark:||[require-returns-description](./docs/rules/require-returns-description.md#readme)|Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).|
428428
|:heavy_check_mark: (off in TS)||[require-returns-type](./docs/rules/require-returns-type.md#readme)|Requires that `@returns` tag has a type value (in curly brackets).|
429429
| || [require-template](./docs/rules/require-template.md#readme) | Requires `@template` tags be present when type parameters are used.|

.README/rules/check-alignment.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ Fixes alignment.
1010

1111
## Options
1212

13-
### `innerIndent`
14-
15-
Set to 0 if you wish to avoid the normal requirement for an inner indentation of
16-
one space. Defaults to 1 (one space of normal inner indentation).
13+
{"gitdown": "options"}
1714

1815
## Context and settings
1916

.README/rules/check-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ by decreasing precedence:
151151
* `padded-blocks` (and `@stylistic/padded-blocks`) - It can generally look
152152
nicer to pad a little even if one's code follows more stringency as far
153153
as block padding.
154-
* `jsdoc/require-file-overview` - Shouldn't check example for jsdoc blocks.
155-
* `jsdoc/require-jsdoc` - Wouldn't expect jsdoc blocks within jsdoc blocks.
154+
* `jsdoc/require-file-overview` - Shouldn't check example for JSDoc blocks.
155+
* `jsdoc/require-jsdoc` - Wouldn't expect JSDoc blocks within JSDoc blocks.
156156
* `import/no-unresolved` - One wouldn't generally expect example paths to
157157
resolve relative to the current JavaScript file as one would with real code.
158158
* `import/unambiguous` - Snippets in examples are likely too short to always

.README/rules/check-indentation.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,7 @@ the following description is not reported:
2020

2121
## Options
2222

23-
This rule has an object option.
24-
25-
### `excludeTags`
26-
27-
Array of tags (e.g., `['example', 'description']`) whose content will be
28-
"hidden" from the `check-indentation` rule. Defaults to `['example']`.
29-
30-
By default, the whole JSDoc block will be checked for invalid padding.
31-
That would include `@example` blocks too, which can get in the way
32-
of adding full, readable examples of code without ending up with multiple
33-
linting issues.
34-
35-
When disabled (by passing `excludeTags: []` option), the following code *will*
36-
report a padding issue:
37-
38-
```js
39-
/**
40-
* @example
41-
* anArray.filter((a) => {
42-
* return a.b;
43-
* });
44-
*/
45-
```
23+
{"gitdown": "options"}
4624

4725
## Context and settings
4826

.README/rules/check-line-alignment.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,12 @@ for example.
88

99
## Fixer
1010

11-
(TODO)
11+
Will either add alignment between the tag, type, name, and description across
12+
lines of the JSDoc block or remove it.
1213

1314
## Options
1415

15-
This rule allows one optional string argument. If it is `"always"` then a
16-
problem is raised when the lines are not aligned. If it is `"never"` then
17-
a problem should be raised when there is more than one space between each
18-
line's parts. If it is `"any"`, no alignment is made. Defaults to `"never"`.
19-
20-
Note that in addition to alignment, the "never" and "always" options will both
21-
ensure that at least one space is present after the asterisk delimiter.
22-
23-
After the string, an options object is allowed with the following properties.
24-
25-
### `tags`
26-
27-
Use this to change the tags which are sought for alignment changes. Defaults to an array of
28-
`['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template']`.
29-
30-
### `customSpacings`
31-
32-
An object with any of the following keys set to an integer. Affects spacing:
33-
34-
- `postDelimiter` - after the asterisk (e.g., `* @param`)
35-
- `postTag` - after the tag (e.g., `* @param `)
36-
- `postType` - after the type (e.g., `* @param {someType} `)
37-
- `postName` - after the name (e.g., `* @param {someType} name `)
38-
- `postHyphen` - after any hyphens in the description (e.g., `* @param {someType} name - A description`)
39-
40-
If a spacing is not defined, it defaults to one.
41-
42-
### `preserveMainDescriptionPostDelimiter`
43-
44-
A boolean to determine whether to preserve the post-delimiter spacing of the
45-
main description. If `false` or unset, will be set to a single space.
46-
47-
### `wrapIndent`
48-
49-
The indent that will be applied for tag text after the first line.
50-
Default to the empty string (no indent).
51-
52-
### `disableWrapIndent`
53-
54-
Disables `wrapIndent`; existing wrap indentation is preserved without changes.
16+
{"gitdown": "options"}
5517

5618
## Context and settings
5719

.README/rules/check-param-names.md

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ the function declaration.
77

88
## Fixer
99

10-
(Todo)
10+
Auto-removes `@param` duplicates (based on identical names).
11+
12+
Note that this option will remove duplicates of the same name even if
13+
the definitions do not match in other ways (e.g., the second param will
14+
be removed even if it has a different type or description).
1115

1216
## Destructuring
1317

@@ -28,62 +32,15 @@ To require that `extra` be documented--and that any extraneous properties
2832
get reported--e.g., if there had been a `@param options.bar` above--you
2933
can use the `checkRestProperty` option which insists that the rest
3034
property be documented (and that there be no other implicit properties).
31-
Note, however, that jsdoc [does not appear](https://github.com/jsdoc/jsdoc/issues/1773)
35+
Note, however, that JSDoc [does not appear](https://github.com/jsdoc/jsdoc/issues/1773)
3236
to currently support syntax or output to distinguish rest properties from
3337
other properties, so in looking at the docs alone without looking at the
3438
function signature, the disadvantage of enabling this option is that it
3539
may appear that there is an actual property named `extra`.
3640

3741
## Options
3842

39-
### `checkRestProperty`
40-
41-
See the "Destructuring" section. Defaults to `false`.
42-
43-
### `checkTypesPattern`
44-
45-
See `require-param` under the option of the same name.
46-
47-
### `enableFixer`
48-
49-
Set to `true` to auto-remove `@param` duplicates (based on identical
50-
names).
51-
52-
Note that this option will remove duplicates of the same name even if
53-
the definitions do not match in other ways (e.g., the second param will
54-
be removed even if it has a different type or description).
55-
56-
### `allowExtraTrailingParamDocs`
57-
58-
If set to `true`, this option will allow extra `@param` definitions (e.g.,
59-
representing future expected or virtual params) to be present without needing
60-
their presence within the function signature. Other inconsistencies between
61-
`@param`'s and present function parameters will still be reported.
62-
63-
### `checkDestructured`
64-
65-
Whether to check destructured properties. Defaults to `true`.
66-
67-
### `useDefaultObjectProperties`
68-
69-
Set to `true` if you wish to avoid reporting of child property documentation
70-
where instead of destructuring, a whole plain object is supplied as default
71-
value but you wish its keys to be considered as signalling that the properties
72-
are present and can therefore be documented. Defaults to `false`.
73-
74-
### `disableExtraPropertyReporting`
75-
76-
Whether to check for extra destructured properties. Defaults to `false`. Change
77-
to `true` if you want to be able to document properties which are not actually
78-
destructured. Keep as `false` if you expect properties to be documented in
79-
their own types. Note that extra properties will always be reported if another
80-
item at the same level is destructured as destructuring will prevent other
81-
access and this option is only intended to permit documenting extra properties
82-
that are available and actually used in the function.
83-
84-
### `disableMissingParamChecks`
85-
86-
Whether to avoid checks for missing `@param` definitions. Defaults to `false`. Change to `true` if you want to be able to omit properties.
43+
{"gitdown": "options"}
8744

8845
## Context and settings
8946

.README/rules/check-property-names.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ and that nested properties have defined roots.
77

88
## Fixer
99

10-
(Todo)
11-
12-
## Options
13-
14-
### `enableFixer`
15-
16-
Set to `true` to auto-remove `@property` duplicates (based on
17-
identical names).
10+
Auto-removes `@property` duplicates (based on identical names).
1811

1912
Note that this option will remove duplicates of the same name even if
2013
the definitions do not match in other ways (e.g., the second property will
2114
be removed even if it has a different type or description).
2215

16+
## Options
17+
18+
{"gitdown": "options"}
19+
2320
## Context and settings
2421

2522
|||

.README/rules/check-tag-names.md

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ template
134134

135135
And for [Closure](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler),
136136
when `settings.jsdoc.mode` is set to `closure`, one may use the following (in
137-
addition to the jsdoc and TypeScript tags–though replacing `returns` with
137+
addition to the JSDoc and TypeScript tags–though replacing `returns` with
138138
`return`):
139139

140140
```
@@ -194,92 +194,11 @@ tag to `false`:
194194

195195
## Fixer
196196

197-
(Todo)
197+
Auto-removes types that are redundant with the [`typed` option](#typed).
198198

199199
## Options
200200

201-
### `definedTags`
202-
203-
Use an array of `definedTags` strings to configure additional, allowed tags.
204-
The format is as follows:
205-
206-
```json
207-
{
208-
"definedTags": ["note", "record"]
209-
}
210-
```
211-
212-
### `enableFixer`
213-
214-
Set to `false` to disable auto-removal of types that are redundant with the [`typed` option](#typed).
215-
216-
### `jsxTags`
217-
218-
If this is set to `true`, all of the following tags used to control JSX output are allowed:
219-
220-
```
221-
jsx
222-
jsxFrag
223-
jsxImportSource
224-
jsxRuntime
225-
```
226-
227-
For more information, see the [babel documentation](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx).
228-
229-
### `typed`
230-
231-
If this is set to `true`, additionally checks for tag names that are redundant when using a type checker such as TypeScript.
232-
233-
These tags are always unnecessary when using TypeScript or similar:
234-
235-
```
236-
augments
237-
callback
238-
class
239-
enum
240-
implements
241-
private
242-
property
243-
protected
244-
public
245-
readonly
246-
this
247-
type
248-
typedef
249-
```
250-
251-
These tags are unnecessary except when inside a TypeScript `declare` context:
252-
253-
```
254-
abstract
255-
access
256-
class
257-
constant
258-
constructs
259-
default
260-
enum
261-
export
262-
exports
263-
function
264-
global
265-
inherits
266-
instance
267-
interface
268-
member
269-
memberof
270-
memberOf
271-
method
272-
mixes
273-
mixin
274-
module
275-
name
276-
namespace
277-
override
278-
property
279-
requires
280-
static
281-
this
282-
```
201+
{"gitdown": "options"}
283202

284203
## Context and settings
285204

0 commit comments

Comments
 (0)