Skip to content

Commit e8b1475

Browse files
committed
fix(require-description-complete-sentence): allow all inline tags at beginning of sentence; fixes #1150
1 parent 8dbcb6f commit e8b1475

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function quux (foo) {
211211
function quux (foo) {
212212

213213
}
214-
// Message: Sentences should start with an uppercase character.
214+
// Message: Sentences must end with a period.
215215

216216
/**
217217
* Foo.
@@ -816,5 +816,7 @@ function quux () {}
816816
function quux () {
817817

818818
}
819+
820+
/** @param options {@link RequestOptions} specifying path parameters and query parameters. */
819821
````
820822

src/rules/requireDescriptionCompleteSentence.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const extractParagraphs = (text) => {
2525
const extractSentences = (text, abbreviationsRegex) => {
2626
const txt = text
2727
// Remove all {} tags.
28-
.replaceAll(/\{[\s\S]*?\}\s*/gu, '')
28+
.replaceAll(/(?<!^)\{[\s\S]*?\}\s*/gu, '')
2929

3030
// Remove custom abbreviations
3131
.replace(abbreviationsRegex, '');

test/rules/assertions/requireDescriptionCompleteSentence.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -316,18 +316,14 @@ export default {
316316
}
317317
`,
318318
errors: [
319-
{
320-
line: 3,
321-
message: 'Sentences should start with an uppercase character.',
322-
},
323319
{
324320
line: 3,
325321
message: 'Sentences must end with a period.',
326322
},
327323
],
328324
output: `
329325
/**
330-
* {@see Foo.bar} Buz.
326+
* {@see Foo.bar} buz.
331327
*/
332328
function quux (foo) {
333329
@@ -1576,5 +1572,10 @@ export default {
15761572
}
15771573
`,
15781574
},
1575+
{
1576+
code: `
1577+
/** @param options {@link RequestOptions} specifying path parameters and query parameters. */
1578+
`,
1579+
},
15791580
],
15801581
};

0 commit comments

Comments
 (0)