Skip to content

Commit

Permalink
fix(require-description-complete-sentence): regression re: not trim…
Browse files Browse the repository at this point in the history
…ming of description for check as relevant to tag description checking; fixes #672
  • Loading branch information
Brett Zamir committed Jan 14, 2021
1 parent 9f69c36 commit d81caa2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -8383,6 +8383,15 @@ function quux () {
*/
function speak() {
}
/**
* @param foo
*
* @returns {void}
*/
export default (foo) => {
foo()
}
````
Expand Down
2 changes: 1 addition & 1 deletion src/rules/requireDescriptionCompleteSentence.js
Expand Up @@ -190,7 +190,7 @@ export default iterateJsdoc(({
});

tagsWithNames.some((tag) => {
const desc = _.trimStart(tag.description, '- ');
const desc = _.trimStart(tag.description, '- ').trimEnd();

return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);
});
Expand Down
15 changes: 15 additions & 0 deletions test/rules/assertions/requireDescriptionCompleteSentence.js
Expand Up @@ -1353,5 +1353,20 @@ export default {
}
`,
},
{
code: `
/**
* @param foo
*
* @returns {void}
*/
export default (foo) => {
foo()
}
`,
parserOptions: {
sourceType: 'module',
},
},
],
};

0 comments on commit d81caa2

Please sign in to comment.