@@ -835,10 +835,36 @@ function quux () {}
835
835
836
836
Reports invalid padding inside JSDoc block.
837
837
838
+ <a name =" eslint-plugin-jsdoc-rules-check-indentation-options-1 " ></a >
839
+ #### Options
840
+
841
+ This rule has an object option.
842
+
843
+ <a name =" eslint-plugin-jsdoc-rules-check-indentation-options-1-excludeexamples " ></a >
844
+ ##### <code >excludeExamples</code >
845
+
846
+ This boolean property allows to "hide" example code from reports.
847
+
848
+ By default, whole JSDoc block is checked for invalid padding.
849
+ That includes example blocks too, which may get in the way of adding full,
850
+ readable examples of code without ending up with multiple linting issues.
851
+
852
+ When enabled, following code will lint without any padding issue:
853
+
854
+ ``` js
855
+ /**
856
+ * @example
857
+ * anArray .filter ((a ) => {
858
+ * return a .b ;
859
+ * });
860
+ */
861
+ ```
862
+
838
863
|||
839
864
| ---| ---|
840
865
| Context| everywhere|
841
866
| Tags| N/A|
867
+ | Options| ` excludeExamples ` |
842
868
843
869
The following patterns are considered problems:
844
870
@@ -871,14 +897,13 @@ class Moo {}
871
897
* foo
872
898
*
873
899
* @example
874
- * function xFoo () {
875
- * return ' foo ' ;
876
- * }
900
+ * anArray . filter (( a ) => {
901
+ * return a . b ;
902
+ * });
877
903
*/
878
904
function quux () {
879
905
880
906
}
881
- // Options: ["excludeExamples":false}]
882
907
// Message: There must be no indentation.
883
908
````
884
909
@@ -904,14 +929,14 @@ function quux () {
904
929
* foo
905
930
*
906
931
* @example
907
- * function xFoo () {
908
- * return ' foo ' ;
909
- * }
932
+ * anArray . filter (( a ) => {
933
+ * return a . b ;
934
+ * });
910
935
*/
911
936
function quux () {
912
937
913
938
}
914
- // Options: ["excludeExamples":true}]
939
+ // Options: [{ "excludeExamples":true}]
915
940
````
916
941
917
942
@@ -1265,10 +1290,10 @@ yields
1265
1290
1266
1291
Note that the tags indicated as replacements in ` settings.jsdoc.tagNamePreference ` will automatically be considered as valid.
1267
1292
1268
- <a name =" eslint-plugin-jsdoc-rules-check-tag-names-options-1 " ></a >
1293
+ <a name =" eslint-plugin-jsdoc-rules-check-tag-names-options-2 " ></a >
1269
1294
#### Options
1270
1295
1271
- <a name =" eslint-plugin-jsdoc-rules-check-tag-names-options-1 -definedtags " ></a >
1296
+ <a name =" eslint-plugin-jsdoc-rules-check-tag-names-options-2 -definedtags " ></a >
1272
1297
##### <code >definedTags</code >
1273
1298
1274
1299
Use an array of ` definedTags ` strings to configure additional, allowed JSDoc tags.
@@ -1610,7 +1635,7 @@ Date
1610
1635
RegExp
1611
1636
```
1612
1637
1613
- <a name =" eslint-plugin-jsdoc-rules-check-types-options-2 " ></a >
1638
+ <a name =" eslint-plugin-jsdoc-rules-check-types-options-3 " ></a >
1614
1639
#### Options
1615
1640
1616
1641
` check-types ` allows one option:
@@ -2511,10 +2536,10 @@ by our supported Node versions):
2511
2536
Applies to the jsdoc block description and ` @description ` (or ` @desc ` )
2512
2537
by default but the ` tags ` option (see below) may be used to match other tags.
2513
2538
2514
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-3 " ></a >
2539
+ <a name =" eslint-plugin-jsdoc-rules-match-description-options-4 " ></a >
2515
2540
#### Options
2516
2541
2517
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-3 -matchdescription " ></a >
2542
+ <a name =" eslint-plugin-jsdoc-rules-match-description-options-4 -matchdescription " ></a >
2518
2543
##### <code >matchDescription</code >
2519
2544
2520
2545
You can supply your own expression to override the default, passing a
@@ -2529,7 +2554,7 @@ You can supply your own expression to override the default, passing a
2529
2554
As with the default, the supplied regular expression will be applied with the
2530
2555
Unicode (` "u" ` ) flag and is * not* case-insensitive.
2531
2556
2532
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-3 -tags " ></a >
2557
+ <a name =" eslint-plugin-jsdoc-rules-match-description-options-4 -tags " ></a >
2533
2558
##### <code >tags</code >
2534
2559
2535
2560
If you want different regular expressions to apply to tags, you may use
@@ -2566,7 +2591,7 @@ its "description" (e.g., for `@returns {someType} some description`, the
2566
2591
description is ` some description ` while for ` @some-tag xyz ` , the description
2567
2592
is ` xyz ` ).
2568
2593
2569
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-3 -maindescription " ></a >
2594
+ <a name =" eslint-plugin-jsdoc-rules-match-description-options-4 -maindescription " ></a >
2570
2595
##### <code >mainDescription</code >
2571
2596
2572
2597
If you wish to override the main function description without changing the
@@ -2588,7 +2613,7 @@ There is no need to add `mainDescription: true`, as by default, the main
2588
2613
function (and only the main function) is linted, though you may disable checking
2589
2614
it by setting it to ` false ` .
2590
2615
2591
- <a name =" eslint-plugin-jsdoc-rules-match-description-options-3 -contexts " ></a >
2616
+ <a name =" eslint-plugin-jsdoc-rules-match-description-options-4 -contexts " ></a >
2592
2617
##### <code >contexts</code >
2593
2618
2594
2619
Set this to an array of strings representing the AST context
@@ -3208,7 +3233,7 @@ function quux () {
3208
3233
3209
3234
Enforces a consistent padding of the block description.
3210
3235
3211
- <a name =" eslint-plugin-jsdoc-rules-newline-after-description-options-4 " ></a >
3236
+ <a name =" eslint-plugin-jsdoc-rules-newline-after-description-options-5 " ></a >
3212
3237
#### Options
3213
3238
3214
3239
This rule allows one optional string argument. If it is ` "always" ` then a problem is raised when there is a newline after the description. If it is ` "never" ` then a problem is raised when there is no newline after the description. The default value is ` "always" ` .
@@ -3388,7 +3413,7 @@ The following types are always considered defined.
3388
3413
Note that preferred types indicated within ` settings.jsdoc.preferredTypes ` will
3389
3414
also be assumed to be defined.
3390
3415
3391
- <a name =" eslint-plugin-jsdoc-rules-no-undefined-types-options-5 " ></a >
3416
+ <a name =" eslint-plugin-jsdoc-rules-no-undefined-types-options-6 " ></a >
3392
3417
#### Options
3393
3418
3394
3419
An option object may have the following key:
@@ -3717,10 +3742,10 @@ tag descriptions are written in complete sentences, i.e.,
3717
3742
* Every line in a paragraph (except the first) which starts with an uppercase
3718
3743
character must be preceded by a line ending with a period.
3719
3744
3720
- <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-6 " ></a >
3745
+ <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-7 " ></a >
3721
3746
#### Options
3722
3747
3723
- <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-6 -tags-1 " ></a >
3748
+ <a name =" eslint-plugin-jsdoc-rules-require-description-complete-sentence-options-7 -tags-1 " ></a >
3724
3749
##### <code >tags</code >
3725
3750
3726
3751
If you want additional tags to be checked for their descriptions, you may
@@ -4176,7 +4201,7 @@ Requires that all functions have a description.
4176
4201
` "tag" ` ) must have a non-empty description that explains the purpose of the
4177
4202
method.
4178
4203
4179
- <a name =" eslint-plugin-jsdoc-rules-require-description-options-7 " ></a >
4204
+ <a name =" eslint-plugin-jsdoc-rules-require-description-options-8 " ></a >
4180
4205
#### Options
4181
4206
4182
4207
An options object may have any of the following properties:
@@ -4453,25 +4478,25 @@ Requires that all functions have examples.
4453
4478
* All functions must have one or more ` @example ` tags.
4454
4479
* Every example tag must have a non-empty description that explains the method's usage.
4455
4480
4456
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 " ></a >
4481
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-9 " ></a >
4457
4482
#### Options
4458
4483
4459
4484
This rule has an object option.
4460
4485
4461
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -exemptedby " ></a >
4486
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-9 -exemptedby " ></a >
4462
4487
##### <code >exemptedBy</code >
4463
4488
4464
4489
Array of tags (e.g., ` ['type'] ` ) whose presence on the document
4465
4490
block avoids the need for an ` @example ` . Defaults to an empty array.
4466
4491
4467
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -avoidexampleonconstructors " ></a >
4492
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-9 -avoidexampleonconstructors " ></a >
4468
4493
##### <code >avoidExampleOnConstructors</code >
4469
4494
4470
4495
Set to ` true ` to avoid the need for an example on a constructor (whether
4471
4496
indicated as such by a jsdoc tag or by being within an ES6 ` class ` ).
4472
4497
Defaults to ` false ` .
4473
4498
4474
- <a name =" eslint-plugin-jsdoc-rules-require-example-options-8 -contexts-1 " ></a >
4499
+ <a name =" eslint-plugin-jsdoc-rules-require-example-options-9 -contexts-1 " ></a >
4475
4500
##### <code >contexts</code >
4476
4501
4477
4502
Set this to an array of strings representing the AST context
@@ -4641,7 +4666,7 @@ function quux () {
4641
4666
4642
4667
Requires a hyphen before the ` @param ` description.
4643
4668
4644
- <a name =" eslint-plugin-jsdoc-rules-require-hyphen-before-param-description-options-9 " ></a >
4669
+ <a name =" eslint-plugin-jsdoc-rules-require-hyphen-before-param-description-options-10 " ></a >
4645
4670
#### Options
4646
4671
4647
4672
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" ` .
@@ -4747,7 +4772,7 @@ function quux () {
4747
4772
Checks for presence of jsdoc comments, on class declarations as well as
4748
4773
functions.
4749
4774
4750
- <a name =" eslint-plugin-jsdoc-rules-require-jsdoc-options-10 " ></a >
4775
+ <a name =" eslint-plugin-jsdoc-rules-require-jsdoc-options-11 " ></a >
4751
4776
#### Options
4752
4777
4753
4778
Accepts one optional options object with the following optional keys.
@@ -5887,7 +5912,7 @@ function quux (foo) {
5887
5912
5888
5913
Requires that all function parameters are documented.
5889
5914
5890
- <a name =" eslint-plugin-jsdoc-rules-require-param-options-11 " ></a >
5915
+ <a name =" eslint-plugin-jsdoc-rules-require-param-options-12 " ></a >
5891
5916
#### Options
5892
5917
5893
5918
An options object accepts one optional property:
@@ -6914,7 +6939,7 @@ Requires returns are documented.
6914
6939
6915
6940
Will also report if multiple ` @returns ` tags are present.
6916
6941
6917
- <a name =" eslint-plugin-jsdoc-rules-require-returns-options-12 " ></a >
6942
+ <a name =" eslint-plugin-jsdoc-rules-require-returns-options-13 " ></a >
6918
6943
#### Options
6919
6944
6920
6945
- ` exemptedBy ` - Array of tags (e.g., ` ['type'] ` ) whose presence on the document
@@ -7370,7 +7395,7 @@ Also impacts behaviors on namepath (or event)-defining and pointing tags:
7370
7395
allow ` # ` , ` . ` , or ` ~ ` at the end (which is not allowed at the end of
7371
7396
normal paths).
7372
7397
7373
- <a name =" eslint-plugin-jsdoc-rules-valid-types-options-13 " ></a >
7398
+ <a name =" eslint-plugin-jsdoc-rules-valid-types-options-14 " ></a >
7374
7399
#### Options
7375
7400
7376
7401
- ` allowEmptyNamepaths ` (default: true) - Set to ` false ` to disallow
0 commit comments