Skip to content

Commit

Permalink
fix(require-description-complete-sentence): capture multiple newlin…
Browse files Browse the repository at this point in the history
…es as "paragraphs"; fixes #1193
  • Loading branch information
brettz9 committed Jan 26, 2024
1 parent 6b163c8 commit c5f203a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/rules/require-description-complete-sentence.md
Expand Up @@ -818,5 +818,16 @@ function quux () {
}

/** @param options {@link RequestOptions} specifying path parameters and query parameters. */

/**
* A single line for testing.
*
* ```js
* const aCodeExample = true;
* ```
*
* @param parameter
*/
const code = (parameter) => 123;
````

2 changes: 1 addition & 1 deletion src/rules/requireDescriptionCompleteSentence.js
Expand Up @@ -14,7 +14,7 @@ const otherDescriptiveTags = new Set([
* @returns {string[]}
*/
const extractParagraphs = (text) => {
return text.split(/(?<![;:])\n\n/u);
return text.split(/(?<![;:])\n\n+/u);
};

/**
Expand Down
14 changes: 14 additions & 0 deletions test/rules/assertions/requireDescriptionCompleteSentence.js
Expand Up @@ -1577,5 +1577,19 @@ export default {
/** @param options {@link RequestOptions} specifying path parameters and query parameters. */
`,
},
{
code: `
/**
* A single line for testing.
*
* \`\`\`js
* const aCodeExample = true;
* \`\`\`
*
* @param parameter
*/
const code = (parameter) => 123;
`,
},
],
};

0 comments on commit c5f203a

Please sign in to comment.