@@ -3666,12 +3666,37 @@ tag descriptions are written in complete sentences, i.e.,
3666
3666
* Every line in a paragraph (except the first) which starts with an uppercase
3667
3667
character must be preceded by a line ending with a period.
3668
3668
3669
+ <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-6 " ></a >
3670
+ #### Options
3671
+
3672
+ <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-6-tags-1 " ></a >
3673
+ ##### <code >tags</code >
3674
+
3675
+ If you want additional tags to be checked for their descriptions, you may
3676
+ add them within this option.
3677
+
3678
+ ``` js
3679
+ {
3680
+ ' jsdoc/require-description-complete-sentence' : [' error' , {tags: [' see' , ' copyright' ]}]
3681
+ }
3682
+ ```
3683
+
3684
+ The tags ` @param ` /` @arg ` /` @argument ` and ` @property ` /` @prop ` will be properly
3685
+ parsed to ensure that the checked "description" text includes only the text
3686
+ after the name.
3687
+
3688
+ All other tags will treat the text following the tag name, a space, and
3689
+ an optional curly-bracketed type expression (and another space) as part of
3690
+ its "description" (e.g., for ` @returns {someType} some description ` , the
3691
+ description is ` some description ` while for ` @some-tag xyz ` , the description
3692
+ is ` xyz ` ).
3693
+
3669
3694
|||
3670
3695
| ---| ---|
3671
3696
| Context| everywhere|
3672
- | Tags| ` param ` , ` returns ` , ` description ` |
3673
- | Aliases| ` arg ` , ` argument ` , ` return ` , ` desc ` |
3674
-
3697
+ | Tags| doc block, ` param ` , ` returns ` , ` description ` , ` property ` , ` summary ` , ` file ` , ` classdesc ` , ` todo ` , ` deprecated ` , ` throws ` , 'yields' and others added by ` tags ` |
3698
+ | Aliases| ` arg ` , ` argument ` , ` return ` , ` desc ` , ` prop ` , ` fileoverview ` , ` overview ` , ` exception ` , ` yield ` |
3699
+ | Options | ` tags ` |
3675
3700
The following patterns are considered problems:
3676
3701
3677
3702
```` js
@@ -3846,10 +3871,35 @@ function quux (foo) {
3846
3871
// Message: Sentence should start with an uppercase character.
3847
3872
3848
3873
/**
3849
- * @typedef {Object} Hello World
3874
+ * @throws {Object} Hello World
3850
3875
* hello world
3851
3876
*/
3852
3877
// Message: Sentence must end with a period.
3878
+
3879
+ /**
3880
+ * @summary Foo
3881
+ */
3882
+ function quux () {
3883
+
3884
+ }
3885
+ // Message: Sentence must end with a period.
3886
+
3887
+ /**
3888
+ * @throws {SomeType} Foo
3889
+ */
3890
+ function quux () {
3891
+
3892
+ }
3893
+ // Message: Sentence must end with a period.
3894
+
3895
+ /**
3896
+ * @see Foo
3897
+ */
3898
+ function quux () {
3899
+
3900
+ }
3901
+ // Options: [{"tags":["see"]}]
3902
+ // Message: Sentence must end with a period.
3853
3903
````
3854
3904
3855
3905
The following patterns are not considered problems:
@@ -4001,6 +4051,39 @@ function quux () {
4001
4051
function quux () {
4002
4052
4003
4053
}
4054
+
4055
+ /**
4056
+ * @example Foo
4057
+ */
4058
+ function quux () {
4059
+
4060
+ }
4061
+
4062
+ /**
4063
+ * @see Foo
4064
+ */
4065
+ function quux () {
4066
+
4067
+ }
4068
+
4069
+ /**
4070
+ * Foo.
4071
+ *
4072
+ * @param foo Foo.
4073
+ */
4074
+ function quux (foo ) {
4075
+
4076
+ }
4077
+
4078
+ /**
4079
+ * Foo.
4080
+ *
4081
+ * @param foo Foo.
4082
+ */
4083
+ function quux (foo ) {
4084
+
4085
+ }
4086
+ // Options: [{"tags":["param"]}]
4004
4087
````
4005
4088
4006
4089
@@ -4015,7 +4098,7 @@ Requires that all functions have a description.
4015
4098
` "tag" ` ) must have a non-empty description that explains the purpose of the
4016
4099
method.
4017
4100
4018
- <a name =" eslint-plugin-jsdoc-rules-require-description-options-6 " ></a >
4101
+ <a name =" eslint-plugin-jsdoc-rules-require-description-options-7 " ></a >
4019
4102
#### Options
4020
4103
4021
4104
An options object may have any of the following properties:
@@ -4274,25 +4357,25 @@ Requires that all functions have examples.
4274
4357
* All functions must have one or more ` @example ` tags.
4275
4358
* Every example tag must have a non-empty description that explains the method's usage.
4276
4359
4277
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-7 " ></a >
4360
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 " ></a >
4278
4361
#### Options
4279
4362
4280
4363
This rule has an object option.
4281
4364
4282
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-7 -exemptedby " ></a >
4365
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -exemptedby " ></a >
4283
4366
##### <code >exemptedBy</code >
4284
4367
4285
4368
Array of tags (e.g., ` ['type'] ` ) whose presence on the document
4286
4369
block avoids the need for an ` @example ` . Defaults to an empty array.
4287
4370
4288
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-7 -avoidexampleonconstructors " ></a >
4371
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -avoidexampleonconstructors " ></a >
4289
4372
##### <code >avoidExampleOnConstructors</code >
4290
4373
4291
4374
Set to ` true ` to avoid the need for an example on a constructor (whether
4292
4375
indicated as such by a jsdoc tag or by being within an ES6 ` class ` ).
4293
4376
Defaults to ` false ` .
4294
4377
4295
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-7 -contexts-1 " ></a >
4378
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -contexts-1 " ></a >
4296
4379
##### <code >contexts</code >
4297
4380
4298
4381
Set this to an array of strings representing the AST context
@@ -4456,7 +4539,7 @@ function quux () {
4456
4539
4457
4540
Requires a hyphen before the ` @param ` description.
4458
4541
4459
- <a name =" eslint-plugin-jsdoc-rules-require-hyphen-before-param-description-options-8 " ></a >
4542
+ <a name =" eslint-plugin-jsdoc-rules-require-hyphen-before-param-description-options-9 " ></a >
4460
4543
#### Options
4461
4544
4462
4545
This rule takes one optional string argument. If it is ` "always" ` then a problem is raised when there is no hyphen before the description. If it is ` "never" ` then a problem is raised when there is a hyphen before the description. The default value is ` "always" ` .
@@ -4562,7 +4645,7 @@ function quux () {
4562
4645
Checks for presence of jsdoc comments, on class declarations as well as
4563
4646
functions.
4564
4647
4565
- <a name =" eslint-plugin-jsdoc-rules-require-jsdoc-options-9 " ></a >
4648
+ <a name =" eslint-plugin-jsdoc-rules-require-jsdoc-options-10 " ></a >
4566
4649
#### Options
4567
4650
4568
4651
Accepts one optional options object with the following optional keys.
@@ -5605,7 +5688,7 @@ function quux (foo) {
5605
5688
5606
5689
Requires that all function parameters are documented.
5607
5690
5608
- <a name =" eslint-plugin-jsdoc-rules-require-param-options-10 " ></a >
5691
+ <a name =" eslint-plugin-jsdoc-rules-require-param-options-11 " ></a >
5609
5692
#### Options
5610
5693
5611
5694
An options object accepts one optional property:
@@ -6536,7 +6619,7 @@ Requires returns are documented.
6536
6619
6537
6620
Will also report if multiple ` @returns ` tags are present.
6538
6621
6539
- <a name =" eslint-plugin-jsdoc-rules-require-returns-options-11 " ></a >
6622
+ <a name =" eslint-plugin-jsdoc-rules-require-returns-options-12 " ></a >
6540
6623
#### Options
6541
6624
6542
6625
- ` exemptedBy ` - Array of tags (e.g., ` ['type'] ` ) whose presence on the document
@@ -6992,7 +7075,7 @@ Also impacts behaviors on namepath (or event)-defining and pointing tags:
6992
7075
allow ` # ` , ` . ` , or ` ~ ` at the end (which is not allowed at the end of
6993
7076
normal paths).
6994
7077
6995
- <a name =" eslint-plugin-jsdoc-rules-valid-types-options-12 " ></a >
7078
+ <a name =" eslint-plugin-jsdoc-rules-valid-types-options-13 " ></a >
6996
7079
#### Options
6997
7080
6998
7081
- ` allowEmptyNamepaths ` (default: true) - Set to ` false ` to disallow
0 commit comments