Skip to content

Commit c5a09c8

Browse files
committed
feat(require-description-complete-sentence): allow inline inheritDoc, inheritdoc, include, includeCode, label to avoid rule; fixes #1641
1 parent ba0034e commit c5a09c8

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,7 @@ const code = (parameter) => 123;
844844
*/
845845
export class ClassExemple {
846846
}
847+
848+
/** {@inheritDoc SomeClass} */
847849
````
848850

src/rules/requireDescriptionCompleteSentence.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,21 @@ export default iterateJsdoc(({
222222
newlineBeforeCapsAssumesBadSentenceEnd = false,
223223
} = context.options[0] || {};
224224

225+
// `@inheritDoc` can be used as inline tag with TSDoc/typedoc: https://typedoc.org/documents/Tags.__inheritDoc_.html
226+
if (utils.getInlineTags().some(({
227+
tag,
228+
}) => {
229+
return [
230+
// Typdoc
231+
'include', 'includeCode',
232+
// TSDoc
233+
'inheritDoc', 'inheritdoc',
234+
'label',
235+
].includes(tag);
236+
})) {
237+
return;
238+
}
239+
225240
const abbreviationsRegex = abbreviations.length ?
226241
new RegExp('\\b' + abbreviations.map((abbreviation) => {
227242
return escapeStringRegexp(abbreviation.replaceAll(/\.$/gv, '') + '.');

test/rules/assertions/requireDescriptionCompleteSentence.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,5 +1607,10 @@ export default /** @type {import('../index.js').TestCases} */ ({
16071607
16081608
`,
16091609
},
1610+
{
1611+
code: `
1612+
/** {@inheritDoc SomeClass} */
1613+
`,
1614+
},
16101615
],
16111616
});

0 commit comments

Comments
 (0)