Skip to content

Commit

Permalink
fix: avoid erring with blank lines; fixes gajus#961
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Jan 28, 2023
1 parent 4883cd0 commit 38f17c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/requireDescriptionCompleteSentence.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const validateDescription = (
return false;
}

const paragraphs = extractParagraphs(description);
const paragraphs = extractParagraphs(description).filter(Boolean);

return paragraphs.some((paragraph, parIdx) => {
const sentences = extractSentences(paragraph, abbreviationsRegex);
Expand Down
18 changes: 18 additions & 0 deletions test/rules/assertions/requireDescriptionCompleteSentence.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,5 +1470,23 @@ export default {
* see: https://github.com/d3/d3-ease. */
`,
},
{
code: `
/**
* Maps the state to props.
*
* @param {object} state - The current state.
* @param {object} ownProps - The props currently passed to the component.
* @returns {{
* currentSupplierIntId: number,
* currentAccountIntId: number,
* isLoading: boolean
* }} - The props.
*/
const mapStateToProps = (state, ownProps) => {
}
`,
ignoreReadme: true,
},
],
};

0 comments on commit 38f17c0

Please sign in to comment.