Skip to content

Commit 866b719

Browse files
committed
refactor: remove now unused returns as function option
1 parent 616bc83 commit 866b719

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/iterateJsdoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ export default function iterateJsdoc (iterator, ruleConfig) {
348348
if (!metaType || !['problem', 'suggestion', 'layout'].includes(metaType)) {
349349
throw new TypeError('Rule must include `meta.type` option (with value "problem", "suggestion", or "layout")');
350350
}
351-
if (typeof iterator !== 'function' && (!ruleConfig || typeof ruleConfig.returns !== 'function')) {
352-
throw new TypeError('The iterator argument must be a function or an object with a `returns` method.');
351+
if (typeof iterator !== 'function') {
352+
throw new TypeError('The iterator argument must be a function.');
353353
}
354354

355355
if (ruleConfig.iterateAllJsdocs) {

test/iterateJsdoc.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ describe('iterateJsdoc', () => {
5353
iterateJsdoc(() => {}, {meta: {type: 'suggestion'}});
5454
}).to.not.throw();
5555
});
56-
it('Does not throw with object and options', () => {
57-
expect(() => {
58-
iterateJsdoc(undefined, {
59-
meta: {type: 'suggestion'},
60-
returns () {
61-
return {};
62-
}
63-
});
64-
}).to.not.throw();
65-
});
6656
});
6757
});
6858
});

0 commit comments

Comments
 (0)