eslint-plugin-jsdoc 36.0.7 → 37.0.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 +106 -31
- package/dist/iterateJsdoc.js +12 -8
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js +6 -2
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkExamples.js +11 -2
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkIndentation.js +1 -1
- package/dist/rules/checkIndentation.js.map +1 -1
- package/dist/rules/checkTypes.js +2 -1
- package/dist/rules/checkTypes.js.map +1 -1
- package/dist/rules/checkValues.js +1 -1
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js +2 -1
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
- package/dist/rules/requireJsdoc.js +2 -2
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/dist/tagNames.js +1 -1
- package/package.json +28 -25
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ JSDoc linting rules for ESLint.
|
|
|
18
18
|
* [`maxLines` and `minLines`](#eslint-plugin-jsdoc-settings-maxlines-and-minlines)
|
|
19
19
|
* [Mode](#eslint-plugin-jsdoc-settings-mode)
|
|
20
20
|
* [Alias Preference](#eslint-plugin-jsdoc-settings-alias-preference)
|
|
21
|
-
* [`@override`/`@augments`/`@extends`/`@implements` Without Accompanying `@param`/`@description`/`@example`/`@returns`](#eslint-plugin-jsdoc-settings-override-augments-extends-implements-without-accompanying-param-description-example-returns)
|
|
21
|
+
* [`@override`/`@augments`/`@extends`/`@implements`/`@ignore` Without Accompanying `@param`/`@description`/`@example`/`@returns`/`@throws`/`@yields`](#eslint-plugin-jsdoc-settings-override-augments-extends-implements-ignore-without-accompanying-param-description-example-returns-throws-yields)
|
|
22
22
|
* [Settings to Configure `check-types` and `no-undefined-types`](#eslint-plugin-jsdoc-settings-settings-to-configure-check-types-and-no-undefined-types)
|
|
23
23
|
* [`structuredTags`](#eslint-plugin-jsdoc-settings-structuredtags)
|
|
24
24
|
* [Advanced](#eslint-plugin-jsdoc-advanced)
|
|
@@ -250,10 +250,8 @@ how many line breaks to add when a block is missing.
|
|
|
250
250
|
types/namepaths (Closure allows types on some tags which the others do not,
|
|
251
251
|
so these tags will additionally be checked in "closure" mode)
|
|
252
252
|
- For type-checking rules, impacts parsing of types (through
|
|
253
|
-
[
|
|
254
|
-
dependency)
|
|
255
|
-
[not yet](https://github.com/gajus/eslint-plugin-jsdoc/issues/145)
|
|
256
|
-
[supported](https://github.com/jsdoctypeparser/jsdoctypeparser/issues/50)
|
|
253
|
+
[jsdoc-type-pratt-parser](https://github.com/simonseyock/jsdoc-type-pratt-parser)
|
|
254
|
+
dependency)
|
|
257
255
|
- Check preferred tag names
|
|
258
256
|
- Disallows namepath on `@interface` for "closure" mode in `valid-types` (and
|
|
259
257
|
avoids checking in other rules)
|
|
@@ -389,14 +387,15 @@ This setting is utilized by the the rule for tag name checking
|
|
|
389
387
|
- `require-returns-description`
|
|
390
388
|
- `require-returns-type`
|
|
391
389
|
|
|
392
|
-
<a name="eslint-plugin-jsdoc-settings-override-augments-extends-implements-without-accompanying-param-description-example-returns"></a>
|
|
393
|
-
### <code>@override</code>/<code>@augments</code>/<code>@extends</code>/<code>@implements</code> Without Accompanying <code>@param</code>/<code>@description</code>/<code>@example</code>/<code>@returns</code>
|
|
390
|
+
<a name="eslint-plugin-jsdoc-settings-override-augments-extends-implements-ignore-without-accompanying-param-description-example-returns-throws-yields"></a>
|
|
391
|
+
### <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>
|
|
394
392
|
|
|
395
393
|
The following settings allows the element(s) they reference to be omitted
|
|
396
394
|
on the JSDoc comment block of the function or that of its parent class
|
|
397
395
|
for any of the "require" rules (i.e., `require-param`, `require-description`,
|
|
398
|
-
`require-example`,
|
|
396
|
+
`require-example`, `require-returns`, `require-throws`, `require-yields`).
|
|
399
397
|
|
|
398
|
+
* `settings.jsdoc.ignoreReplacesDocs` (`@ignore`) - Defaults to `true`
|
|
400
399
|
* `settings.jsdoc.overrideReplacesDocs` (`@override`) - Defaults to `true`
|
|
401
400
|
* `settings.jsdoc.augmentsExtendsReplacesDocs` (`@augments` or its alias
|
|
402
401
|
`@extends`) - Defaults to `false`.
|
|
@@ -409,6 +408,7 @@ The format of the configuration is as follows:
|
|
|
409
408
|
"rules": {},
|
|
410
409
|
"settings": {
|
|
411
410
|
"jsdoc": {
|
|
411
|
+
"ignoreReplacesDocs": true,
|
|
412
412
|
"overrideReplacesDocs": true,
|
|
413
413
|
"augmentsExtendsReplacesDocs": true,
|
|
414
414
|
"implementsReplacesDocs": true
|
|
@@ -577,7 +577,7 @@ properties:
|
|
|
577
577
|
declaration of the function expression for
|
|
578
578
|
`const quux = function () {}`, the associated comment would,
|
|
579
579
|
in both cases, generally be expected to be on the line above both, rather
|
|
580
|
-
than to be immediately preceding the
|
|
580
|
+
than to be immediately preceding the function (in the case of the
|
|
581
581
|
function). See [@es-joy/jsdoccomment](https://github.com/es-joy/jsdoccomment)
|
|
582
582
|
for the precise structure of the comment (and comment type) nodes.
|
|
583
583
|
|
|
@@ -945,6 +945,9 @@ function quux (foo) {
|
|
|
945
945
|
<a name="eslint-plugin-jsdoc-rules-check-examples"></a>
|
|
946
946
|
### <code>check-examples</code>
|
|
947
947
|
|
|
948
|
+
> **NOTE**: This rule currently does not work in ESLint 8 (we are waiting for
|
|
949
|
+
> [issue 14745](https://github.com/eslint/eslint/issues/14745)).
|
|
950
|
+
|
|
948
951
|
Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules. Also
|
|
949
952
|
has options to lint the default values of optional `@param`/`@arg`/`@argument`
|
|
950
953
|
and `@property`/`@prop` tags or the values of `@default`/`@defaultvalue` tags.
|
|
@@ -1932,6 +1935,20 @@ function quux () {
|
|
|
1932
1935
|
* ```
|
|
1933
1936
|
*/
|
|
1934
1937
|
// "jsdoc/check-indentation": ["error"|"warn", {"excludeTags":[]}]
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* @example
|
|
1941
|
+
* ```
|
|
1942
|
+
* @MyDecorator({
|
|
1943
|
+
* myOptions: 42
|
|
1944
|
+
* })
|
|
1945
|
+
* export class MyClass {}
|
|
1946
|
+
* ```
|
|
1947
|
+
*/
|
|
1948
|
+
function MyDecorator(options: { myOptions: number }) {
|
|
1949
|
+
return (Base: Function) => {};
|
|
1950
|
+
}
|
|
1951
|
+
// "jsdoc/check-indentation": ["error"|"warn", {"excludeTags":["example","MyDecorator"]}]
|
|
1935
1952
|
````
|
|
1936
1953
|
|
|
1937
1954
|
|
|
@@ -4751,7 +4768,7 @@ behavior.
|
|
|
4751
4768
|
See also the documentation on `settings.jsdoc.preferredTypes` which impacts
|
|
4752
4769
|
the behavior of `check-types`.
|
|
4753
4770
|
|
|
4754
|
-
Note that if there is an error [parsing](https://github.com/
|
|
4771
|
+
Note that if there is an error [parsing](https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser)
|
|
4755
4772
|
types for a tag, the function will silently ignore that tag, leaving it to
|
|
4756
4773
|
the `valid-types` rule to report parsing errors.
|
|
4757
4774
|
|
|
@@ -4770,10 +4787,12 @@ footprint is a tiny little bit smaller, and the
|
|
|
4770
4787
|
[GC](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) has
|
|
4771
4788
|
less work to do.
|
|
4772
4789
|
|
|
4773
|
-
So in a sense, there two types of strings in Javascript
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4790
|
+
So in a sense, there are two types of strings in Javascript:
|
|
4791
|
+
1. `{string}` literals, also called primitives
|
|
4792
|
+
2. `{String}` Objects.
|
|
4793
|
+
|
|
4794
|
+
We use the primitives because it's easier to write and uses less memory.
|
|
4795
|
+
`{String}` and `{string}` are technically both valid, but they are not the same.
|
|
4777
4796
|
|
|
4778
4797
|
```js
|
|
4779
4798
|
new String('lard') // String {0: "l", 1: "a", 2: "r", 3: "d", length: 4}
|
|
@@ -5735,7 +5754,7 @@ If present as an array, will be used in place of SPDX identifiers.
|
|
|
5735
5754
|
A string to be converted into a `RegExp` (with `u` flag) and whose first
|
|
5736
5755
|
parenthetical grouping, if present, will match the portion of the license
|
|
5737
5756
|
description to check (if no grouping is present, then the whole portion
|
|
5738
|
-
matched will be used). Defaults to `/([^\n]*)/gu`, i.e., the SPDX expression
|
|
5757
|
+
matched will be used). Defaults to `/([^\n\r]*)/gu`, i.e., the SPDX expression
|
|
5739
5758
|
is expected before any line breaks.
|
|
5740
5759
|
|
|
5741
5760
|
Note that the `/` delimiters are optional, but necessary to add flags.
|
|
@@ -5997,6 +6016,12 @@ function quux (foo) {
|
|
|
5997
6016
|
function quux (foo) {
|
|
5998
6017
|
|
|
5999
6018
|
}
|
|
6019
|
+
|
|
6020
|
+
/**
|
|
6021
|
+
* @module test
|
|
6022
|
+
* @license MIT
|
|
6023
|
+
*/
|
|
6024
|
+
'use strict';
|
|
6000
6025
|
````
|
|
6001
6026
|
|
|
6002
6027
|
|
|
@@ -6892,7 +6917,7 @@ class MyClass {
|
|
|
6892
6917
|
*/
|
|
6893
6918
|
myClassField = 1
|
|
6894
6919
|
}
|
|
6895
|
-
// "jsdoc/match-description": ["error"|"warn", {"contexts":["
|
|
6920
|
+
// "jsdoc/match-description": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
|
|
6896
6921
|
// Message: JSDoc description does not satisfy the regex pattern.
|
|
6897
6922
|
|
|
6898
6923
|
/**
|
|
@@ -7160,7 +7185,7 @@ class MyClass {
|
|
|
7160
7185
|
*/
|
|
7161
7186
|
myClassField = 1
|
|
7162
7187
|
}
|
|
7163
|
-
// "jsdoc/match-description": ["error"|"warn", {"contexts":["
|
|
7188
|
+
// "jsdoc/match-description": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
|
|
7164
7189
|
|
|
7165
7190
|
/**
|
|
7166
7191
|
* Foo.
|
|
@@ -7339,7 +7364,7 @@ be applied, however.
|
|
|
7339
7364
|
|||
|
|
7340
7365
|
|---|---|
|
|
7341
7366
|
|Context|everywhere|
|
|
7342
|
-
|Tags|(The tags
|
|
7367
|
+
|Tags|(The tags specified by `tags`, including any tag if `*` is set)|
|
|
7343
7368
|
|Recommended|false|
|
|
7344
7369
|
|Settings|`structuredTags`|
|
|
7345
7370
|
|Options|`match`|
|
|
@@ -9145,7 +9170,7 @@ The following types are always considered defined.
|
|
|
9145
9170
|
Note that preferred types indicated within `settings.jsdoc.preferredTypes` will
|
|
9146
9171
|
also be assumed to be defined.
|
|
9147
9172
|
|
|
9148
|
-
Also note that if there is an error [parsing](https://github.com/
|
|
9173
|
+
Also note that if there is an error [parsing](https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser)
|
|
9149
9174
|
types for a tag, the function will silently ignore that tag, leaving it to
|
|
9150
9175
|
the `valid-types` rule to report parsing errors.
|
|
9151
9176
|
|
|
@@ -10739,7 +10764,7 @@ An options object may have any of the following properties:
|
|
|
10739
10764
|
| Aliases | `desc` |
|
|
10740
10765
|
| Recommended | false |
|
|
10741
10766
|
| Options | `contexts`, `exemptedBy`, `descriptionStyle`, `checkConstructors`, `checkGetters`, `checkSetters` |
|
|
10742
|
-
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
10767
|
+
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
10743
10768
|
|
|
10744
10769
|
The following patterns are considered problems:
|
|
10745
10770
|
|
|
@@ -11318,7 +11343,7 @@ report a missing example description after this is added.
|
|
|
11318
11343
|
|Tags|`example`|
|
|
11319
11344
|
|Recommended|false|
|
|
11320
11345
|
|Options|`exemptedBy`, `exemptNoArguments`, `avoidExampleOnConstructors`, `contexts`|
|
|
11321
|
-
|Settings|`overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
11346
|
+
|Settings|`ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
11322
11347
|
|
|
11323
11348
|
The following patterns are considered problems:
|
|
11324
11349
|
|
|
@@ -12791,7 +12816,7 @@ class Animal {
|
|
|
12791
12816
|
@SomeAnnotation('optionalParameter')
|
|
12792
12817
|
tail: boolean;
|
|
12793
12818
|
}
|
|
12794
|
-
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["
|
|
12819
|
+
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
|
|
12795
12820
|
// Message: Missing JSDoc comment.
|
|
12796
12821
|
|
|
12797
12822
|
@Entity('users')
|
|
@@ -12885,7 +12910,7 @@ export class MyComponentComponent {
|
|
|
12885
12910
|
@Input()
|
|
12886
12911
|
public value = new EventEmitter();
|
|
12887
12912
|
}
|
|
12888
|
-
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["
|
|
12913
|
+
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition > Decorator[expression.callee.name=\"Input\"]"]}]
|
|
12889
12914
|
// Message: Missing JSDoc comment.
|
|
12890
12915
|
|
|
12891
12916
|
requestAnimationFrame(draw)
|
|
@@ -12929,6 +12954,12 @@ function comment () {
|
|
|
12929
12954
|
}
|
|
12930
12955
|
// "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":false,"fixerMessage":" TODO: add comment"}]
|
|
12931
12956
|
// Message: Missing JSDoc comment.
|
|
12957
|
+
|
|
12958
|
+
export class InovaAutoCompleteComponent {
|
|
12959
|
+
public disabled = false;
|
|
12960
|
+
}
|
|
12961
|
+
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}]
|
|
12962
|
+
// Message: Missing JSDoc comment.
|
|
12932
12963
|
````
|
|
12933
12964
|
|
|
12934
12965
|
The following patterns are not considered problems:
|
|
@@ -12956,7 +12987,7 @@ export class Foo {
|
|
|
12956
12987
|
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
|
|
12957
12988
|
|
|
12958
12989
|
/** This is comment */
|
|
12959
|
-
function
|
|
12990
|
+
function someFunction() {
|
|
12960
12991
|
interface FooBar {
|
|
12961
12992
|
fooBar: string;
|
|
12962
12993
|
}
|
|
@@ -14523,7 +14554,7 @@ supplied as default values. Defaults to `false`.
|
|
|
14523
14554
|
| Aliases | `arg`, `argument` |
|
|
14524
14555
|
|Recommended | true|
|
|
14525
14556
|
| Options | `autoIncrementBase`, `checkDestructured`, `checkDestructuredRoots`, `contexts`, `enableFixer`, `enableRootFixer`, `enableRestElementFixer`, `checkRestProperty`, `exemptedBy`, `checkConstructors`, `checkGetters`, `checkSetters`, `checkTypesPattern`, `unnamedRootBase`, `useDefaultObjectProperties`|
|
|
14526
|
-
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
14557
|
+
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs`|
|
|
14527
14558
|
|
|
14528
14559
|
The following patterns are considered problems:
|
|
14529
14560
|
|
|
@@ -14715,6 +14746,15 @@ function quux (foo) {
|
|
|
14715
14746
|
// Settings: {"jsdoc":{"overrideReplacesDocs":false}}
|
|
14716
14747
|
// Message: Missing JSDoc @param "foo" declaration.
|
|
14717
14748
|
|
|
14749
|
+
/**
|
|
14750
|
+
* @ignore
|
|
14751
|
+
*/
|
|
14752
|
+
function quux (foo) {
|
|
14753
|
+
|
|
14754
|
+
}
|
|
14755
|
+
// Settings: {"jsdoc":{"ignoreReplacesDocs":false}}
|
|
14756
|
+
// Message: Missing JSDoc @param "foo" declaration.
|
|
14757
|
+
|
|
14718
14758
|
/**
|
|
14719
14759
|
* @implements
|
|
14720
14760
|
*/
|
|
@@ -14754,6 +14794,20 @@ class A {
|
|
|
14754
14794
|
// Settings: {"jsdoc":{"overrideReplacesDocs":false}}
|
|
14755
14795
|
// Message: Missing JSDoc @param "foo" declaration.
|
|
14756
14796
|
|
|
14797
|
+
/**
|
|
14798
|
+
* @ignore
|
|
14799
|
+
*/
|
|
14800
|
+
class A {
|
|
14801
|
+
/**
|
|
14802
|
+
*
|
|
14803
|
+
*/
|
|
14804
|
+
quux (foo) {
|
|
14805
|
+
|
|
14806
|
+
}
|
|
14807
|
+
}
|
|
14808
|
+
// Settings: {"jsdoc":{"ignoreReplacesDocs":false}}
|
|
14809
|
+
// Message: Missing JSDoc @param "foo" declaration.
|
|
14810
|
+
|
|
14757
14811
|
/**
|
|
14758
14812
|
* @implements
|
|
14759
14813
|
*/
|
|
@@ -15294,6 +15348,14 @@ function quux (foo) {
|
|
|
15294
15348
|
}
|
|
15295
15349
|
// Settings: {"jsdoc":{"overrideReplacesDocs":true}}
|
|
15296
15350
|
|
|
15351
|
+
/**
|
|
15352
|
+
* @ignore
|
|
15353
|
+
*/
|
|
15354
|
+
function quux (foo) {
|
|
15355
|
+
|
|
15356
|
+
}
|
|
15357
|
+
// Settings: {"jsdoc":{"ignoreReplacesDocs":true}}
|
|
15358
|
+
|
|
15297
15359
|
/**
|
|
15298
15360
|
* @implements
|
|
15299
15361
|
*/
|
|
@@ -15402,6 +15464,19 @@ class A {
|
|
|
15402
15464
|
}
|
|
15403
15465
|
// Settings: {"jsdoc":{"overrideReplacesDocs":true}}
|
|
15404
15466
|
|
|
15467
|
+
/**
|
|
15468
|
+
* @ignore
|
|
15469
|
+
*/
|
|
15470
|
+
class A {
|
|
15471
|
+
/**
|
|
15472
|
+
*
|
|
15473
|
+
*/
|
|
15474
|
+
quux (foo) {
|
|
15475
|
+
|
|
15476
|
+
}
|
|
15477
|
+
}
|
|
15478
|
+
// Settings: {"jsdoc":{"ignoreReplacesDocs":true}}
|
|
15479
|
+
|
|
15405
15480
|
/**
|
|
15406
15481
|
* @implements
|
|
15407
15482
|
*/
|
|
@@ -17003,7 +17078,7 @@ Will also report if multiple `@returns` tags are present.
|
|
|
17003
17078
|
| Aliases | `return` |
|
|
17004
17079
|
|Recommended|true|
|
|
17005
17080
|
| Options | `checkConstructors`, `checkGetters`, `contexts`, `exemptedBy`, `forceRequireReturn`, `forceReturnsWithAsync` |
|
|
17006
|
-
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
17081
|
+
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
17007
17082
|
|
|
17008
17083
|
The following patterns are considered problems:
|
|
17009
17084
|
|
|
@@ -18047,7 +18122,7 @@ Requires that throw statements are documented.
|
|
|
18047
18122
|
| Aliases | `exception` |
|
|
18048
18123
|
|Recommended|true|
|
|
18049
18124
|
| Options | `contexts`, `exemptedBy` |
|
|
18050
|
-
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
18125
|
+
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
18051
18126
|
|
|
18052
18127
|
The following patterns are considered problems:
|
|
18053
18128
|
|
|
@@ -18357,7 +18432,7 @@ option to expect a non-standard `@next` tag.
|
|
|
18357
18432
|
|Aliases|`yield`|
|
|
18358
18433
|
|Recommended|true|
|
|
18359
18434
|
| Options | `contexts`, `exemptedBy`, `withGeneratorTag`, `nextWithGeneratorTag`, `forceRequireYields`, `next` |
|
|
18360
|
-
| Settings | `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
18435
|
+
| Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
|
|
18361
18436
|
|
|
18362
18437
|
The following patterns are considered problems:
|
|
18363
18438
|
|
|
@@ -19932,10 +20007,10 @@ The following patterns are not considered problems:
|
|
|
19932
20007
|
|
|
19933
20008
|
Requires all types to be valid JSDoc, Closure, or TypeScript compiler types
|
|
19934
20009
|
without syntax errors. Note that what determines a valid type is handled by
|
|
19935
|
-
our type parsing engine, [
|
|
20010
|
+
our type parsing engine, [jsdoc-type-pratt-parser](https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser),
|
|
19936
20011
|
using [`settings.jsdoc.mode`](#eslint-plugin-jsdoc-settings-mode) to
|
|
19937
|
-
determine whether to use
|
|
19938
|
-
"jsdoc", "typescript", "closure" modes.
|
|
20012
|
+
determine whether to use jsdoc-type-pratt-parser's "permissive" parsing or
|
|
20013
|
+
the stricter "jsdoc", "typescript", "closure" modes.
|
|
19939
20014
|
|
|
19940
20015
|
The following tags have their "type" portions (the segment within brackets)
|
|
19941
20016
|
checked (though those portions may sometimes be confined to namepaths,
|
package/dist/iterateJsdoc.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = iterateJsdoc;
|
|
7
|
+
exports.getSettings = void 0;
|
|
7
8
|
Object.defineProperty(exports, "parseComment", {
|
|
8
9
|
enumerable: true,
|
|
9
10
|
get: function () {
|
|
10
11
|
return _jsdoccomment.parseComment;
|
|
11
12
|
}
|
|
12
13
|
});
|
|
13
|
-
exports.getSettings = void 0;
|
|
14
14
|
|
|
15
15
|
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
16
16
|
|
|
@@ -87,6 +87,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
87
87
|
const {
|
|
88
88
|
tagNamePreference,
|
|
89
89
|
overrideReplacesDocs,
|
|
90
|
+
ignoreReplacesDocs,
|
|
90
91
|
implementsReplacesDocs,
|
|
91
92
|
augmentsExtendsReplacesDocs,
|
|
92
93
|
maxLines,
|
|
@@ -476,7 +477,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
476
477
|
utils.avoidDocs = () => {
|
|
477
478
|
var _context$options$0$ex, _context$options$;
|
|
478
479
|
|
|
479
|
-
if (overrideReplacesDocs !== false && (utils.hasTag('override') || utils.classHasTag('override')) || implementsReplacesDocs !== false && (utils.hasTag('implements') || utils.classHasTag('implements')) || augmentsExtendsReplacesDocs && (utils.hasATag(['augments', 'extends']) || utils.classHasTag('augments') || utils.classHasTag('extends'))) {
|
|
480
|
+
if (ignoreReplacesDocs !== false && (utils.hasTag('ignore') || utils.classHasTag('ignore')) || overrideReplacesDocs !== false && (utils.hasTag('override') || utils.classHasTag('override')) || implementsReplacesDocs !== false && (utils.hasTag('implements') || utils.classHasTag('implements')) || augmentsExtendsReplacesDocs && (utils.hasATag(['augments', 'extends']) || utils.classHasTag('augments') || utils.classHasTag('extends'))) {
|
|
480
481
|
return true;
|
|
481
482
|
}
|
|
482
483
|
|
|
@@ -651,7 +652,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
651
652
|
};
|
|
652
653
|
|
|
653
654
|
const getSettings = context => {
|
|
654
|
-
var _context$settings$jsd, _context$settings$jsd2, _context$settings$jsd3, _context$settings$jsd4, _context$settings$jsd5, _context$settings$jsd6, _context$settings$jsd7, _context$settings$jsd8, _context$settings$jsd9, _context$settings$jsd10, _context$settings$jsd11, _context$settings$jsd12, _context$settings$jsd13, _context$settings$jsd14, _context$settings$jsd15, _context$settings$jsd16, _context$settings$jsd17;
|
|
655
|
+
var _context$settings$jsd, _context$settings$jsd2, _context$settings$jsd3, _context$settings$jsd4, _context$settings$jsd5, _context$settings$jsd6, _context$settings$jsd7, _context$settings$jsd8, _context$settings$jsd9, _context$settings$jsd10, _context$settings$jsd11, _context$settings$jsd12, _context$settings$jsd13, _context$settings$jsd14, _context$settings$jsd15, _context$settings$jsd16, _context$settings$jsd17, _context$settings$jsd18;
|
|
655
656
|
|
|
656
657
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
657
658
|
const settings = {
|
|
@@ -666,12 +667,14 @@ const getSettings = context => {
|
|
|
666
667
|
preferredTypes: (_context$settings$jsd9 = (_context$settings$jsd10 = context.settings.jsdoc) === null || _context$settings$jsd10 === void 0 ? void 0 : _context$settings$jsd10.preferredTypes) !== null && _context$settings$jsd9 !== void 0 ? _context$settings$jsd9 : {},
|
|
667
668
|
// `check-types`, `no-undefined-types`, `valid-types`
|
|
668
669
|
structuredTags: (_context$settings$jsd11 = (_context$settings$jsd12 = context.settings.jsdoc) === null || _context$settings$jsd12 === void 0 ? void 0 : _context$settings$jsd12.structuredTags) !== null && _context$settings$jsd11 !== void 0 ? _context$settings$jsd11 : {},
|
|
669
|
-
// `require-param`, `require-description`, `require-example`,
|
|
670
|
+
// `require-param`, `require-description`, `require-example`,
|
|
671
|
+
// `require-returns`, `require-throw`, `require-yields`
|
|
670
672
|
overrideReplacesDocs: (_context$settings$jsd13 = context.settings.jsdoc) === null || _context$settings$jsd13 === void 0 ? void 0 : _context$settings$jsd13.overrideReplacesDocs,
|
|
671
|
-
|
|
672
|
-
|
|
673
|
+
ignoreReplacesDocs: (_context$settings$jsd14 = context.settings.jsdoc) === null || _context$settings$jsd14 === void 0 ? void 0 : _context$settings$jsd14.ignoreReplacesDocs,
|
|
674
|
+
implementsReplacesDocs: (_context$settings$jsd15 = context.settings.jsdoc) === null || _context$settings$jsd15 === void 0 ? void 0 : _context$settings$jsd15.implementsReplacesDocs,
|
|
675
|
+
augmentsExtendsReplacesDocs: (_context$settings$jsd16 = context.settings.jsdoc) === null || _context$settings$jsd16 === void 0 ? void 0 : _context$settings$jsd16.augmentsExtendsReplacesDocs,
|
|
673
676
|
// Many rules, e.g., `check-tag-names`
|
|
674
|
-
mode: (_context$settings$
|
|
677
|
+
mode: (_context$settings$jsd17 = (_context$settings$jsd18 = context.settings.jsdoc) === null || _context$settings$jsd18 === void 0 ? void 0 : _context$settings$jsd18.mode) !== null && _context$settings$jsd17 !== void 0 ? _context$settings$jsd17 : context.parserPath.includes('@typescript-eslint') ? 'typescript' : 'jsdoc'
|
|
675
678
|
};
|
|
676
679
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
677
680
|
|
|
@@ -721,7 +724,8 @@ const makeReport = (context, commentNode) => {
|
|
|
721
724
|
start: {
|
|
722
725
|
line: lineNumber
|
|
723
726
|
}
|
|
724
|
-
};
|
|
727
|
+
}; // Todo: Remove ignore once `check-examples` can be restored for ESLint 8+
|
|
728
|
+
// istanbul ignore if
|
|
725
729
|
|
|
726
730
|
if (jsdocLoc.column) {
|
|
727
731
|
const colNumber = commentNode.loc.start.column + jsdocLoc.column;
|