Skip to content

Commit

Permalink
fix: requireReturns Rule does not honor inheritdoc tag (fixes #153)
Browse files Browse the repository at this point in the history
RequireReturns Rule does not honor inheritdoc tag.
  • Loading branch information
gajus committed Feb 24, 2019
2 parents 9b185d8 + 5edb2e1 commit af5a9a9
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 af5a9a9

Please sign in to comment.