Skip to content

Commit 9e96b75

Browse files
committed
feat: for tag-lines, add endLines in place of dropEndLines and applyToEndTag in place of noEndLines; add startLines in place of newline-after-description rule
BREAKING CHANGE: 1. Removes `jsdoc/newline-after-description` rule in favor of `jsdoc/tag-lines` with option `startLines: 0` for "never" and `startLines: 1` for "always". Defaults now to `startLines: 0` 2. Removes `dropEndLines: true` from `jsdoc/tag-lines` in favor of option `endLines: 0` 3. Drops `jsdoc/tag-lines` rule's `noEndLines: true` in favor of `applyToEndTag: false`
1 parent 41d1cf3 commit 9e96b75

10 files changed

+733
-1056
lines changed

.README/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ Finally, enable all of the rules that you would like to use.
5959
"jsdoc/informative-docs": 1,
6060
"jsdoc/match-description": 1,
6161
"jsdoc/multiline-blocks": 1, // Recommended
62-
"jsdoc/newline-after-description": 1, // Recommended
6362
"jsdoc/no-bad-blocks": 1,
6463
"jsdoc/no-blank-block-descriptions": 1,
6564
"jsdoc/no-defaults": 1,
@@ -607,7 +606,6 @@ selector).
607606
{"gitdown": "include", "file": "./rules/match-description.md"}
608607
{"gitdown": "include", "file": "./rules/match-name.md"}
609608
{"gitdown": "include", "file": "./rules/multiline-blocks.md"}
610-
{"gitdown": "include", "file": "./rules/newline-after-description.md"}
611609
{"gitdown": "include", "file": "./rules/no-bad-blocks.md"}
612610
{"gitdown": "include", "file": "./rules/no-blank-block-descriptions.md"}
613611
{"gitdown": "include", "file": "./rules/no-defaults.md"}

.README/rules/newline-after-description.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.README/rules/tag-lines.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,44 @@
22

33
Enforces lines (or no lines) between tags.
44

5+
If you only want lines preceding all tags or after all tags, you can use
6+
the "any" option along with `startLines` and/or `endLines`.
7+
8+
The "always" or "never" options of this rule should not
9+
be used with the linebreak-setting options of the `sort-tags` rule as both
10+
may try to impose a conflicting number of lines.
11+
512
#### Options
613

714
The first option is a single string set to "always", "never", or "any"
815
(defaults to "never").
916

1017
"any" is only useful with `tags` (allowing non-enforcement of lines except
11-
for particular tags) or with `dropEndLines`.
18+
for particular tags) or with `startLines` or `endLines`. It is also
19+
necessary if using the linebreak-setting options of the `sort-tags` rule
20+
so that the two rules won't conflict in both attempting to set lines
21+
between tags.
1222

1323
The second option is an object with the following optional properties.
1424

1525
##### `count` (defaults to 1)
1626

1727
Use with "always" to indicate the number of lines to require be present.
1828

19-
##### `noEndLines` (defaults to `false`)
29+
##### `applyToEndTag` (defaults to `true`)
30+
31+
Set to `false` and use with "always" to indicate the normal lines to be
32+
added after tags should not be added after the final tag.
33+
34+
##### `startLines` (defaults to `0`)
2035

21-
Use with "always" to indicate the normal lines to be added after tags should
22-
not be added after the final tag.
36+
If not set to `null`, will enforce end lines to the given count before the
37+
first tag only.
2338

24-
##### `dropEndLines` (defaults to `false`)
39+
##### `endLines` (defaults to `0`)
2540

26-
If defined, will drop end lines for the final tag only.
41+
If not set to `null`, will enforce end lines to the given count on the
42+
final tag only.
2743

2844
##### `tags` (default to empty object)
2945

@@ -41,6 +57,6 @@ following keys:
4157
|Tags|Any|
4258
|Recommended|true|
4359
|Settings|N/A|
44-
|Options|(a string matching `"always" or "never"` and optional object with `count` and `noEndLines`)|
60+
|Options|(a string matching `"always"`, `"never"`, or `"any"` and optional object with `count`, `applyToEndTag`, `startLines`, `endLines`)|
4561

4662
<!-- assertions tagLines -->

0 commit comments

Comments
 (0)