Skip to content

Commit c5f203a

Browse files
committedJan 26, 2024
fix(require-description-complete-sentence): capture multiple newlines as "paragraphs"; fixes #1193
1 parent 6b163c8 commit c5f203a

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
 

‎docs/rules/require-description-complete-sentence.md

+11
Original file line numberDiff line numberDiff line change
@@ -818,5 +818,16 @@ function quux () {
818818
}
819819

820820
/** @param options {@link RequestOptions} specifying path parameters and query parameters. */
821+
822+
/**
823+
* A single line for testing.
824+
*
825+
* ```js
826+
* const aCodeExample = true;
827+
* ```
828+
*
829+
* @param parameter
830+
*/
831+
const code = (parameter) => 123;
821832
````
822833

‎src/rules/requireDescriptionCompleteSentence.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const otherDescriptiveTags = new Set([
1414
* @returns {string[]}
1515
*/
1616
const extractParagraphs = (text) => {
17-
return text.split(/(?<![;:])\n\n/u);
17+
return text.split(/(?<![;:])\n\n+/u);
1818
};
1919

2020
/**

‎test/rules/assertions/requireDescriptionCompleteSentence.js

+14
Original file line numberDiff line numberDiff line change
@@ -1577,5 +1577,19 @@ export default {
15771577
/** @param options {@link RequestOptions} specifying path parameters and query parameters. */
15781578
`,
15791579
},
1580+
{
1581+
code: `
1582+
/**
1583+
* A single line for testing.
1584+
*
1585+
* \`\`\`js
1586+
* const aCodeExample = true;
1587+
* \`\`\`
1588+
*
1589+
* @param parameter
1590+
*/
1591+
const code = (parameter) => 123;
1592+
`,
1593+
},
15801594
],
15811595
};

0 commit comments

Comments
 (0)
Please sign in to comment.