Skip to content

Commit 3cff001

Browse files
authored
Merge pull request #311 from gajus/11.0.0
2 parents a367c48 + 854c8dd commit 3cff001

File tree

13 files changed

+239
-183
lines changed

13 files changed

+239
-183
lines changed

.README/README.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ Or one may set the targeted tag to an object with a custom `message`, but withou
199199
}
200200
```
201201

202+
Note that the preferred tags indicated in the `settings.jsdoc.tagNamePreference`
203+
map will be assumed to be defined by `check-tag-names`.
202204

203205
The defaults in `eslint-plugin-jsdoc` (for tags which offer
204206
aliases) are as follows:
@@ -236,24 +238,6 @@ This setting is utilized by the the rule for tag name checking
236238
- `require-returns-description`
237239
- `require-returns-type`
238240

239-
### Additional Tag Names
240-
241-
Use `settings.jsdoc.additionalTagNames` to configure additional, allowed JSDoc
242-
tags in the rule `check-tag-names`. The format of the configuration is as follows:
243-
244-
```json
245-
{
246-
"rules": {},
247-
"settings": {
248-
"jsdoc": {
249-
"additionalTagNames": {
250-
"customTags": ["define", "record"]
251-
}
252-
}
253-
}
254-
}
255-
```
256-
257241
### `@override`/`@augments`/`@extends`/`@implements` Without Accompanying `@param`/`@description`/`@example`/`@returns`
258242

259243
The following settings allows the element(s) they reference to be omitted
@@ -325,15 +309,12 @@ but restricted to `@param`. These settings are now deprecated.
325309
when encountering the discouraged type and, if a type is to be preferred
326310
in its place, the key `replacement` to indicate the type that should be
327311
used in its place (and which `fix` mode can replace) or `false` if
328-
forbidding the type. The message string will have the following
329-
substrings with special meaning replaced with their corresponding
330-
value (`{{tagName}}`, `{{tagValue}}`, `{{badType}}`, and
331-
`{{preferredType}}` (or `{{replacement}}`), noting that the latter is
332-
of no use when one is merely forbidding a type).
333-
334-
If `no-undefined-types` has the option key `preferredTypesDefined` set to
335-
`true`, the preferred types indicated in the `settings.jsdoc.preferredTypes`
336-
map will be assumed to be defined.
312+
forbidding the type. The message string will have the substrings with
313+
special meaning, `{{tagName}}` and `{{tagValue}}`, replaced with their
314+
corresponding value.
315+
316+
Note that the preferred types indicated as targets in `settings.jsdoc.preferredTypes`
317+
map will be assumed to be defined by `no-undefined-types`.
337318

338319
See the option of `check-types`, `unifyParentAndChildTypeChecks`, for
339320
how the keys of `preferredTypes` may have `<>` or `.<>` (or just `.`)

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,26 @@ version
7575
yields
7676
```
7777

78+
Note that the tags indicated as replacements in `settings.jsdoc.tagNamePreference` will automatically be considered as valid.
79+
80+
#### Options
81+
82+
##### `definedTags`
83+
84+
Use an array of `definedTags` strings to configure additional, allowed JSDoc tags.
85+
The format is as follows:
86+
87+
```json
88+
{
89+
"definedTags": ["define", "record"]
90+
}
91+
```
92+
7893
|||
7994
|---|---|
8095
|Context|everywhere|
8196
|Tags|N/A|
82-
|Settings|`tagNamePreference`, `additionalTagNames`|
97+
|Options|`definedTags`|
98+
|Settings|`tagNamePreference`|
8399

84100
<!-- assertions checkTagNames -->

.README/rules/no-undefined-types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ The following types are always considered defined.
2020
- `any`, `*`
2121
- `Array`, `Object`, `RegExp`, `Date`, `Function`
2222

23+
Note that preferred types indicated within `settings.jsdoc.preferredTypes` will
24+
also be assumed to be defined.
25+
2326
#### Options
2427

25-
An option object may have the following keys:
28+
An option object may have the following key:
2629

27-
- `preferredTypesDefined` - If this option is set to `true` and preferred
28-
types are indicated within `settings.jsdoc.preferredTypes`, any such
29-
types will be assumed to be defined as well. Defaults to `false`.
3030
- `definedTypes` - This array can be populated to indicate other types which
3131
are automatically considered as defined (in addition to globals, etc.).
3232
Defaults to an empty array.
@@ -37,7 +37,7 @@ An option object may have the following keys:
3737
|Tags|`class`, `constant`, `enum`, `implements`, `member`, `module`, `namespace`, `param`, `property`, `returns`, `throws`, `type`, `typedef`, `yields`|
3838
|Aliases|`constructor`, `const`, `var`, `arg`, `argument`, `prop`, `return`, `exception`, `yield`|
3939
|Closure-only|`package`, `private`, `protected`, `public`, `static`|
40-
|Options|`preferredTypesDefined`, `definedTypes`|
40+
|Options|`definedTypes`|
4141
|Settings|`preferredTypes`|
4242

4343
<!-- assertions noUndefinedTypes -->

0 commit comments

Comments
 (0)