Skip to content

Commit

Permalink
fix(tag-lines): avoid new startLines option expecting whitespace …
Browse files Browse the repository at this point in the history
…when no tags are present; fixes #1024
  • Loading branch information
brettz9 committed Apr 18, 2023
1 parent 9bb4bfd commit a9cd1db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23481,6 +23481,13 @@ function processSass (input) {
function processSass (input) {
}
// "jsdoc/tag-lines": ["error"|"warn", "never",{"startLines":1}]

/**
* Toggles the deselect all icon button action
*/
function updateIconButton () {
}
// "jsdoc/tag-lines": ["error"|"warn", "never",{"startLines":1}]
````


Expand Down
4 changes: 4 additions & 0 deletions src/rules/tagLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ export default iterateJsdoc(({
});

if (typeof startLines === 'number') {
if (!jsdoc.tags.length) {
return;
}

const {
description,
lastDescriptionLine,
Expand Down
15 changes: 15 additions & 0 deletions test/rules/assertions/tagLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,5 +1124,20 @@ export default {
},
],
},
{
code: `
/**
* Toggles the deselect all icon button action
*/
function updateIconButton () {
}
`,
options: [
'never',
{
startLines: 1,
},
],
},
],
};

0 comments on commit a9cd1db

Please sign in to comment.