Skip to content

Commit dc2f86f

Browse files
blondgajus
authored andcommitted
fix: support valid colon for require-description-complete-sentence rule (gajus#98)
1 parent 175ef6d commit dc2f86f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/rules/requireDescriptionCompleteSentence.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const extractSentences = (text) => {
1010

1111
// Remove all {} tags.
1212
.replace(/\{[\s\S]*?\}\s*/g, '')
13-
.split(/[.?!:](?:\s+|$)/)
13+
.split(/[.?!](?:\s+|$)/)
1414

1515
// Ignore sentences with only whitespaces.
1616
.filter((sentence) => {

test/rules/assertions/requireDescriptionCompleteSentence.js

+10
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,16 @@ export default {
533533
*/
534534
function quux () {
535535
536+
}
537+
`
538+
},
539+
{
540+
code: `
541+
/**
542+
* Hello: world.
543+
*/
544+
function quux () {
545+
536546
}
537547
`
538548
}

0 commit comments

Comments
 (0)