Skip to content

Commit

Permalink
RequireReturns Rule does not honor inheritdoc tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
thsmi committed Feb 24, 2019
1 parent 663f59e commit 5edb2e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rules/requireReturns.js
Expand Up @@ -6,6 +6,14 @@ export default iterateJsdoc(({
report,
utils
}) => {
// inheritdoc implies that all documentation is inherited
// see http://usejsdoc.org/tags-inheritdoc.html
//
// As we do not know the parent method, we cannot perform any checks.
if (utils.hasTag('inheritdoc')) {
return;
}

const targetTagName = utils.getPreferredTagName('returns');

const jsdocTags = _.filter(jsdoc.tags, {
Expand Down
10 changes: 10 additions & 0 deletions test/rules/assertions/requireReturns.js
Expand Up @@ -138,6 +138,16 @@ export default {
*/
const quux = (bar) => bar.filter(({ corge }) => corge())
`
},
{
code: `
/**
* @inheritdoc
*/
function quux (foo) {
return "test"
}
`
}
]
};

0 comments on commit 5edb2e1

Please sign in to comment.