Skip to content

Commit bee3779

Browse files
committed
testing(require-description-complete-sentence): add test cases for Markdown
1 parent 456206e commit bee3779

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,6 +3566,14 @@ function quux () {
35663566
}
35673567
// Message: Sentence must end with a period.
35683568

3569+
/**
3570+
* `foo` is a variable
3571+
*/
3572+
function quux () {
3573+
3574+
}
3575+
// Message: Sentence must end with a period.
3576+
35693577
/**
35703578
* Foo.
35713579
*
@@ -3807,6 +3815,44 @@ function quux () {
38073815
*/
38083816
function quux () {
38093817

3818+
}
3819+
3820+
/**
3821+
* `foo` is a variable.
3822+
*/
3823+
function quux () {
3824+
3825+
}
3826+
3827+
/**
3828+
* Foo.
3829+
*
3830+
* `foo`.
3831+
*/
3832+
function quux () {
3833+
3834+
}
3835+
3836+
/**
3837+
* @param foo - `bar`.
3838+
*/
3839+
function quux () {
3840+
3841+
}
3842+
3843+
/**
3844+
* @returns {number} `foo`.
3845+
*/
3846+
function quux () {
3847+
3848+
}
3849+
3850+
/**
3851+
* Foo
3852+
* `bar`.
3853+
*/
3854+
function quux () {
3855+
38103856
}
38113857
````
38123858

test/rules/assertions/requireDescriptionCompleteSentence.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,29 @@ export default {
9292
}
9393
`
9494
},
95+
{
96+
code: `
97+
/**
98+
* \`foo\` is a variable
99+
*/
100+
function quux () {
101+
102+
}
103+
`,
104+
errors: [
105+
{
106+
message: 'Sentence must end with a period.'
107+
}
108+
],
109+
output: `
110+
/**
111+
* \`foo\` is a variable.
112+
*/
113+
function quux () {
114+
115+
}
116+
`
117+
},
95118
{
96119
code: `
97120
/**
@@ -607,6 +630,59 @@ export default {
607630
*/
608631
function quux () {
609632
633+
}
634+
`
635+
},
636+
{
637+
code: `
638+
/**
639+
* \`foo\` is a variable.
640+
*/
641+
function quux () {
642+
643+
}
644+
`
645+
},
646+
{
647+
code: `
648+
/**
649+
* Foo.
650+
*
651+
* \`foo\`.
652+
*/
653+
function quux () {
654+
655+
}
656+
`
657+
},
658+
{
659+
code: `
660+
/**
661+
* @param foo - \`bar\`.
662+
*/
663+
function quux () {
664+
665+
}
666+
`
667+
},
668+
{
669+
code: `
670+
/**
671+
* @returns {number} \`foo\`.
672+
*/
673+
function quux () {
674+
675+
}
676+
`
677+
},
678+
{
679+
code: `
680+
/**
681+
* Foo
682+
* \`bar\`.
683+
*/
684+
function quux () {
685+
610686
}
611687
`
612688
}

0 commit comments

Comments
 (0)