Skip to content

Commit

Permalink
feat: for tag-lines, add endLines in place of dropEndLines and …
Browse files Browse the repository at this point in the history
…`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`
  • Loading branch information
brettz9 committed Apr 18, 2023
1 parent 41d1cf3 commit 9e96b75
Show file tree
Hide file tree
Showing 10 changed files with 733 additions and 1,056 deletions.
2 changes: 0 additions & 2 deletions .README/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Finally, enable all of the rules that you would like to use.
"jsdoc/informative-docs": 1,
"jsdoc/match-description": 1,
"jsdoc/multiline-blocks": 1, // Recommended
"jsdoc/newline-after-description": 1, // Recommended
"jsdoc/no-bad-blocks": 1,
"jsdoc/no-blank-block-descriptions": 1,
"jsdoc/no-defaults": 1,
Expand Down Expand Up @@ -607,7 +606,6 @@ selector).
{"gitdown": "include", "file": "./rules/match-description.md"}
{"gitdown": "include", "file": "./rules/match-name.md"}
{"gitdown": "include", "file": "./rules/multiline-blocks.md"}
{"gitdown": "include", "file": "./rules/newline-after-description.md"}
{"gitdown": "include", "file": "./rules/no-bad-blocks.md"}
{"gitdown": "include", "file": "./rules/no-blank-block-descriptions.md"}
{"gitdown": "include", "file": "./rules/no-defaults.md"}
Expand Down
19 changes: 0 additions & 19 deletions .README/rules/newline-after-description.md

This file was deleted.

30 changes: 23 additions & 7 deletions .README/rules/tag-lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,44 @@

Enforces lines (or no lines) between tags.

If you only want lines preceding all tags or after all tags, you can use
the "any" option along with `startLines` and/or `endLines`.

The "always" or "never" options of this rule should not
be used with the linebreak-setting options of the `sort-tags` rule as both
may try to impose a conflicting number of lines.

#### Options

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

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

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

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

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

##### `noEndLines` (defaults to `false`)
##### `applyToEndTag` (defaults to `true`)

Set to `false` and use with "always" to indicate the normal lines to be
added after tags should not be added after the final tag.

##### `startLines` (defaults to `0`)

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

##### `dropEndLines` (defaults to `false`)
##### `endLines` (defaults to `0`)

If defined, will drop end lines for the final tag only.
If not set to `null`, will enforce end lines to the given count on the
final tag only.

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

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

<!-- assertions tagLines -->
Loading

0 comments on commit 9e96b75

Please sign in to comment.