|
8 | 8 | * [`linesBetween`](#user-content-sort-tags-options-linesbetween) |
9 | 9 | * [`reportIntraTagGroupSpacing`](#user-content-sort-tags-options-reportintrataggroupspacing) |
10 | 10 | * [`reportTagGroupSpacing`](#user-content-sort-tags-options-reporttaggroupspacing) |
| 11 | + * [`tagExceptions`](#user-content-sort-tags-options-tagexceptions) |
11 | 12 | * [`tagSequence`](#user-content-sort-tags-options-tagsequence) |
12 | 13 | * [Context and settings](#user-content-sort-tags-context-and-settings) |
13 | 14 | * [Failing examples](#user-content-sort-tags-failing-examples) |
@@ -80,6 +81,12 @@ as set by `linesBetween`. Defaults to `true`. Note that the very last tag |
80 | 81 | will not have spacing applied regardless. For adding line breaks there, you |
81 | 82 | may wish to use the `endLines` option of the `tag-lines` rule. |
82 | 83 |
|
| 84 | +<a name="user-content-sort-tags-options-tagexceptions"></a> |
| 85 | +<a name="sort-tags-options-tagexceptions"></a> |
| 86 | +### <code>tagExceptions</code> |
| 87 | + |
| 88 | +Allows specification by tag of a specific higher maximum number of lines. Keys are tags and values are the maximum number of lines allowed for such tags. Overrides `linesBetween`. Defaults to no special exceptions per tag. |
| 89 | + |
83 | 90 | <a name="user-content-sort-tags-options-tagsequence"></a> |
84 | 91 | <a name="sort-tags-options-tagsequence"></a> |
85 | 92 | ### <code>tagSequence</code> |
@@ -285,7 +292,7 @@ See description on `tagSequence`. |
285 | 292 | |Tags|any| |
286 | 293 | |Recommended|false| |
287 | 294 | |Settings|| |
288 | | -|Options|`alphabetizeExtras`, `linesBetween`, `reportIntraTagGroupSpacing`, `reportTagGroupSpacing`, `tagSequence`| |
| 295 | +|Options|`alphabetizeExtras`, `linesBetween`, `reportIntraTagGroupSpacing`, `reportTagGroupSpacing`, `tagExceptions`, `tagSequence`| |
289 | 296 |
|
290 | 297 | <a name="user-content-sort-tags-failing-examples"></a> |
291 | 298 | <a name="sort-tags-failing-examples"></a> |
@@ -531,6 +538,19 @@ function quux () {} |
531 | 538 | */ |
532 | 539 | // "jsdoc/sort-tags": ["error"|"warn", {"tagSequence":[{"tags":["internal"]},{"tags":["template","param"]},{"tags":["returns"]},{"tags":["throws"]},{"tags":["see"]},{"tags":["example"]},{"tags":["since"]},{"tags":["deprecated"]}]}] |
533 | 540 | // Message: Tag groups do not have the expected whitespace |
| 541 | + |
| 542 | +/** |
| 543 | + * @param b |
| 544 | + * @param a |
| 545 | + * @returns {string} |
| 546 | + * @example abc |
| 547 | + * |
| 548 | + * |
| 549 | + * @example def |
| 550 | + */ |
| 551 | +function quux () {} |
| 552 | +// "jsdoc/sort-tags": ["error"|"warn", {"linesBetween":0,"tagExceptions":{"example":1}}] |
| 553 | +// Message: Intra-group tags have unexpected whitespace |
534 | 554 | ```` |
535 | 555 |
|
536 | 556 |
|
@@ -651,5 +671,16 @@ function quux () {} |
651 | 671 | */ |
652 | 672 | function quux () {} |
653 | 673 | // "jsdoc/sort-tags": ["error"|"warn", {"linesBetween":2,"reportTagGroupSpacing":false,"tagSequence":[{"tags":["qrs"]},{"tags":["def","xyz"]},{"tags":["abc"]}]}] |
| 674 | + |
| 675 | +/** |
| 676 | + * @param b |
| 677 | + * @param a |
| 678 | + * @returns {string} |
| 679 | + * @example abc |
| 680 | + * |
| 681 | + * @example def |
| 682 | + */ |
| 683 | +function quux () {} |
| 684 | +// "jsdoc/sort-tags": ["error"|"warn", {"linesBetween":0,"tagExceptions":{"example":1}}] |
654 | 685 | ```` |
655 | 686 |
|
0 commit comments