Skip to content

Commit a9cd1db

Browse files
committed
fix(tag-lines): avoid new startLines option expecting whitespace when no tags are present; fixes #1024
1 parent 9bb4bfd commit a9cd1db

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23481,6 +23481,13 @@ function processSass (input) {
2348123481
function processSass (input) {
2348223482
}
2348323483
// "jsdoc/tag-lines": ["error"|"warn", "never",{"startLines":1}]
23484+
23485+
/**
23486+
* Toggles the deselect all icon button action
23487+
*/
23488+
function updateIconButton () {
23489+
}
23490+
// "jsdoc/tag-lines": ["error"|"warn", "never",{"startLines":1}]
2348423491
````
2348523492

2348623493

src/rules/tagLines.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ export default iterateJsdoc(({
199199
});
200200

201201
if (typeof startLines === 'number') {
202+
if (!jsdoc.tags.length) {
203+
return;
204+
}
205+
202206
const {
203207
description,
204208
lastDescriptionLine,

test/rules/assertions/tagLines.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,5 +1124,20 @@ export default {
11241124
},
11251125
],
11261126
},
1127+
{
1128+
code: `
1129+
/**
1130+
* Toggles the deselect all icon button action
1131+
*/
1132+
function updateIconButton () {
1133+
}
1134+
`,
1135+
options: [
1136+
'never',
1137+
{
1138+
startLines: 1,
1139+
},
1140+
],
1141+
},
11271142
],
11281143
};

0 commit comments

Comments
 (0)